Fix tactical view user count when user is in group

This commit is contained in:
Calvo 2022-03-10 08:22:45 +01:00
parent 565cb588ac
commit 78ab628c8b
2 changed files with 7 additions and 2 deletions

View File

@ -11199,7 +11199,7 @@ function reporting_get_stats_users($data)
$users = get_users('', ['disabled' => 0], ['id_user', 'is_admin']);
} else {
foreach ($group_um as $group => $value) {
$users = array_merge($users, users_get_users_by_group($group, $value));
$users = array_merge($users, users_get_users_by_group($group, $value, false));
}
}
}

View File

@ -778,9 +778,10 @@ function users_get_groups_UM($id_user)
* Obtiene una matriz con los grupos como clave y si tiene o no permiso UM sobre ese grupo(valor)
*
* @param string User id
* @param boolean $disabled Return also disabled users
* @return array Return .
*/
function users_get_users_by_group($id_group, $um=false)
function users_get_users_by_group($id_group, $um=false, $disabled=true)
{
$sql = sprintf(
"SELECT tusuario.* FROM tusuario
@ -789,6 +790,10 @@ function users_get_users_by_group($id_group, $um=false)
$id_group
);
if ($disabled === false) {
$sql .= 'WHERE tusuario.disabled = 0';
}
$users = db_get_all_rows_sql($sql);
$return = [];
foreach ($users as $key => $user) {