Merge branch 'ent-5371-tags-perfil-usuario-monitor-view' into 'develop'

Fixed monitor view groups without tags

See merge request artica/pandorafms!3083
This commit is contained in:
Alejandro Fraguas 2020-03-02 10:24:07 +01:00
commit 3c542b4d06
2 changed files with 6 additions and 18 deletions

View File

@ -789,6 +789,10 @@ function tags_get_acl_tags(
$acltags = [];
foreach ($raw_acltags as $group => $taglist) {
if (!empty($id_group) && !in_array($group, $id_group)) {
continue;
}
if (!empty($taglist)) {
$acltags[$group] = explode(',', $taglist);
} else {
@ -861,7 +865,7 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table='', $force_
// after the changes done into the 'tags_get_user_groups_and_tags' function.
foreach ($acltags as $group_id => $group_tags) {
if (empty($group_tags)) {
$group_tags = [];
// $group_tags = [];
if (!empty($force_tags)) {
$group_tags = $force_tags;
}
@ -881,7 +885,7 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table='', $force_
}
$group_conditions[] = $agent_condition;
} else if (!empty($force_tags)) {
} else if (!empty($force_tags) || !empty($group_id)) {
$without_tags[] = $group_id;
}
}

View File

@ -282,7 +282,6 @@ if ($tag_filter !== 0) {
$sql_conditions_tags = '';
if (!users_is_admin()) {
if ($ag_group !== 0) {
$sql_conditions_tags = tags_get_acl_tags(
$config['id_user'],
$ag_group,
@ -294,21 +293,6 @@ if (!users_is_admin()) {
[],
false
);
} else {
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
$groups = users_get_groups($config['id_user']);
$sql_conditions_tags = tags_get_acl_tags(
$config['id_user'],
array_keys($groups),
'AR',
'module_condition',
'AND',
'tagente_modulo',
true,
[],
false
);
}
if (is_numeric($sql_conditions_tags)) {
$sql_conditions_tags = ' AND 1 = 0';