From b1b28986f6ebdd22e325bbc102399e4369731c03 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 Mar 2008 12:51:09 +0000 Subject: [PATCH] Fixed event listing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9308 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/addons/goto/class_gotomasses.inc | 23 ++++++++++--------- .../addons/goto/events/class_DaemonEvent.inc | 16 +++++++------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc index 2a80bf287..ee55782d2 100644 --- a/gosa-plugins/goto/addons/goto/class_gotomasses.inc +++ b/gosa-plugins/goto/addons/goto/class_gotomasses.inc @@ -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']." ".$task['MACADDRESS']; }else{ $tmp.= "\n".$task['ID']." - ".$task['HEADERTAG']." ".$task['MACADDRESS']; @@ -273,8 +273,8 @@ class gotomasses extends plugin $divlist->SetHeadpageMode(); $s = ".|"._("Actions")."|\n"; $s.= "..| "._("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']." ".$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)."..."; diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc index f5da13b04..e7fc70443 100644 --- a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc +++ b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc @@ -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; } } } -- 2.30.2