From f2d99aafd58a9e1ccdaee84ae4faeaf18ef78da6 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 25 Jan 2008 11:19:26 +0000 Subject: [PATCH] Skip action if nothing is selected. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8607 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/gotomasses/class_gotomasses.inc | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc index 49a8c0d5c..87753c53f 100644 --- a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc +++ b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc @@ -102,19 +102,20 @@ class gotomasses extends plugin }else{ $ids = $this->list_get_selected_items(); } - - $this->ids_to_remove = $ids; - $ret = $this->o_queue->ids_exist($this->ids_to_remove); - $ret = $this->o_queue->get_entries_by_id($ret); - - $tmp = ""; - foreach($ret as $task){ - $tmp.= "\n".$task['ID']." - ".$task['HEADERTAG']." ".$task['MACADDRESS']; + if(count($ids)){ + $this->ids_to_remove = $ids; + $ret = $this->o_queue->ids_exist($this->ids_to_remove); + $ret = $this->o_queue->get_entries_by_id($ret); + + $tmp = ""; + foreach($ret as $task){ + $tmp.= "\n".$task['ID']." - ".$task['HEADERTAG']." ".$task['MACADDRESS']; + } + $smarty->assign("multiple", TRUE); + $smarty->assign("info",sprintf(_("Your are about to delete the following tasks: %s"),"
".$tmp."
")); + $this->current = $s_entry; + return($smarty->fetch(get_template_path('remove.tpl', TRUE))); } - $smarty->assign("multiple", TRUE); - $smarty->assign("info",sprintf(_("Your are about to delete the following tasks: %s"),"
".$tmp."
")); - $this->current = $s_entry; - return($smarty->fetch(get_template_path('remove.tpl', TRUE))); } } @@ -226,6 +227,10 @@ class gotomasses extends plugin */ private function start_queue_entries($ids) { + if(!count($ids)){ + return; + } + $data = array("timestamp" => date("YmdHis"), "status" => "-"); if(!$this->o_queue->update_entries($ids,$data)){ @@ -241,6 +246,9 @@ class gotomasses extends plugin */ private function stop_queue_entries($ids) { + if(!count($ids)){ + return; + } $data = array("timestamp" => "20490101010101", "status" => "Stoppped"); if(!$this->o_queue->update_entries($ids,$data)){ -- 2.30.2