#12859 Fixed groups

This commit is contained in:
Daniel Maya 2024-02-12 13:02:11 +01:00
parent b4c8e81e86
commit e8bd4b9e6b
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 = '';