From 886ae8fe149adcbb5d3387bd3c403544ad84a5aa Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Tue, 20 Feb 2024 13:03:44 +0100 Subject: [PATCH] Fix vista utenti e permessi --- update/2_4_55.sql | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/update/2_4_55.sql b/update/2_4_55.sql index 282bd22a5..a02a0db6d 100644 --- a/update/2_4_55.sql +++ b/update/2_4_55.sql @@ -561,4 +561,21 @@ UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_module -- Divisione chiave di licenza Wacom in 2 stringhe come da SDK v2 UPDATE `zz_settings` SET `valore` = '' WHERE `nome` = 'Licenza Wacom SDK'; UPDATE `zz_settings` SET `nome` = 'Licenza Wacom SDK - Key' WHERE `nome` = 'Licenza Wacom SDK'; -INSERT INTO `zz_settings` (`nome`, `valore`, `tipo`, `editable`, `sezione`, `order`) VALUES ('Licenza Wacom SDK - Secret', '', 'string', '1', 'Tavoletta Wacom', '1'); \ No newline at end of file +INSERT INTO `zz_settings` (`nome`, `valore`, `tipo`, `editable`, `sezione`, `order`) VALUES ('Licenza Wacom SDK - Secret', '', 'string', '1', 'Tavoletta Wacom', '1'); + +-- Allineamento vista Utenti e Permessi +UPDATE `zz_modules` SET `options` = " +SELECT + |select| +FROM + `zz_groups` + LEFT JOIN (SELECT `zz_users`.`idgruppo`, COUNT(`id`) AS num FROM `zz_users` GROUP BY `idgruppo`) AS utenti ON `zz_groups`.`id`=`utenti`.`idgruppo` + LEFT JOIN (SELECT `zz_users`.`idgruppo`, COUNT(`id`) AS num FROM `zz_users` WHERE `zz_users`. `enabled` = 1 GROUP BY `idgruppo`) AS utenti_abilitati ON `zz_groups`.`id`=`utenti_abilitati`.`idgruppo` + LEFT JOIN (SELECT `zz_users`.`idgruppo`, COUNT(`zz_tokens`.`id`) AS num FROM `zz_users` INNER JOIN `zz_tokens` ON `zz_users`.`id` = `zz_tokens`.`id_utente` WHERE `zz_tokens`. `enabled` = 1 GROUP BY `idgruppo`) AS api_abilitate ON `zz_groups`.`id`=`utenti`.`idgruppo` + LEFT JOIN (SELECT `zz_modules`.`title`, `zz_modules`.`id` FROM `zz_modules`) AS `module` ON `module`.`id`=`zz_groups`.`id_module_start` +WHERE + 1=1 +HAVING + 2=2 +ORDER BY + `id`, `nome` ASC" WHERE `name` = 'Utenti e permessi'; \ No newline at end of file