summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bdfaf8a)
raw | patch | inline | side by side (parent: bdfaf8a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Jan 2010 13:58:53 +0000 (13:58 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Jan 2010 13:58:53 +0000 (13:58 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15448 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/addons/goto/class_gotomasses.inc | patch | blob | history | |
gosa-plugins/goto/addons/goto/deploy-list.xml | patch | blob | history |
diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc
index 98ce09942878bc9489f10b219ac3a00198a63aa8..bd3e4bbef5c44ea33de103ff56cd4266bbd513c2 100644 (file)
$this->registerAction('prioPause', "prioPause");
$this->registerAction('processNow', "processNow");
$this->registerAction('viewLogs', "viewLogs");
+ $this->registerAction('abort', "abortEvent");
$this->registerAction('saveEventDialog', "saveEventDialog");
}
$this->save();
}
}
+
+
+ /*! \brief Force queue job to be aborted.
+ */
+ function abortEvent($action="",$target=array(),$all=array())
+ {
+ /* Entries are paused by setting the status to
+ * something different from 'waiting'.
+ * We simply use 'paused'.
+ */
+ $data = array("status" => "paused");
+
+ /* Detect if the ids we got are valid and
+ * check if the status allows pausing.
+ */
+ $update_ids = array();
+ $headpage = $this->getHeadpage();
+ foreach($target as $id){
+ $tmp = $headpage->getEntry($id);
+ $update_ids[] = $tmp['MACADDRESS'][0];
+ }
+
+ if(class_available("DaemonEvent_faireboot")){
+ $tmp = new DaemonEvent_faireboot($this->config);
+ $tmp->add_targets($update_ids);
+ $tmp->set_type(TRIGGERED_EVENT);
+ $this->recently_removed = $update_ids;
+ if(!$this->o_queue->append($tmp)){
+ msg_dialog::display(_("Error"), sprintf(_("Cannot update queue entry: %s"),$id) , ERROR_DIALOG);
+ return(FALSE);
+ }
+ }else{
+ msg_dialog::display(_("Error"),
+ sprintf(_("Required class '%s' cannot be found: job not aborted!"),
+ "DaemonEvent_faireboot") , ERROR_DIALOG);
+ }
+ }
+
function prioDown($action="",$target=array(),$all=array())
{
* EDIT
************/
-
- /* Close dialog */
- if(isset($_POST['abort_event_dialog'])){
- $this->dialog = FALSE;
- $this->current = -1;
- }
-
/* Display dialogs if currently opened */
if(is_object($this->dialog)){
$this->dialog->save_object();
}
}
- /************
- * Handle Divlist
- ************/
-
- $divlist = new MultiSelectWindow($this->config,"gotoMasses",array("gotomasses"));
- $divlist->SetInformation(_("This menu allows you to remove and change the properties of GOsa tasks."));
- $divlist->SetSummary(_("List of queued jobs"));
- $divlist->EnableCloseButton(FALSE);
- $divlist->EnableSaveButton(FALSE);
- $divlist->SetHeadpageMode();
- $s = ".|"._("Actions")."|\n";
- $s.= "..|<img src='images/lists/new.png' alt='' border='0' class='center'> "._("Create")."\n";
-
if($this->acl_is_writeable("")){
foreach($this->events['SCHEDULED'] as $name => $event){
$s.= "...|".$event['MenuImage']." ".$event['s_Menu_Name']."|add_event_".$name."\n";
}
- /*! \brief Force queue job to be done as far as possible.
- * @return Boolean TRUE in case of success, else FALSE.
- */
- private function abort_queue_entries($ids)
- {
- if(!count($ids)){
- return;
- }
-
- /* Entries are paused by setting the status to
- * something different from 'waiting'.
- * We simply use 'paused'.
- */
- $data = array("status" => "paused");
-
- /* Detect if the ids we got are valid and
- * check if the status allows pausing.
- */
- $update_ids = array();
- foreach($this->o_queue->get_entries_by_id($ids) as $entry){
- if(isset($entry['STATUS']) && preg_match("/processing/",$entry['STATUS'])){
- if(isset($entry['MACADDRESS'])){
- $update_ids[] = $entry['MACADDRESS'];
- }else{
- trigger_error("No mac address found in event.");
- }
- }
- }
-
- if(class_available("DaemonEvent_faireboot")){
- $tmp = new DaemonEvent_faireboot($this->config);
- $tmp->add_targets($update_ids);
- $tmp->set_type(TRIGGERED_EVENT);
- $this->recently_removed = $update_ids;
-
- if(!$this->o_queue->append($tmp)){
- msg_dialog::display(_("Error"), sprintf(_("Cannot update queue entry: %s"),$id) , ERROR_DIALOG);
- return(FALSE);
- }
- }else{
- msg_dialog::display(_("Error"),
- sprintf(_("Required class '%s' cannot be found: job not aborted!"),
- "DaemonEvent_faireboot") , ERROR_DIALOG);
- }
- }
-
-
/*! \brief Pauses the specified queue entry from execution.
* @return Boolean TRUE in case of success, else FALSE.
*/
diff --git a/gosa-plugins/goto/addons/goto/deploy-list.xml b/gosa-plugins/goto/addons/goto/deploy-list.xml
index de3ba9370f7c2bb0b25b3bfd377aacca0185d027..13528cdeb2f102c25fa5b87268a8316ca3fec334 100644 (file)
</definition>
<table>
- <layout>|160|160||||||</layout>
+ <layout>|||40||||</layout>
<column>
<label>Target</label>
<label>Remove</label>
</action>
+ <action>
+ <name>abort</name>
+ <type>entry</type>
+ <objectclass>FAKE_OC__abort</objectclass>
+ <image>images/small_error.png</image>
+ <label>Abort</label>
+ </action>
+
</actiontriggers>
</list>