From 9330898d1d2d978d964f73370f9720d5ac539544 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 5 Mar 2008 17:49:07 +0000 Subject: [PATCH] Added lock and activate events git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9373 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/events/DaemonEvent_activate.tpl | 63 +++++++++++++++++ .../addons/goto/events/DaemonEvent_lock.tpl | 63 +++++++++++++++++ .../events/class_DaemonEvent_activate.inc | 67 +++++++++++++++++++ .../goto/events/class_DaemonEvent_lock.inc | 67 +++++++++++++++++++ 4 files changed, 260 insertions(+) create mode 100644 gosa-plugins/goto/addons/goto/events/DaemonEvent_activate.tpl create mode 100644 gosa-plugins/goto/addons/goto/events/DaemonEvent_lock.tpl create mode 100644 gosa-plugins/goto/addons/goto/events/class_DaemonEvent_activate.inc create mode 100644 gosa-plugins/goto/addons/goto/events/class_DaemonEvent_lock.inc diff --git a/gosa-plugins/goto/addons/goto/events/DaemonEvent_activate.tpl b/gosa-plugins/goto/addons/goto/events/DaemonEvent_activate.tpl new file mode 100644 index 000000000..4e3fc127d --- /dev/null +++ b/gosa-plugins/goto/addons/goto/events/DaemonEvent_activate.tpl @@ -0,0 +1,63 @@ + +{if $is_new} + + + + + + +
+ + + + + +
{t}Timestamp{/t}{$timestamp}
+
+ + + + +
+ {t}Target objects{/t} +
+ {$target_list} +
+
+ +{else} + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
{t}ID{/t}{$data.ID}
{t}Status{/t}{$data.STATUS}
{t}Result{/t}{$data.RESULT}
{t}Target{/t}{$data.MACADDRESS}
{t}Timestamp{/t}{$timestamp}
+
+ +
+
+ +{/if} diff --git a/gosa-plugins/goto/addons/goto/events/DaemonEvent_lock.tpl b/gosa-plugins/goto/addons/goto/events/DaemonEvent_lock.tpl new file mode 100644 index 000000000..4e3fc127d --- /dev/null +++ b/gosa-plugins/goto/addons/goto/events/DaemonEvent_lock.tpl @@ -0,0 +1,63 @@ + +{if $is_new} + + + + + + +
+ + + + + +
{t}Timestamp{/t}{$timestamp}
+
+ + + + +
+ {t}Target objects{/t} +
+ {$target_list} +
+
+ +{else} + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
{t}ID{/t}{$data.ID}
{t}Status{/t}{$data.STATUS}
{t}Result{/t}{$data.RESULT}
{t}Target{/t}{$data.MACADDRESS}
{t}Timestamp{/t}{$timestamp}
+
+ +
+
+ +{/if} diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_activate.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_activate.inc new file mode 100644 index 000000000..7300c35ea --- /dev/null +++ b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_activate.inc @@ -0,0 +1,67 @@ +s_Menu_Name = _("Activate"); + $this->s_Event_Name = _("Activate"); + $this->s_Schedule_Action = "job_trigger_action_activate"; + $this->s_Trigger_Action= "gosa_trigger_action_activate"; + $this->s_Queued_Action= "trigger_action_reboot"; + $this->s_Menu_Image = "images/openlock.png"; + $this->s_List_Image = "images/openlock.png"; + } + + public function execute() + { + DaemonEvent::execute(); + + $display = $this->get_header(); + + $tmp = $this->data; + + /* Check if target add dialog is open */ + if($this->is_target_list_open() && $this->is_new){ + return($this->get_target_add_list()); + } + + $smarty = get_smarty(); + $smarty->assign("data" , $this->data); + $smarty->assign("target_list" , $this->get_target_list()); + $smarty->assign("is_new" , $this->is_new); + $smarty->assign("timestamp" , $this->get_time_select()); + $display.= $smarty->fetch(get_template_path('DaemonEvent_activate.tpl', TRUE, dirname(__FILE__))); + $display.= $this->get_footer(); + return($display); + } + + public function save_object() + { + DaemonEvent::save_object(); + } +} +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_lock.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_lock.inc new file mode 100644 index 000000000..63c52ea6a --- /dev/null +++ b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_lock.inc @@ -0,0 +1,67 @@ +s_Menu_Name = _("Lock"); + $this->s_Event_Name = _("Lock"); + $this->s_Schedule_Action = "job_trigger_action_lock"; + $this->s_Trigger_Action= "gosa_trigger_action_lock"; + $this->s_Queued_Action= "trigger_action_reboot"; + $this->s_Menu_Image = "images/closedlock.png"; + $this->s_List_Image = "images/closedlock.png"; + } + + public function execute() + { + DaemonEvent::execute(); + + $display = $this->get_header(); + + $tmp = $this->data; + + /* Check if target add dialog is open */ + if($this->is_target_list_open() && $this->is_new){ + return($this->get_target_add_list()); + } + + $smarty = get_smarty(); + $smarty->assign("data" , $this->data); + $smarty->assign("target_list" , $this->get_target_list()); + $smarty->assign("is_new" , $this->is_new); + $smarty->assign("timestamp" , $this->get_time_select()); + $display.= $smarty->fetch(get_template_path('DaemonEvent_lock.tpl', TRUE, dirname(__FILE__))); + $display.= $this->get_footer(); + return($display); + } + + public function save_object() + { + DaemonEvent::save_object(); + } +} +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> -- 2.30.2