From: hickert Date: Wed, 20 Feb 2008 12:23:48 +0000 (+0000) Subject: Updated gotomasses. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b1c42c58b3c5b7f8a2edaa4b83a6ef6237c0650b;p=gosa.git Updated gotomasses. -Some minor changes. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8983 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc b/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc index 1fb655a36..a03420249 100644 --- a/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc +++ b/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc @@ -67,7 +67,7 @@ class gotomasses extends plugin } /* Menu actions */ - if(isset($_POST['menu_action'])){ + if(isset($_POST['menu_action']) && !empty($_POST['menu_action'])){ $s_action = $_POST['menu_action']; } @@ -130,6 +130,8 @@ class gotomasses extends plugin * REMOVE ************/ + echo $s_action; + /* Remove multiple */ if($s_action == "remove_multiple" || $s_action == "remove"){ @@ -190,11 +192,33 @@ class gotomasses extends plugin # $this->current = -1; # } # - /* Close dialog */ - if(isset($_POST['abort_event_dialog'])){ - $this->dialog = FALSE; - $this->current = -1; - } + + /* Close dialog */ + if(isset($_POST['save_event_dialog'])){ + + if($this->dialog->is_new()){ + $header = $this->dialog->get_header_tag(); + $targets = $this->dialog->get_targets(); + $data = $this->dialog->save(); + $data['TIMESTAMP'] = $this->dialog->get_timestamp(); + + foreach($targets as $target){ + if(!$this->o_queue->send($header,$target,$data)){ + msg_dialog::display(_("Daemon"),sprintf(_("Something went wrong while talking to the daemon: %s."), + $this->o_queue->get_error()),ERROR_DIALOG); + } + } + $this->dialog = FALSE; + $this->current = -1; + } + } + + + /* Close dialog */ + if(isset($_POST['abort_event_dialog'])){ + $this->dialog = FALSE; + $this->current = -1; + } # # /* Close dialog */ # if((isset($_POST['save_goto_task']) || isset($_POST['apply_goto_task'])) && is_object($this->dialog) ){ @@ -447,11 +471,9 @@ class gotomasses extends plugin $stop = $this->range; $entries = $this->o_queue->get_queued_entries($start,$stop,$sort); - if(!is_array($entries)){ - if ($this->o_queue->get_error()){ - msg_dialog::display(_("Error"), sprintf(_("Cannot load queue entries: %s"), "

".$this->o_queue->get_error()), ERROR_DIALOG); - } - return(array()); + if ($this->o_queue->is_error()){ + + msg_dialog::display(_("Error"), sprintf(_("Cannot load queue entries: %s"), "

".$this->o_queue->get_error()), ERROR_DIALOG); } $this->entries = array(); @@ -534,17 +556,6 @@ class gotomasses extends plugin } - function get_actions() - { - /* Prepare list of available actions */ - $actions = array( - "gosa_ping" => _("GOsa ping"), - "ping" => _("Ping"), - "sayHello" => _("Say hello")); - return($actions); - } - - static function plInfo() { return (array( diff --git a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc index d321a3f20..88af593b7 100644 --- a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc +++ b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc @@ -467,6 +467,31 @@ class DaemonEvent } + public function is_new() + { + return($this->is_new); + } + + public function get_header_tag() + { + return($this->s_action); + } + + public function save() + { + return(array()); + } + + public function get_targets() + { + return($this->a_targets); + } + + public function get_timestamp() + { + return($this->_timestamp_to_event($this->timestamp)); + } + protected function list_get_selected_items() { $ids = array(); 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 02ff35dae..fadb51628 100644 --- a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_wakeup.inc +++ b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_wakeup.inc @@ -7,7 +7,7 @@ class DaemonEvent_wakeup extends DaemonEvent DaemonEvent::__construct($config,$data); $this->s_Menu_Name = _("Wake up"); $this->s_Event_Name = _("Wake up"); - $this->s_action = "trigger_action_wake"; + $this->s_action = "job_trigger_action_wake"; $this->s_Menu_Image = "images/status_running.png"; }