From 0c8f9f9c12bb0be95353b6e2780376cb410e128c Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 24 Jan 2008 10:15:39 +0000 Subject: [PATCH] Updated delete hanlding, much faster now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8584 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/gotomasses/class_gotomasses.inc | 33 +++++++++---------- .../plugins/addons/gotomasses/gotomasses.tpl | 4 +-- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc index 0bafd5212..ff7697c37 100644 --- a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc +++ b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc @@ -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']." ".$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"),"
".$tmp."
")); - $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']." ".$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))); } } /* 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"); diff --git a/gosa-core/plugins/addons/gotomasses/gotomasses.tpl b/gosa-core/plugins/addons/gotomasses/gotomasses.tpl index 8586a8d39..c4437b0d4 100644 --- a/gosa-core/plugins/addons/gotomasses/gotomasses.tpl +++ b/gosa-core/plugins/addons/gotomasses/gotomasses.tpl @@ -1,11 +1,11 @@ {$div}
{if $start == 0 } -   +   {$start+1}    {else} -   +   {$start_real}    {/if} -- 2.30.2