summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 70ba75a)
raw | patch | inline | side by side (parent: 70ba75a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 24 Oct 2007 13:50:12 +0000 (13:50 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 24 Oct 2007 13:50:12 +0000 (13:50 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7642 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_hostActionQueue.inc | patch | blob | history | |
plugins/addons/gotomasses/class_goto_task.inc | patch | blob | history | |
plugins/addons/gotomasses/class_gotomasses.inc | patch | blob | history |
index a81328d30247abde985895d33fe2168d422e3c2f..fd1c0fade39dc08fe010305d770d161b810a03e9 100644 (file)
public function update_entry($id,$entry)
{
- if(isset($this->a_queue[$this->id_entry_map[$id]])){
+ if(isset($this->id_entry_map[$id])){
$this->a_queue[$this->id_entry_map[$id]] = $entry;
return($this->_save_data());
}else{
}
}
+ public function remove_entry($id)
+ {
+ if(isset($this->id_entry_map[$id])){
+ unset($this->a_queue[$this->id_entry_map[$id]]);
+ unset($this->id_entry_map[$id]);
+ return($this->_save_data());
+ }else{
+ $this->set_error(sprintf(_("Could not remove entry, entry with id '%s' not found."),$id));
+ }
+ }
+
public function id_exists($id)
{
return(isset($this->id_entry_map[$id]));
diff --git a/plugins/addons/gotomasses/class_goto_task.inc b/plugins/addons/gotomasses/class_goto_task.inc
index bbc58faedb3798bf085723397c0606d03b458c80..cccb987ddfc4a033abfeb787e3a2e8b9b8a15778 100644 (file)
"Action" => _("Action") ,"Comment"=> _("Description"));
foreach($tmp as $name => $desc){
- if(empty($this->$name)){
+ if(empty($this->$name) && $this->$name != 0){
$message[] = sprintf(_("The given value for attribute '%s' is invalid."),$desc);
}
}
diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc
index 2b304d31ff4f7c89ce6f5b34664a51969f190fc2..d72cb2b3f9356bbad3613719e430221a7b94fca9 100644 (file)
$this->ids_to_remove = $this->list_get_selected_items();
$tmp = "";
foreach($this->ids_to_remove as $key => $id){
- if(isset($this->tasks[$id])){
- $task = $this->tasks[$id];
+ if($this->o_queue->id_exists($id)){
+ $task = $this->o_queue->get_entry($id);
$tmp.= "\n".$this->target_to_string($task);
}else{
unset($this->ids_to_remove[$key]);
/* Remove specified tasks */
if(count($this->ids_to_remove) && isset($_POST['delete_multiple_confirm'])){
foreach($this->ids_to_remove as $id){
- $this->o_queue->remove($id);
+ if($this->o_queue->id_exists($id)){
+ $this->o_queue->remove_entry($id);
+ }
}
$this->save();
}