Merge branch 'ent-12859-17048-alc-enterprise-no-filtra-correctamente-en-dashboards' into 'develop'

Ent 12859 17048 alc enterprise no filtra correctamente en dashboards

See merge request artica/pandorafms!6926
This commit is contained in:
Rafael Ameijeiras 2024-02-13 08:19:15 +00:00
commit 76a4df9a07
1 changed files with 13 additions and 0 deletions

View File

@ -117,12 +117,25 @@ if ($method === 'draw') {
$where_name = 'name LIKE "%'.$filter['free_search'].'%"';
}
if (is_user_admin($config['id_user']) === false) {
$group_list = \users_get_groups(
$config['id_ser'],
'RR',
true
);
}
$where_group = '';
if (empty($filter['group']) === false && $filter['group'] !== '0') {
$where_group = sprintf('id_group = %s', $filter['group']);
if (empty($where_name) === false) {
$where_group = 'AND '.$where_group;
}
} else if (empty($group_list) === false) {
$where_group = sprintf('id_group IN (%s)', implode(',', array_keys($group_list)));
if (empty($where_name) === false) {
$where_group = 'AND '.$where_group;
}
}
$where = '';