Code

Skip action if nothing is selected.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 25 Jan 2008 11:19:26 +0000 (11:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 25 Jan 2008 11:19:26 +0000 (11:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8607 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/addons/gotomasses/class_gotomasses.inc

index 49a8c0d5cb105f9ea30c02be7365ec22c6c0c9bd..87753c53fb942758a89211b9becf80f40146c3aa 100644 (file)
@@ -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']."&nbsp;".$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']."&nbsp;".$task['MACADDRESS'];
+          }
+          $smarty->assign("multiple", TRUE); 
+          $smarty->assign("info",sprintf(_("Your are about to delete the following tasks: %s"),"<pre>".$tmp."</pre>"));
+          $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"),"<pre>".$tmp."</pre>"));
-        $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)){