Merge branch 'ent-9556-14267-Conteo-y-paginacion-incorrecto-en-vista-de-Dashboards' into 'develop'

fixed count query for admin user

See merge request artica/pandorafms!5348
This commit is contained in:
Rafael Ameijeiras 2022-12-28 11:35:18 +00:00
commit 96257faf31
1 changed files with 5 additions and 12 deletions

View File

@ -695,7 +695,7 @@ class Manager implements PublicLogin
// Check ACl.
if (\is_user_admin($config['id_user']) !== true) {
// User no admin see dashboards of him groups and profile 'AR'.
// Non-admin user can see dashboards of his groups and 'AR' profile.
$group_list = \users_get_groups(
$config['id_user'],
'RR',
@ -802,7 +802,7 @@ class Manager implements PublicLogin
global $config;
if (is_user_admin($config['id_user']) !== false) {
// User no admin see dashboards of him groups and profile 'AR'.
// Non-admin user can see dashboards of his groups and 'AR' profile.
$group_list = \users_get_groups(
$config['id_user'],
'RR',
@ -820,18 +820,11 @@ class Manager implements PublicLogin
$sql_dashboard = sprintf(
"SELECT COUNT(*)
FROM tdashboard
WHERE (id_group IN (%s) AND id_user = '') OR
id_user = '%s'",
$string_groups,
$config['id_user']
WHERE (id_group IN (%s))",
$string_groups
);
} else {
$sql_dashboard = sprintf(
"SELECT COUNT(*)
FROM tdashboard
WHERE id_group = 0 AND id_user = '%s'",
$config['id_user']
);
$sql_dashboard = 'SELECT COUNT(*) FROM tdashboard WHERE id_group = 0';
}
} else {
$sql_dashboard = 'SELECT COUNT(*) FROM tdashboard';