Code

Updated delete hanlding, much faster now.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 24 Jan 2008 10:15:39 +0000 (10:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 24 Jan 2008 10:15:39 +0000 (10:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8584 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 0bafd52128f86e728e4457bc0acdd62a552608f5..ff7697c37c8c292800972581608b15e391a36200 100644 (file)
@@ -111,26 +111,23 @@ class gotomasses extends plugin
 
         $this->ids_to_remove = $ids;
         $tmp = "";
-        foreach($this->ids_to_remove as $key => $id){
-          if($this->o_queue->id_exists($id)){
-            $task = $this->o_queue->get_entry($id);
-            $tmp.= "\n".$task['HEADERTAG']."&nbsp;".$task['MACADDRESS'];
-          }else{
-            unset($this->ids_to_remove[$key]);
-          }
-        }
-        $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)));
+
+        $ret = $this->o_queue->ids_exist($this->ids_to_remove);
+        $ret = $this->o_queue->get_entries_by_id($ret);
+
+        foreach($ret as $task){
+           $tmp.= "\n".$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)));
       }
     }
 
     /* 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_entry($id);
-      }
+      $this->o_queue->remove_entries($this->ids_to_remove);
       $this->save();
     }
 
@@ -146,7 +143,7 @@ class gotomasses extends plugin
 
     /* Edit selected entry */
     if($s_action == "edit"){
-      $entry = $this->o_queue->get_entry($s_entry);
+      $entry = $this->o_queue->get_entry_by_id($s_entry);
       if($entry){
         $this->dialog = new goto_task($this->config,$this,$entry);
         $this->current = $s_entry;
@@ -233,7 +230,7 @@ class gotomasses extends plugin
    */
   private function start_queue_entry($id)
   {
-    $attr = $this->o_queue->get_entry($id); 
+    $attr = $this->o_queue->get_entry_by_id($id); 
     if(is_array($attr)){
       $data = array("timestamp" => date("YmdHis"),
                     "status"  => "-");
@@ -253,7 +250,7 @@ class gotomasses extends plugin
    */
   private function stop_queue_entry($id)
   {
-    $attr = $this->o_queue->get_entry($id); 
+    $attr = $this->o_queue->get_entry_by_id($id); 
     if(is_array($attr)){
       $data = array("timestamp" => "20370101010000",
                     "status"  => "stopped");
index 8586a8d39db967bd1eaa1676b74e22a8aa6ec496..c4437b0d430121233651528a638c874678289ff6 100644 (file)
@@ -1,11 +1,11 @@
 {$div}
 <div style="width:65%; text-align: center; float:left;" >
 {if $start == 0 }
-       <input type="button" name="dummy" value="&lt;&nbsp;{t}Last{/t}" disabled>&nbsp;
+       <input type="button" name="dummy" value="&lt;&nbsp;{t}Back{/t}" disabled>&nbsp;
        {$start+1}&nbsp;
        <input type="submit" name="next_page" value="{t}Next{/t}&nbsp;&gt;">&nbsp;
 {else}
-       <input type="submit" name="last_page" value="&lt;&nbsp;{t}Last{/t}">&nbsp;
+       <input type="submit" name="last_page" value="&lt;&nbsp;{t}Back{/t}">&nbsp;
        {$start_real}&nbsp;
        <input type="submit" name="next_page" value="{t}Next{/t}&nbsp;&gt;">&nbsp;
 {/if}