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

Merge branch '5135-filter-enhancement' into '1.4-dev'

Resolve "filter enhancement"

See merge request fusiondirectory/fd!312
parents 610e62e9 74aaf18e
......@@ -100,6 +100,9 @@ class objects
if (is_array($attrs)) {
$search_attrs = array_keys($attrs);
if ($templateSearch) {
$search_attrs[] = 'fdTemplateField';
}
} else {
$search_attrs = array($attrs);
}
......@@ -142,6 +145,22 @@ class objects
}
}
}
if ($templateSearch) {
$result[$key]['fdTemplateField'] = array();
foreach ($fetched_attrs['fdTemplateField'] as $templateField) {
$attr = explode(':', $templateField, 2)[0];
if (isset($attrs[$attr])) {
if (isset($attrsAcls[$attr]) &&
(strpos($ui->get_permissions($key, $attrsAcls[$attr][0], $attrsAcls[$attr][1]), 'r') === FALSE)) {
continue;
}
$result[$key]['fdTemplateField'][] = $templateField;
}
}
if (empty($result[$key]['fdTemplateField'])) {
unset($result[$key]['fdTemplateField']);
}
}
if (count($result[$key]) === 0) {
unset($result[$key]);
}
......
......@@ -91,6 +91,9 @@ class TabFilterElement extends FilterElement
public function render()
{
if (empty($this->tabs)) {
return '';
}
$inputs = array();
foreach ($this->tabs as $class => $tab) {
$inputs['filter_tab_'.$class] = array(
......
......@@ -126,7 +126,7 @@ class PropertiesColumn extends Column
} else {
$attrs = $entry;
}
foreach ($this->tabs[$entry->type] as $class) {
foreach ($this->tabs[$entry->getTemplatedType()] as $class) {
$status = $class::isAccount($attrs);
if ($status !== FALSE) {
$pInfos = pluglist::pluginInfos($class);
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2013-2016 FusionDirectory
Copyright (C) 2013-2018 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -18,16 +18,8 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class aclRoleManagement extends simpleManagement
class aclRoleManagement extends management
{
// Tab definition
protected $objectTypes = array('aclRole');
protected $departmentBrowser = TRUE;
protected $departmentRootVisible = TRUE;
protected $baseMode = TRUE;
/* Return plugin informations for acl handling */
public static function plInfo()
{
return array(
......
......@@ -18,5 +18,5 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
simpleManagement::mainInc('aclRoleManagement');
management::mainInc('aclRoleManagement');
?>
  • SonarQube analysis indicates that quality gate is failed.

    • Security Rating on New Code is passed: Actual value 1
    • Reliability Rating on New Code is passed: Actual value 1
    • Maintainability Rating on New Code is passed: Actual value 1
    • Duplicated Lines on New Code (%) is failed: Actual value 8.016383850204798 > 5

    SonarQube analysis reported no issues.

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