Commit d0394191 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5867-fields-searched-for-by-text-filter-should-be-provided-by-tabs' into '1.4-dev'

Resolve "Fields searched for by text filter should be provided by tabs"

See merge request fusiondirectory/fd!515
parents b2a702c1 cb2684c9
......@@ -104,6 +104,7 @@ class managementFilter
$attrs = objects::getSearchedAttributes($type);
$this->searchAttributes[$type] = array();
$this->parent->listing->fillSearchedAttributes($type, $attrs);
foreach ($attrs as $attr => $acl) {
$rights = $ui->get_permissions($base, $acl);
if (strpos($rights, 'r') !== FALSE) {
......
......@@ -559,6 +559,25 @@ class managementListing
{
return $this->multiSelect;
}
}
?>
function fillSearchedAttributes($type, array &$attrs)
{
global $ui;
$searchedAttributes = array();
foreach ($this->columns as $column) {
$column->fillSearchedAttributes($searchedAttributes);
}
$searchedAttributes = array_unique($searchedAttributes);
foreach ($searchedAttributes as $attr) {
if (!isset($attrs[$attr])) {
$category = $ui->getAttributeCategory($type, $attr);
if ($category !== FALSE) {
$attrs[$attr] = $category;
}
}
}
}
}
......@@ -116,6 +116,21 @@ class Column
}
}
function fillSearchedAttributes(array &$attrs)
{
if (isset($this->attributes)) {
foreach ($this->attributes as $attr) {
if (($attr == 'mainAttr') || ($attr == 'nameAttr')) {
/* nameAttr and mainAttr as always searched for */
continue;
}
if ($attr != 'dn') {
$attrs[] = $attr;
}
}
}
}
function fillRowClasses(&$classes, ListingEntry $entry)
{
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment