X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_userFilterEditor.inc;h=6c86f4b519853ff238789b0d69d87d8c9eca2460;hb=7ce564d554053c9ff7ae13d00df50f5a1961357d;hp=e2ebf9d2a7517239d02b12634d4fe301eff0c0e7;hpb=58258b849a93a49ce8d0460ae506c5ecbb134164;p=gosa.git diff --git a/gosa-core/include/class_userFilterEditor.inc b/gosa-core/include/class_userFilterEditor.inc index e2ebf9d2a..6c86f4b51 100644 --- a/gosa-core/include/class_userFilterEditor.inc +++ b/gosa-core/include/class_userFilterEditor.inc @@ -34,10 +34,10 @@ class userFilterEditor extends plugin if($entry){ $this->entry = $entry; $this->parent = $entry['parent']; - $this->name = $entry['name']; + $this->name = $entry['tag']; $this->description = $entry['description']; - foreach($entry['queries'] as $query){ + foreach($entry['query'] as $query){ $query['filter'] = userFilterEditor::_autoIndentFilter($query['filter'], " "); $this->queries[] = $query; } @@ -133,7 +133,7 @@ class userFilterEditor extends plugin $smarty->assign("fixedFilters", array_keys($filter->searches)); $smarty->assign('parent', $this->parent); $smarty->assign('backends', $this->backends); - $smarty->assign('name', htmlentities($this->name,ENT_COMPAT,'UTF-8')); + $smarty->assign('tag', htmlentities($this->name,ENT_COMPAT,'UTF-8')); $smarty->assign('queries', $queries); $smarty->assign('share', $this->share); $smarty->assign('enable', $this->enabled); @@ -151,7 +151,7 @@ class userFilterEditor extends plugin if(isset($_POST['userFilterEditor'])){ // Get posted strings - foreach(array('name','description', 'parent') as $attr){ + foreach(array('tag','description', 'parent') as $attr){ if(isset($_POST[$attr])){ $this->$attr = get_post($attr); } @@ -188,6 +188,7 @@ class userFilterEditor extends plugin }elseif(isset($_POST['availableCategory']) && !empty($_POST['availableCategory'])){ $this->selectedCategories[] = get_post('availableCategory'); } + $this->selectedCategories = array_unique($this->selectedCategories); } // Remove categories @@ -264,10 +265,10 @@ class userFilterEditor extends plugin { $ret= array(); $ret['parent'] = $this->parent; - $ret['name'] = $this->name; + $ret['tag'] = $this->name; $ret['description'] = $this->description; $ret['categories'] = $this->selectedCategories; - $ret['queries'] = $this->queries; + $ret['query'] = $this->queries; $ret['flags'] = array(); if($this->share){ $ret['flags'][] = "share";