From 96631fe9790cd837e38ce213f7504c2cac0ebb9f Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 Mar 2010 16:16:30 +0000 Subject: [PATCH] Added filter parent git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16387 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/ihtml/themes/modern/userFilterEditor.tpl | 10 ++++++++++ gosa-core/include/class_userFilter.inc | 7 +++++-- gosa-core/include/class_userFilterEditor.inc | 11 +++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/gosa-core/ihtml/themes/modern/userFilterEditor.tpl b/gosa-core/ihtml/themes/modern/userFilterEditor.tpl index 2d94578cd..e014ab3f5 100644 --- a/gosa-core/ihtml/themes/modern/userFilterEditor.tpl +++ b/gosa-core/ihtml/themes/modern/userFilterEditor.tpl @@ -14,6 +14,16 @@ + + + + + + + + diff --git a/gosa-core/include/class_userFilter.inc b/gosa-core/include/class_userFilter.inc index 46e1aec44..aa1617995 100644 --- a/gosa-core/include/class_userFilter.inc +++ b/gosa-core/include/class_userFilter.inc @@ -67,7 +67,7 @@ class userFilter extends plugin */ static function explodeFilterString($filter) { - list($categories, $name, $description, $filter, $flags) = split(";", $filter); + list($parent,$categories, $name, $description, $filter, $flags) = split(";", $filter); // Ensure that we no empty category in our category list. if(empty($categories)){ @@ -85,6 +85,7 @@ class userFilter extends plugin // build up filter entry. $tmp = array( + 'parent' => $parent, 'name' => $name, 'categories' => $categories, 'description' => base64_decode($description), @@ -105,6 +106,7 @@ class userFilter extends plugin foreach($this->filters as $name => $filter){ $data[$name] = array('data' => array( + $filter['parent'], $filter['name'], $filter['description'], implode(", ",$filter['categories']), @@ -240,7 +242,8 @@ class userFilter extends plugin // Build up new list of filters $attrs = array(); foreach($this->filters as $filter){ - $tmp = implode(',', $filter['categories']).";"; + $tmp = $filter['parent'].";"; + $tmp.= implode(',', $filter['categories']).";"; $tmp.= $filter['name'].";"; $tmp.= base64_encode($filter['description']).";"; $tmp.= base64_encode($filter['filter']).";"; diff --git a/gosa-core/include/class_userFilterEditor.inc b/gosa-core/include/class_userFilterEditor.inc index 90eefe1c3..998994a7d 100644 --- a/gosa-core/include/class_userFilterEditor.inc +++ b/gosa-core/include/class_userFilterEditor.inc @@ -8,6 +8,7 @@ class userFilterEditor extends plugin // The values public $name = ""; public $description = ""; + public $parent = ""; public $selectedCategories = array(); public $share = FALSE; public $enabled = TRUE; @@ -16,17 +17,20 @@ class userFilterEditor extends plugin // The list of all categories mangaged by the current filter object. // Used in the grop-down box. public $availableCategories = array(); + public $fixedFilters = array(); public $orig_name = ""; /*! \brief Instantiate the filter editing dialog. * Parses the filter info into editable data. */ - function __construct($entry, $categories) + function __construct($entry, $categories, $fixedFilters) { $this->availableCategories = $categories; + $this->fixedFilters = $fixedFilters; if($entry){ $this->entry = $entry; + $this->parent = $entry['parent']; $this->name = $entry['name']; $this->description = $entry['description']; $this->filter = $entry['filter']; @@ -64,6 +68,7 @@ class userFilterEditor extends plugin { plugin::execute(); $smarty = get_smarty(); + $smarty->assign('parent', $this->parent); $smarty->assign('name', htmlentities($this->name,ENT_COMPAT,'UTF-8')); $smarty->assign('filter', htmlentities($this->filter,ENT_COMPAT,'UTF-8')); $smarty->assign('share', $this->share); @@ -71,6 +76,7 @@ class userFilterEditor extends plugin $smarty->assign('description', htmlentities($this->description,ENT_COMPAT,'UTF-8')); $smarty->assign('selectedCategories', $this->selectedCategories); $smarty->assign('availableCategories', $this->availableCategories); + $smarty->assign('fixedFilters', $this->fixedFilters); return($smarty->fetch(get_template_path('userFilterEditor.tpl', FALSE))); } @@ -82,7 +88,7 @@ class userFilterEditor extends plugin if(isset($_POST['userFilterEditor'])){ // Get posted strings - foreach(array('name','description') as $attr){ + foreach(array('name','description', 'parent') as $attr){ if(isset($_POST[$attr])){ $this->$attr = get_post($attr); } @@ -157,6 +163,7 @@ class userFilterEditor extends plugin function save() { $ret= array(); + $ret['parent'] = $this->parent; $ret['name'] = $this->name; $ret['description'] = $this->description; $ret['categories'] = $this->selectedCategories; -- 2.30.2