Code

Fixed event listing
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Mar 2008 12:51:09 +0000 (12:51 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Mar 2008 12:51:09 +0000 (12:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9308 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/addons/goto/class_gotomasses.inc
gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc

index 2a80bf2875e4580b4edd378f3be8c88c1821ba1b..ee55782d20ee56026188069097dee14f7d165a24 100644 (file)
@@ -166,10 +166,9 @@ class gotomasses extends plugin
       $type = FALSE;
       if(isset($this->entries[$id])){
         $event = $this->entries[$s_entry];
-      
-        
-        if($event['STATUS'] == "waiting" && isset($this->events['BY_QUEUED_ACTION'][$event['HEADERTAG']])){
-          $type = $this->events['BY_QUEUED_ACTION'][$event['HEADERTAG']];
+        if($event['STATUS'] == "waiting" && isset($this->events['QUEUED'][$event['HEADERTAG']])){
+          $evt_name = $this->events['QUEUED'][$event['HEADERTAG']];
+          $type = $this->events['BY_CLASS'][$evt_name];
           $this->dialog = new $type['CLASS_NAME']($this->config,$event);
         }
       }
@@ -202,8 +201,9 @@ class gotomasses extends plugin
             /* Only remove WAITING or ERROR entries */
             if(in_array($task['STATUS'],array("waiting","error"))){
               $this->ids_to_remove[] = $task['ID'];
-              if(isset($this->events['BY_QUEUED_ACTION'][$task['HEADERTAG']])){
-                $evt = $this->events['BY_QUEUED_ACTION'][$task['HEADERTAG']];
+              if(isset($this->events['QUEUED'][$task['HEADERTAG']])){
+                $evt_name = $this->events['QUEUED'][$task['HEADERTAG']];
+                $evt = $this->events['BY_CLASS'][$evt_name];
                 $tmp.= "\n".$task['ID']." - ".$evt['s_Menu_Name']."&nbsp;".$task['MACADDRESS'];
               }else{
                 $tmp.= "\n".$task['ID']." - ".$task['HEADERTAG']."&nbsp;".$task['MACADDRESS'];
@@ -273,8 +273,8 @@ class gotomasses extends plugin
     $divlist->SetHeadpageMode();
     $s = ".|"._("Actions")."|\n";
     $s.= "..|<img src='images/list_new.png' alt='' border='0' class='center'>&nbsp;"._("Create")."\n";
-    foreach($this->events['BY_SCHEDULED_ACTION'] as $name =>  $event){
-      $name = $event['CLASS_NAME'];
+
+    foreach($this->events['SCHEDULED'] as $name =>  $event){
       $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|add_event_".$name."\n";
     }
     if($this->acl_is_removeable()){
@@ -388,9 +388,10 @@ class gotomasses extends plugin
       /* Check if this event exists as Daemon class 
        * In this case, display a more accurate entry.
        */ 
-      if(isset($this->events['BY_QUEUED_ACTION'][$task['HEADERTAG']]['s_Menu_Name'])){
-        $event_type = $this->events['BY_QUEUED_ACTION'][$task['HEADERTAG']];
-        $display2= $event_type['s_Menu_Name'];
+      if(isset($this->events['QUEUED'][$task['HEADERTAG']])){
+        $evt_name   = $this->events['QUEUED'][$task['HEADERTAG']];
+        $event_type = $this->events['BY_CLASS'][$evt_name];
+        $display2   = $event_type['s_Menu_Name'];
 
         if(strlen($display2) > 20){
           $display2 = substr($display2,0,18)."...";
index f5da13b044843c03ab19e9d3356ba69fb50f88dd..e7fc70443e863d9301c933d3109deb4897c12fe0 100644 (file)
@@ -378,10 +378,10 @@ class DaemonEvent
   {
     global $class_mapping,$config;
     $list = array();
-    $list['BY_CLASS'] = array();
-    $list['BY_TRIGGERED_ACTION'] = array();
-    $list['BY_SCHEDULED_ACTION'] = array();
-    $list['BY_QUEUED_ACTION'] = array();
+    $list['BY_CLASS']  = array();
+    $list['TRIGGERED'] = array();
+    $list['SCHEDULED'] = array();
+    $list['QUEUED']    = array();
 
     foreach($class_mapping as $name => $path){
       if(preg_match("/^DaemonEvent_/",$name)){
@@ -390,13 +390,15 @@ class DaemonEvent
           $evt  = $tmp->get_event_info();
           $list['BY_CLASS'][$name]                      = $evt;
           if(isset($evt['s_Trigger_Action'])){
-            $list['BY_TRIGGERED_ACTION'][$evt['s_Trigger_Action']]  = $evt;
+            $list['TRIGGERED'][$name] = $evt;
+            $list['QUEUED'][$evt['s_Trigger_Action']] = $name;
           }
           if(isset($evt['s_Schedule_Action'])){
-            $list['BY_SCHEDULED_ACTION'][$evt['s_Schedule_Action']] = $evt;
+            $list['SCHEDULED'][$name] = $evt;
+            $list['QUEUED'][$evt['s_Schedule_Action']] = $name;
           }
           if(isset($evt['s_Queued_Action'])){
-            $list['BY_QUEUED_ACTION']   [$evt['s_Queued_Action']]   = $evt;
+            $list['QUEUED'][$evt['s_Queued_Action']] = $name;
           }
         }
       }