diff --git a/gosa-core/include/class_userFilterEditor.inc b/gosa-core/include/class_userFilterEditor.inc
index f118b56183157d953f5bbb0aba43251594292874..1d55eaf64c33e9b2b120a5c4adfc145599e0ee27 100644 (file)
// The list of all categories mangaged by the current filter object.
// Used in the grop-down box.
public $orig_name = "";
// The list of all categories mangaged by the current filter object.
// Used in the grop-down box.
public $orig_name = "";
-
+ public $backends = array('LDAP','LDAPBlacklist', 'SYSTEMS', 'FAI', 'GroupLDAP','ACL', 'OPSIPackages','APPLICATIONS','MIMETYPES');
/*! \brief Instantiate the filter editing dialog.
/*! \brief Instantiate the filter editing dialog.
if($entry){
$this->entry = $entry;
$this->parent = $entry['parent'];
if($entry){
$this->entry = $entry;
$this->parent = $entry['parent'];
- $this->name = $entry['name'];
+ $this->name = $entry['tag'];
$this->description = $entry['description'];
$this->description = $entry['description'];
- foreach($entry['queries'] as $query){
+ foreach($entry['query'] as $query){
$query['filter'] = userFilterEditor::_autoIndentFilter($query['filter'], " ");
$this->queries[] = $query;
}
$query['filter'] = userFilterEditor::_autoIndentFilter($query['filter'], " ");
$this->queries[] = $query;
}
$smarty->assign("fixedFilters", array_keys($filter->searches));
$smarty->assign('parent', $this->parent);
$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('queries', $queries);
$smarty->assign('share', $this->share);
$smarty->assign('name', htmlentities($this->name,ENT_COMPAT,'UTF-8'));
$smarty->assign('queries', $queries);
$smarty->assign('share', $this->share);
}elseif(isset($_POST['availableCategory']) && !empty($_POST['availableCategory'])){
$this->selectedCategories[] = get_post('availableCategory');
}
}elseif(isset($_POST['availableCategory']) && !empty($_POST['availableCategory'])){
$this->selectedCategories[] = get_post('availableCategory');
}
+ $this->selectedCategories = array_unique($this->selectedCategories);
}
// Remove categories
}
// Remove categories
if(isset($_POST['addQuery'])){
$filter= $this->listing->getFilter();
if(isset($_POST['addQuery'])){
$filter= $this->listing->getFilter();
- $backend = 'filterLDAP';
+ $backend = 'LDAP';
$query = "(objectClass=*)";
if(isset($filter->searches[$this->parent])){
$query = "(objectClass=*)";
if(isset($filter->searches[$this->parent])){
- $query = $filter->searches[$this->parent]['query']['filter'];
- $backend = $filter->searches[$this->parent]['query']['backend'];
+
+ $tmp = $filter->searches[$this->parent];
+ if(isset($tmp['query'][count($this->queries)])){
+ $query = $tmp['query'][count($this->queries)]['filter'];
+ $backend = $tmp['query'][count($this->queries)]['backend'];
+ }elseif(isset($tmp['query']['filter'])){
+ $query = $tmp['query']['filter'];
+ $backend = $tmp['query']['backend'];
+ }
}
$this->queries[] = array('backend'=> $backend, 'filter' => userFilterEditor::_autoIndentFilter($query," "));
}
$this->queries[] = array('backend'=> $backend, 'filter' => userFilterEditor::_autoIndentFilter($query," "));
$o = substr_count($f, '(');
$c = substr_count($f, ')');
if($o != $c){
$o = substr_count($f, '(');
$c = substr_count($f, ')');
if($o != $c){
- $msgs[] = sprintf(_("Please check your filter #%s. You have '%s' opening and '%s' closing brackets!"), ($key+1),$o, $c);
+ $msgs[] = sprintf(_("Error in filter #%s: %s opening and %s closing brackets detected!"), bold($key+1), bold($o), bold($c));
}
}
}
}
{
$ret= array();
$ret['parent'] = $this->parent;
{
$ret= array();
$ret['parent'] = $this->parent;
- $ret['name'] = $this->name;
+ $ret['tag'] = $this->name;
$ret['description'] = $this->description;
$ret['categories'] = $this->selectedCategories;
$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";
$ret['flags'] = array();
if($this->share){
$ret['flags'][] = "share";