Code

Updated Events.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Feb 2008 07:41:45 +0000 (07:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Feb 2008 07:41:45 +0000 (07:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9142 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc
gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc
gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_halt.inc
gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reboot.inc
gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reinstall.inc
gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_update.inc
gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_wakeup.inc

index 22a91d117f3da5588893540570e88065cf3c06a8..2c7166680de79aa8d3ca9af433e9969d5cd12b86 100644 (file)
@@ -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(); 
index 0945f62866b67ff3fa7cb799cc61eb06d82d1b45..9dfe8008ab62f2c38f45bf820a46d0ef4953e67f 100644 (file)
@@ -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']    = "<img src='".$this->s_Menu_Image."' alt='".$this->s_Menu_Name."' border='0' class='center'>";
@@ -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.
    */
index 502ce884405068598b1cdbda2e03623aec483889..2831550bcd75ae5b85cbe049895f05e82c3c7ee5 100644 (file)
@@ -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";
   }
index 38e391b2a7b1e96b25de093da1c0b10ca1114e7f..22c1dd39338ffb1e022fccafa77a101319243b79 100644 (file)
@@ -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";
   }
index 59e3f57674b4f5d9f3dc59384d31844c9f79bc28..4957ab226a5b36e5061c0d8584d5c800f9fd223f 100644 (file)
@@ -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";
   
index 03e589c4bd72b3c48fb7ad290353475de31828b6..604dabd65e37fdd251c74e57c38dfc02d9365104 100644 (file)
@@ -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";
   }
index 69fb776d80631f2880df096b4f65ef473eb2d768..2f7da7cde56350b1a7bc538b07fd90e53915ee43 100644 (file)
@@ -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";
   }