[Secondary groups] Fixed display only secondary agents in tree view

This commit is contained in:
fermin831 2018-04-09 15:13:01 +02:00
parent f8d900ee75
commit 29a4e29cb9
1 changed files with 14 additions and 29 deletions

View File

@ -315,7 +315,7 @@ class Tree {
// ACL Group
$user_groups_str = "-1";
$group_filter = "";
if (!$this->strictACL) {
if (empty($this->userGroups)) {
return;
}
@ -329,25 +329,10 @@ class Tree {
// Asking for all groups.
else {
$user_groups_str = implode(",", array_keys($this->userGroups));
$group_filter = "AND ta.id_grupo IN ($user_groups_str)";
}
}
else {
if (!empty($this->acltags)) {
$groups = array();
foreach ($this->acltags as $group_id => $tags_str) {
if (empty($tags_str)) {
$hierarchy_groups = groups_get_id_recursive($group_id);
$groups = array_merge($groups, $hierarchy_groups);
}
}
if (!empty($groups)) {
if (array_search(0, $groups) === false) {
$user_groups_str = implode(",", $groups);
}
}
}
$group_filter = "AND ta.id_grupo IN ($user_groups_str)";
$group_filter = "AND (
ta.id_grupo IN ($user_groups_str)
OR tasg.id_group IN ($user_groups_str)
)";
}
if(!$search_hirearchy && (!empty($agent_search_filter) || !empty($module_search_filter))){