From e28929720255702cd9c7bfeb3dac812d8d0c1ca7 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 23 Oct 2007 08:38:34 +0000 Subject: [PATCH 1/1] Added checkboxes to management dialog to filter actions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7625 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/gotomasses/class_divListMasses.inc | 21 +++++++++++++++++++ .../addons/gotomasses/class_gotomasses.inc | 10 +++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/plugins/addons/gotomasses/class_divListMasses.inc b/plugins/addons/gotomasses/class_divListMasses.inc index f6e942234..f6c1bea9c 100644 --- a/plugins/addons/gotomasses/class_divListMasses.inc +++ b/plugins/addons/gotomasses/class_divListMasses.inc @@ -10,6 +10,8 @@ class divListMasses extends MultiSelectWindow var $parent ; var $ui ; + var $wake = TRUE; + function divListMasses (&$config,$parent) { MultiSelectWindow::MultiSelectWindow($config, "gotoMasses", array("gotomasses")); @@ -21,6 +23,11 @@ class divListMasses extends MultiSelectWindow $this->EnableCloseButton(FALSE); $this->EnableSaveButton(FALSE); $this->SetInformation(_("This menu allows you to add, remove and change the properties of system deployment tasks.")); + + foreach($this->parent->get_actions() as $name => $desc){ + $this->$name = TRUE; + $this->AddCheckBox($name,$desc,$desc,TRUE); + } $this->GenHeader(); } @@ -73,7 +80,21 @@ class divListMasses extends MultiSelectWindow $plug = $_GET['plug']; $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; + } + } + foreach($tasks as $key => $task){ + + /* Skip unchecked actions */ + if(!in_array($task['Action'],$allowed_action)){ + continue; + } + $action = ""; if($this->parent->acl_is_removeable()){ $action.= ""; diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc index 4a58ca9c8..e54e70119 100644 --- a/plugins/addons/gotomasses/class_gotomasses.inc +++ b/plugins/addons/gotomasses/class_gotomasses.inc @@ -31,6 +31,7 @@ class gotomasses extends plugin if(!empty($file)){ $this->data_file = $file; } + $this->divlist = new divListMasses($this->config,$this); $this->load_gotomasses_data(); } @@ -175,9 +176,9 @@ class gotomasses extends plugin * Handle Divlist ************/ - $list = new divListMasses($this->config,$this); - $list->SetEntries($this->tasks); - return($list->Draw()); + $this->divlist->ClearElementsList(); + $this->divlist->SetEntries($this->tasks); + return($this->divlist->Draw()); } @@ -299,7 +300,7 @@ class gotomasses extends plugin function save_gotomasses_data() { - $str = "#GOsa generated file, please just modify if you realy know what you do."; + $str = "#GOsa generated file, please just modify if you really know what you do."; foreach($this->tasks as $task){ $str .= "\n#".trim($task['Comment']); $str .= "\n"; @@ -351,6 +352,7 @@ class gotomasses extends plugin function save_object() { + $this->divlist->save_object(); } -- 2.30.2