summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 519ade9)
raw | patch | inline | side by side (parent: 519ade9)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Feb 2008 08:47:49 +0000 (08:47 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Feb 2008 08:47:49 +0000 (08:47 +0000) |
-Added reinstall, halt, wakeup, update.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9118 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9118 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 9351fc9b47a9d73e529ac3ad94528a092dd32a59..d7043005ade083bbf655be090891afc180542046 100644 (file)
if(preg_match("/^add_event_/",$s_action)){
$type = preg_replace("/^add_event_/","",$s_action);
- if(isset($this->events[$type])){
- $e_data = $this->events[$type];
- $this->dialog = new $e_data['NAME']($this->config);
+ if(isset($this->events['BY_CLASS'][$type])){
+ $e_data = $this->events['BY_CLASS'][$type];
+ $this->dialog = new $e_data['CLASS_NAME']($this->config);
}
}
$divlist->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'"));
$divlist->AddHeader(array("string"=>"<a href='?plug=".$plug."&sort=TargetName'>"._("Target").$sort_img_1."</a>"));
$divlist->AddHeader(array("string"=>"<a href='?plug=".$plug."&sort=TaskID'>"._("Task").$sort_img_2."</a>",
- "attach"=>"style='width:80px;'"));
+ "attach"=>"style='width:120px;'"));
$divlist->AddHeader(array("string"=>"<a href='?plug=".$plug."&sort=Schedule'>"._("Schedule").$sort_img_3."</a>",
"attach"=>"style='width:100px;'"));
$divlist->AddHeader(array("string"=>"<a href='?plug=".$plug."&sort=Action'>"._("Status").$sort_img_4."</a>",
$color = "";
$display = $task['MACADDRESS'];
$display2= $task['HEADERTAG'];
-
- if( isset($this->events['BY_EDIT_ACTION'][$display2]['ListImage']) &&
- !empty($this->events['BY_EDIT_ACTION'][$display2]['ListImage'])){
- $display2 = $this->events['BY_EDIT_ACTION'][$display2]['ListImage'];
- }
+
+ /* Check if this event exists as Daemon class
+ * In this case, display a more accurate entry.
+ */
+ if(isset($this->events['BY_EDIT_ACTION'][$task['HEADERTAG']]['s_Menu_Name'])){
+ $event_type = $this->events['BY_EDIT_ACTION'][$task['HEADERTAG']];
+ $display2= $event_type['s_Menu_Name'];
+ if(isset($event_type['ListImage']) && !empty($event_type['ListImage'])){
+ $display2 = $event_type['ListImage']." ".$display2;
+ }
+ }
/* Create each field */
- $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
+ $field0 = array("string" => "<input type='checkbox' id='item_selected_".$task['ID']."' name='item_selected_".$key."'>" ,
"attach" => "style='width:20px;".$color."'");
$field1 = array("string" => $display,
"attach" => "style='".$color."'");
$field1a= array("string" => $display2,
- "attach" => "style='".$color.";width:80px; text-align:right;'");
+ "attach" => "style='".$color.";width:120px;'");
$field2 = array("string" => date("d.m.Y H:i:s",strtotime($task['TIMESTAMP'])),"attach" => "style='".$color.";width:100px;'");
$field3 = array("string" => $task['STATUS'],"attach" => "style='".$color.";width:80px;'");
$field4 = array("string" => $prio_actions.$action,"attach" => "style='".$color.";text-align:right;width:120px;border-right:0px;'");
$this->entries = array();
foreach($entries as $entry){
- $this->entries[]= $entry;
+ $this->entries[$entry['ID']]= $entry;
}
}
diff --git a/gosa-plugins/goto/addons/gotomasses/events/DaemonEvent_halt.tlp b/gosa-plugins/goto/addons/gotomasses/events/DaemonEvent_halt.tlp
--- /dev/null
@@ -0,0 +1,63 @@
+
+{if $is_new}
+
+<table style='width:100%;'>
+ <tr>
+ <td style='width:50%; vertical-align:top;'>
+ <table>
+ <tr>
+ <td style='vertical-align:top'>{t}Timestamp{/t}</td>
+ <td>{$timestamp}</td>
+ </tr>
+ </table>
+ </td>
+ <td style='width:50%; vertical-align:top;'>
+ <table style='width:100%;'>
+ <tr>
+ <td>
+ {t}Target objects{/t}
+ <br>
+ {$target_list}
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+{else}
+
+<table style='width:100%;'>
+ <tr>
+ <td style='width:50%; vertical-align:top;'>
+ <table>
+ <tr>
+ <td>{t}ID{/t}</td>
+ <td>{$data.ID}</td>
+ </tr>
+ <tr>
+ <td>{t}Status{/t}</td>
+ <td>{$data.STATUS}</td>
+ </tr>
+ <tr>
+ <td>{t}Result{/t}</td>
+ <td>{$data.RESULT}</td>
+ </tr>
+ <tr>
+ <td>{t}Target{/t}</td>
+ <td>{$data.MACADDRESS}</td>
+ </tr>
+ <tr>
+ <td style='vertical-align:top'>{t}Timestamp{/t}</td>
+ <td>{$timestamp}</td>
+ </tr>
+ </table>
+ </td>
+ <td style='width:50%; vertical-align:top;'>
+ <table >
+ </table>
+ </td>
+ </tr>
+</table>
+
+{/if}
diff --git a/gosa-plugins/goto/addons/gotomasses/events/DaemonEvent_reinstall.tlp b/gosa-plugins/goto/addons/gotomasses/events/DaemonEvent_reinstall.tlp
--- /dev/null
@@ -0,0 +1,63 @@
+
+{if $is_new}
+
+<table style='width:100%;'>
+ <tr>
+ <td style='width:50%; vertical-align:top;'>
+ <table>
+ <tr>
+ <td style='vertical-align:top'>{t}Timestamp{/t}</td>
+ <td>{$timestamp}</td>
+ </tr>
+ </table>
+ </td>
+ <td style='width:50%; vertical-align:top;'>
+ <table style='width:100%;'>
+ <tr>
+ <td>
+ {t}Target objects{/t}
+ <br>
+ {$target_list}
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+{else}
+
+<table style='width:100%;'>
+ <tr>
+ <td style='width:50%; vertical-align:top;'>
+ <table>
+ <tr>
+ <td>{t}ID{/t}</td>
+ <td>{$data.ID}</td>
+ </tr>
+ <tr>
+ <td>{t}Status{/t}</td>
+ <td>{$data.STATUS}</td>
+ </tr>
+ <tr>
+ <td>{t}Result{/t}</td>
+ <td>{$data.RESULT}</td>
+ </tr>
+ <tr>
+ <td>{t}Target{/t}</td>
+ <td>{$data.MACADDRESS}</td>
+ </tr>
+ <tr>
+ <td style='vertical-align:top'>{t}Timestamp{/t}</td>
+ <td>{$timestamp}</td>
+ </tr>
+ </table>
+ </td>
+ <td style='width:50%; vertical-align:top;'>
+ <table >
+ </table>
+ </td>
+ </tr>
+</table>
+
+{/if}
diff --git a/gosa-plugins/goto/addons/gotomasses/events/DaemonEvent_update.tpl b/gosa-plugins/goto/addons/gotomasses/events/DaemonEvent_update.tpl
--- /dev/null
@@ -0,0 +1,63 @@
+
+{if $is_new}
+
+<table style='width:100%;'>
+ <tr>
+ <td style='width:50%; vertical-align:top;'>
+ <table>
+ <tr>
+ <td style='vertical-align:top'>{t}Timestamp{/t}</td>
+ <td>{$timestamp}</td>
+ </tr>
+ </table>
+ </td>
+ <td style='width:50%; vertical-align:top;'>
+ <table style='width:100%;'>
+ <tr>
+ <td>
+ {t}Target objects{/t}
+ <br>
+ {$target_list}
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+{else}
+
+<table style='width:100%;'>
+ <tr>
+ <td style='width:50%; vertical-align:top;'>
+ <table>
+ <tr>
+ <td>{t}ID{/t}</td>
+ <td>{$data.ID}</td>
+ </tr>
+ <tr>
+ <td>{t}Status{/t}</td>
+ <td>{$data.STATUS}</td>
+ </tr>
+ <tr>
+ <td>{t}Result{/t}</td>
+ <td>{$data.RESULT}</td>
+ </tr>
+ <tr>
+ <td>{t}Target{/t}</td>
+ <td>{$data.MACADDRESS}</td>
+ </tr>
+ <tr>
+ <td style='vertical-align:top'>{t}Timestamp{/t}</td>
+ <td>{$timestamp}</td>
+ </tr>
+ </table>
+ </td>
+ <td style='width:50%; vertical-align:top;'>
+ <table >
+ </table>
+ </td>
+ </tr>
+</table>
+
+{/if}
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 58961297a30ae2b7614936479e23e74aa22b2f70..502ce884405068598b1cdbda2e03623aec483889 100644 (file)
<?php
-
class DaemonEvent_halt extends DaemonEvent
{
public function __construct($config,$data = array())
{
DaemonEvent::__construct($config,$data);
- $this->s_Menu_Name = _("Shutdown");
- $this->s_Event_Name = _("Shutdown");
- $this->s_New_Action = "trigger_action_halt";
+ $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_Menu_Image = "images/status_stopped.png";
+ $this->s_List_Image = "images/status_stopped.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_halt.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/gotomasses/events/class_DaemonEvent_reinstall.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_reinstall.inc
index 46f7d6428244720d45b7fd36acb1c4844e409734..b4340c1ec9e8370fceb5df5981a9d5230648a5bc 100644 (file)
public function __construct($config,$data = array())
{
DaemonEvent::__construct($config,$data);
- $this->s_Menu_Name = _("Reinstall");
+ $this->s_Menu_Name = _("Reinstall");
$this->s_Event_Name = _("Reinstall");
- $this->s_New_Action = "trigger_action_reinstall";
- $this->s_Menu_Image = "images/fai_small.png";
+ $this->s_New_Action = "job_trigger_action_reinstall";
+ $this->s_Edit_Action= "trigger_action_reinstall";
+ $this->s_Menu_Image = "images/fai_small.png"_small;
+ $this->s_List_Image = "images/fai_small.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_reinstall.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/gotomasses/events/class_DaemonEvent_update.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_update.inc
index ca1b9e11e7ad5f508dff45948b079e7b2d130ecf..03e589c4bd72b3c48fb7ad290353475de31828b6 100644 (file)
<?php
+
class DaemonEvent_update extends DaemonEvent
{
public function __construct($config,$data = array())
{
DaemonEvent::__construct($config,$data);
- $this->s_Menu_Name = _("Software update");
- $this->s_Event_Name = _("software update");
- $this->s_New_Action = "trigger_action_update";
+ $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_Menu_Image = "images/time.png";
+ $this->s_List_Image = "images/time.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_update.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/gotomasses/events/class_DaemonEvent_wakeup.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent_wakeup.inc
index 9386ea1d11c1ec8970950472e8f66a10b9074884..69fb776d80631f2880df096b4f65ef473eb2d768 100644 (file)
{
DaemonEvent::__construct($config,$data);
$this->s_Menu_Name = _("Wake up");
- $this->s_Event_Name = _("Wake up a system");
+ $this->s_Event_Name = _("Start a system");
$this->s_New_Action = "job_trigger_action_wake";
$this->s_Edit_Action= "trigger_action_wake";
$this->s_Menu_Image = "images/status_running.png";