From 0c702635cb6de7e015d95d849524fc3ffe45ba97 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 27 Feb 2008 07:41:45 +0000 Subject: [PATCH] Updated Events. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9142 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/gotomasses/class_gotomasses.inc | 2 +- .../gotomasses/events/class_DaemonEvent.inc | 36 ++++++++++++++----- .../events/class_DaemonEvent_halt.inc | 4 +-- .../events/class_DaemonEvent_reboot.inc | 4 +-- .../events/class_DaemonEvent_reinstall.inc | 4 +-- .../events/class_DaemonEvent_update.inc | 4 +-- .../events/class_DaemonEvent_wakeup.inc | 4 +-- 7 files changed, 38 insertions(+), 20 deletions(-) diff --git a/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc b/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc index 22a91d117..2c7166680 100644 --- a/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc +++ b/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc @@ -190,7 +190,7 @@ class gotomasses extends plugin if(is_object($this->dialog)){ if($this->dialog->is_new()){ - $header = $this->dialog->get_header_tag(); + $header = $this->dialog->get_schedule_action(); $targets = $this->dialog->get_targets(); $data = $this->dialog->save(); $data['timestamp'] = $this->dialog->get_timestamp(); diff --git a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc index 0945f6286..9dfe8008a 100644 --- a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc +++ b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc @@ -40,8 +40,8 @@ class DaemonEvent protected $data; // The event data, when edited protected $a_targets = array(); // The list of assigned Targets (When newly created) - protected $s_New_Action = ""; // The deamon command name when newly created. (e.g. job_trigger_action_halt) - protected $s_Edit_Action= ""; // The deamon command name when edited. (e.g. trigger_action_halt) + protected $s_Schedule_Action = ""; // The deamon command name when newly created. (e.g. job_trigger_action_halt) + protected $s_Trigger_Action= ""; // The deamon command name when edited. (e.g. trigger_action_halt) protected $timestamp = 0; // Event execution time; protected $id = -1; // The Table ID protected $status = "unknown";// The current event status @@ -322,7 +322,7 @@ class DaemonEvent { $data =array(); $data['CLASS_NAME'] = get_class($this); - foreach(array("s_Menu_Name","s_Event_Name","s_New_Action","s_Edit_Action") as $attr){ + foreach(array("s_Menu_Name","s_Event_Name","s_Schedule_Action","s_Trigger_Action") as $attr){ $data[$attr] = $this->$attr; } $data['MenuImage'] = "".$this->s_Menu_Name.""; @@ -354,8 +354,8 @@ class DaemonEvent $evt = $tmp->get_event_info(); $list['BY_CLASS'][$name] = $evt; - $list['BY_EDIT_ACTION'][$evt['s_Edit_Action']]= $evt; - $list['BY_NEW_ACTION'] [$evt['s_New_Action']] = $evt; + $list['BY_EDIT_ACTION'][$evt['s_Trigger_Action']]= $evt; + $list['BY_NEW_ACTION'] [$evt['s_Schedule_Action']] = $evt; } } return($list); @@ -371,14 +371,22 @@ class DaemonEvent } - /*! \brief Returns the event tag e.g. 'job_trigger_action_wake' - @param Returns the event e.g. 'job_trigger_action_wake' + /*! \brief Returns the event tag to schedule a new action + @param Returns the event e.g. 'job_trigger_action_wake' */ - public function get_header_tag() + public function get_schedule_action() { - return($this->s_New_Action); + return($this->s_Schedule_Action); } + // + /*! \brief Returns the event tag to schedule a new action + @param Returns the event e.g. 'trigger_action_wake' + */ + public function get_trigger_action() + { + return($this->s_Trigger_Action); + } /*! brief Returns an array containig all attributes \ That should be written. @@ -436,6 +444,16 @@ class DaemonEvent return($ids); } + + /*! \brief Add a target MAC address + @param Array A List of all target that should be added. + */ + public function set_timestamp($stamp) + { + $this->timestamp = $stamp; + } + + /*! \brief Add a target MAC address @param Array A List of all target that should be added. */ diff --git a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_halt.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_halt.inc index 502ce8844..2831550bc 100644 --- a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_halt.inc +++ b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_halt.inc @@ -6,8 +6,8 @@ class DaemonEvent_halt extends DaemonEvent DaemonEvent::__construct($config,$data); $this->s_Menu_Name = _("Shutdown"); $this->s_Event_Name = _("Shutdown"); - $this->s_New_Action = "job_trigger_action_halt"; - $this->s_Edit_Action= "trigger_action_halt"; + $this->s_Schedule_Action = "job_trigger_action_halt"; + $this->s_Trigger_Action= "trigger_action_halt"; $this->s_Menu_Image = "images/status_stopped.png"; $this->s_List_Image = "images/status_stopped.png"; } diff --git a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reboot.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reboot.inc index 38e391b2a..22c1dd393 100644 --- a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reboot.inc +++ b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reboot.inc @@ -7,8 +7,8 @@ class DaemonEvent_reboot extends DaemonEvent DaemonEvent::__construct($config,$data); $this->s_Menu_Name = _("Reboot"); $this->s_Event_Name = _("Reboot a system"); - $this->s_New_Action = "job_trigger_action_reboot"; - $this->s_Edit_Action= "trigger_action_reboot"; + $this->s_Schedule_Action = "job_trigger_action_reboot"; + $this->s_Trigger_Action= "trigger_action_reboot"; $this->s_Menu_Image = "images/list_reload.png"; $this->s_List_Image = "images/list_reload.png"; } diff --git a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reinstall.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reinstall.inc index 59e3f5767..4957ab226 100644 --- a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reinstall.inc +++ b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reinstall.inc @@ -10,8 +10,8 @@ class DaemonEvent_reinstall extends DaemonEvent DaemonEvent::__construct($config,$data); $this->s_Menu_Name = _("Reinstall"); $this->s_Event_Name = _("Reinstall"); - $this->s_New_Action = "job_trigger_action_reinstall"; - $this->s_Edit_Action= "trigger_action_reinstall"; + $this->s_Schedule_Action = "job_trigger_action_reinstall"; + $this->s_Trigger_Action= "trigger_action_reinstall"; $this->s_Menu_Image = "images/fai_small.png"; $this->s_List_Image = "images/fai_small.png"; diff --git a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_update.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_update.inc index 03e589c4b..604dabd65 100644 --- a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_update.inc +++ b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_update.inc @@ -8,8 +8,8 @@ class DaemonEvent_update extends DaemonEvent DaemonEvent::__construct($config,$data); $this->s_Menu_Name = _("Software update"); $this->s_Event_Name = _("software update"); - $this->s_New_Action = "job_trigger_action_update"; - $this->s_Edit_Action= "trigger_action_update"; + $this->s_Schedule_Action = "job_trigger_action_update"; + $this->s_Trigger_Action= "trigger_action_update"; $this->s_Menu_Image = "images/time.png"; $this->s_List_Image = "images/time.png"; } diff --git a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_wakeup.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_wakeup.inc index 69fb776d8..2f7da7cde 100644 --- a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_wakeup.inc +++ b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_wakeup.inc @@ -7,8 +7,8 @@ class DaemonEvent_wakeup extends DaemonEvent DaemonEvent::__construct($config,$data); $this->s_Menu_Name = _("Wake up"); $this->s_Event_Name = _("Start a system"); - $this->s_New_Action = "job_trigger_action_wake"; - $this->s_Edit_Action= "trigger_action_wake"; + $this->s_Schedule_Action = "job_trigger_action_wake"; + $this->s_Trigger_Action= "trigger_action_wake"; $this->s_Menu_Image = "images/status_running.png"; $this->s_List_Image = "images/status_running.png"; } -- 2.30.2