From 0eebc06aa110de9bea04f6e288b8b7bac3df1953 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 24 Jan 2008 13:38:13 +0000 Subject: [PATCH] updated queue handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8587 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/gotomasses/class_divListMasses.inc | 15 +-------- .../addons/gotomasses/class_gotomasses.inc | 31 +++++++++---------- .../plugins/addons/gotomasses/gotomasses.tpl | 15 +-------- 3 files changed, 17 insertions(+), 44 deletions(-) diff --git a/gosa-core/plugins/addons/gotomasses/class_divListMasses.inc b/gosa-core/plugins/addons/gotomasses/class_divListMasses.inc index 42d08b005..e94027f32 100644 --- a/gosa-core/plugins/addons/gotomasses/class_divListMasses.inc +++ b/gosa-core/plugins/addons/gotomasses/class_divListMasses.inc @@ -9,7 +9,7 @@ class divListMasses extends MultiSelectWindow var $parent ; var $ui ; - + var $Regex = "*"; var $wake = TRUE; function divListMasses (&$config,$parent) @@ -24,11 +24,6 @@ class divListMasses extends MultiSelectWindow $this->EnableSaveButton(FALSE); $this->SetInformation(_("This menu allows you to remove and change the properties of GOsa deamon tasks.")); - foreach($this->parent->get_actions() as $name => $desc){ - $this->$name = TRUE; - $this->AddCheckBox($name,sprintf(_("Display entries with action %s."),$desc), - sprintf(_("Display entries with action %s."),$desc),TRUE); - } $plug = $_GET['plug']; /* Toggle all selected / deselected */ @@ -89,14 +84,6 @@ class divListMasses extends MultiSelectWindow # $edit_link = "
%str%
"; $edit_link = "%str%"; - /* Create action filter array, to sort out those actions we do not want to see */ - $allowed_action = array(); - foreach($this->parent->get_actions() as $name => $desc){ - if($this->$name){ - $allowed_action[] = $name; - } - } - $colors[0] = "#DDDDDD"; $colors[1] = "#EEEEEE"; $c_keys = array(); diff --git a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc index b0a6c4469..3ca4a4961 100644 --- a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc +++ b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc @@ -38,7 +38,7 @@ class gotomasses extends plugin /************ * Handle posts ************/ - + $s_entry = $s_action = ""; $arr = array( "/^stop_/" => "stop", @@ -104,18 +104,17 @@ class gotomasses extends plugin } $this->ids_to_remove = $ids; - $tmp = ""; - $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['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))); + $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))); } } @@ -213,6 +212,9 @@ class gotomasses extends plugin "100"=> "100", "200"=> "200", "9999" => "*")); + + $count = $this->o_queue->number_of_queued_entries(); + $smarty->assign("range_selector", range_selector($count, $this->start, $this->range,"range")); $smarty->assign("range",$this->range); $smarty->assign("div",$this->divlist->Draw()); return($smarty->fetch (get_template_path('gotomasses.tpl', TRUE, dirname(__FILE__)))); @@ -309,13 +311,10 @@ class gotomasses extends plugin if(isset($_POST['range']) && is_numeric($_POST['range'])){ $this->range = $_POST['range']; } - if(isset($_POST['next_page'])){ - $this->start ++; - } - if(isset($_POST['last_page'])){ - $this->start --; - if($this->start < 0 ){ - $this->start = 0; + if(isset($_GET['start'])){ + $start = $_GET['start']; + if(is_numeric($start) && $start > 0){ + $this->start = $start; } } } diff --git a/gosa-core/plugins/addons/gotomasses/gotomasses.tpl b/gosa-core/plugins/addons/gotomasses/gotomasses.tpl index c4437b0d4..844cdebf6 100644 --- a/gosa-core/plugins/addons/gotomasses/gotomasses.tpl +++ b/gosa-core/plugins/addons/gotomasses/gotomasses.tpl @@ -1,17 +1,4 @@ {$div}
-{if $start == 0 } -   - {$start+1}  -   -{else} -   - {$start_real}  -   -{/if} -
-
- +{$range_selector}
-- 2.30.2