Merge branch 'ent-12768-16921-operator-read-puede-ver-inventario-de-todos-los-grupos' into 'develop'

Ent 12768 16921 operator read puede ver inventario de todos los grupos

See merge request artica/pandorafms!6853
This commit is contained in:
Rafael Ameijeiras 2024-02-26 11:50:52 +00:00
commit 81d937ae30
1 changed files with 9 additions and 0 deletions

View File

@ -892,6 +892,15 @@ function get_data_basic_info_sql($params, $count=false)
if ($params['id_group'] > 0) {
$where .= sprintf(' AND id_grupo = %d', $params['id_group']);
} else {
global $config;
$user_groups = implode(',', array_keys(users_get_groups($config['id_user'])));
// Avoid errors if there are no groups.
if (empty($user_groups) === true) {
$user_groups = '"0"';
}
$where .= sprintf(' AND id_grupo IN (%s)', $user_groups);
}
if ($params['search'] > 0) {