From: hickert Date: Tue, 4 Mar 2008 12:30:59 +0000 (+0000) Subject: Updated gotomasses. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=314b3816c76070f26ec85e60555820183d5a78d6;p=gosa.git Updated gotomasses. -Only display those that are schedulable git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9307 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc index 13c563bb3..2a80bf287 100644 --- a/gosa-plugins/goto/addons/goto/class_gotomasses.inc +++ b/gosa-plugins/goto/addons/goto/class_gotomasses.inc @@ -273,7 +273,8 @@ class gotomasses extends plugin $divlist->SetHeadpageMode(); $s = ".|"._("Actions")."|\n"; $s.= "..| "._("Create")."\n"; - foreach($this->events['BY_CLASS'] as $name => $event){ + foreach($this->events['BY_SCHEDULED_ACTION'] as $name => $event){ + $name = $event['CLASS_NAME']; $s.= "...|".$event['MenuImage']." ".$event['s_Menu_Name']."|add_event_".$name."\n"; } if($this->acl_is_removeable()){ diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc index ae4f7e310..f5da13b04 100644 --- a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc +++ b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc @@ -23,9 +23,9 @@ define("SCHEDULED_EVENT",1); define("TRIGGERED_EVENT",2); -define("HIDDEN_EVENT",0); -define("SYSTEM_EVENT",1); -define("USER_EVENT" ,2); +define("HIDDEN_EVENT",1); +define("SYSTEM_EVENT",2); +define("USER_EVENT" ,4); /*! \brief This is the event base class @@ -347,9 +347,13 @@ class DaemonEvent public function get_event_info() { $data =array(); - $data['CLASS_NAME'] = get_class($this); - foreach(array("s_Menu_Name","s_Event_Name","s_Queued_Action","s_Schedule_Action","s_Trigger_Action") as $attr){ - $data[$attr] = $this->$attr; + $data['CLASS_NAME'] = get_class($this); + $data['s_Menu_Name'] = $this->s_Menu_Name; + $data['s_Event_Name'] = $this->s_Event_Name; + foreach(array("s_Queued_Action","s_Schedule_Action","s_Trigger_Action") as $attr){ + if(!empty($this->$attr)){ + $data[$attr] = $this->$attr; + } } $data['MenuImage'] = "".$this->s_Menu_Name.""; $data['ListImage'] = " $path){ if(preg_match("/^DaemonEvent_/",$name)){ $tmp = new $name($config); - if($tmp->visible_for & $type){ $evt = $tmp->get_event_info(); - $list['BY_CLASS'][$name] = $evt; - $list['BY_TRIGGERED_ACTION'][$evt['s_Trigger_Action']] = $evt; - $list['BY_SCHEDULED_ACTION'][$evt['s_Schedule_Action']] = $evt; - $list['BY_QUEUED_ACTION'] [$evt['s_Queued_Action']] = $evt; + if(isset($evt['s_Trigger_Action'])){ + $list['BY_TRIGGERED_ACTION'][$evt['s_Trigger_Action']] = $evt; + } + if(isset($evt['s_Schedule_Action'])){ + $list['BY_SCHEDULED_ACTION'][$evt['s_Schedule_Action']] = $evt; + } + if(isset($evt['s_Queued_Action'])){ + $list['BY_QUEUED_ACTION'] [$evt['s_Queued_Action']] = $evt; + } } } }