summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1f3f152)
raw | patch | inline | side by side (parent: 1f3f152)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Feb 2008 07:45:55 +0000 (07:45 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Feb 2008 07:45:55 +0000 (07:45 +0000) |
-Can edit events now.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9117 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9117 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 b59bd6b1ad27a52f38a5673b6e72956faf09a404..9351fc9b47a9d73e529ac3ad94528a092dd32a59 100644 (file)
/* 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){
- $data['mac'] = $target;
- if(!$this->o_queue->send($header,$target,$data,TRUE)){
- msg_dialog::display(_("Daemon"),sprintf(_("Something went wrong while talking to the daemon: %s."),
- $this->o_queue->get_error()),ERROR_DIALOG);
- }
+ if(is_object($this->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){
+ $data['mac'] = $target;
+ if(!$this->o_queue->send($header,$target,$data,TRUE)){
+ 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;
+ }else{
+ $id = $this->dialog->get_id();
+ $data = $this->dialog->save();
+ $data['timestamp'] = $this->dialog->get_timestamp();
+ if($this->o_queue->update_entries(array($id),$data)){
+ $this->dialog = FALSE;
+ $this->current = -1;
+ }
}
- $this->dialog = FALSE;
- $this->current = -1;
}
}
foreach($this->entries as $key => $task){
- $prio_actions = "<input class='center' type='image' src='images/prio_increase.png' name='prio_up_".$task['ID']."'> ";
- $prio_actions.= "<input class='center' type='image' src='images/prio_decrease.png' name='prio_down_".$task['ID']."'> ";
- $prio_actions.= "<input class='center' type='image' src='images/status_stop_all.png' name='stop_".$task['ID']."'> ";
- $prio_actions.= "<input class='center' type='image' src='images/status_start_all.png' name='start_".$task['ID']."'> ";
+ $prio_actions = "<input class='center' type='image' src='images/prio_increase.png' name='prio_up_".$key."'> ";
+ $prio_actions.= "<input class='center' type='image' src='images/prio_decrease.png' name='prio_down_".$key."'> ";
+ $prio_actions.= "<input class='center' type='image' src='images/status_stop_all.png' name='stop_".$key."'> ";
+ $prio_actions.= "<input class='center' type='image' src='images/status_start_all.png' name='start_".$key."'> ";
- $action = "<input type='image' src='images/edit.png' name='edit_task_".$task['ID']."'
+ $action = "<input type='image' src='images/edit.png' name='edit_task_".$key."'
class='center' alt='"._("Edit")."'>";
if($this->acl_is_removeable()){
- $action.= "<input type='image' src='images/edittrash.png' name='remove_task_".$task['ID']."'
+ $action.= "<input type='image' src='images/edittrash.png' name='remove_task_".$key."'
class='center' alt='"._("Reomve")."'>";
}
}
/* Create each field */
- $field0 = array("string" => "<input type='checkbox' id='item_selected_".$task['ID']."' name='item_selected_".$task['ID']."'>" ,
+ $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
"attach" => "style='width:20px;".$color."'");
$field1 = array("string" => $display,
"attach" => "style='".$color."'");
diff --git a/gosa-plugins/goto/addons/gotomasses/events/DaemonEvent_wakeup.tpl b/gosa-plugins/goto/addons/gotomasses/events/DaemonEvent_wakeup.tpl
index 04a278c368613eb5f508ce535f3fdcc3f2616352..4e3fc127d969422457a48dc11387dc7298378bbb 100644 (file)
+{if $is_new}
+
<table style='width:100%;'>
<tr>
<td style='width:50%; vertical-align:top;'>
</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.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc
index df4c05a119ce4cdd085638e8123ddfb0fdbc9c18..8da1e500e332f9b3d998d6bc0db9bdbb44272790 100644 (file)
/* Load values from given data */
if(count($data)){
$this->is_new = FALSE;
+
+ $attrs = array("id" => "ID");
+ foreach($attrs as $to => $from){
+ $this->$to = $data[$from];
+ }
}
}
}
+ /*! \brief Returns the event ID
+ @return Returns the event ID
+ */
+ public function get_id()
+ {
+ if($this->is_new){
+ return(-1);
+ }else{
+ return($this->data['ID']);
+ }
+ }
+
+
/*! \brief Returns a set of elements selected in a MultiSelectWindow
@return Array[integer]=integer
*/
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 bb1530d6a5bcd32f25dd29de478e5e0b00e67023..9386ea1d11c1ec8970950472e8f66a10b9074884 100644 (file)
$display = $this->get_header();
+ $tmp = $this->data;
+
/* Check if target add dialog is open */
- if($this->is_target_list_open()){
- $display .= $this->get_target_add_list();
- }else{
- $smarty = get_smarty();
- $smarty->assign("target_list" , $this->get_target_list());
- $smarty->assign("timestamp" , $this->get_time_select());
- $display.= $smarty->fetch(get_template_path('DaemonEvent_wakeup.tpl', TRUE, dirname(__FILE__)));
- }
-
+ 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_wakeup.tpl', TRUE, dirname(__FILE__)));
$display.= $this->get_footer();
return($display);
}