-- Aggiunta colonna modulo iniziale in utenti e permessi
UPDATE`zz_modules`SET`options`='SELECT\n |select|\nFROM \n `zz_groups` \n LEFT JOIN (SELECT `zz_users`.`idgruppo`, COUNT(`id`) AS num FROM `zz_users` GROUP BY `idgruppo`) AS utenti ON `zz_groups`.`id`=`utenti`.`idgruppo`\n LEFT JOIN (SELECT `zz_modules`.`title`, `zz_modules`.`id` FROM `zz_modules`) AS `module` ON `module`.`id`=`zz_groups`.`id_module_start`\nWHERE \n 1=1\nHAVING \n 2=2 \nORDER BY \n `id`, \n `nome` ASC'WHERE`zz_modules`.`name`='Utenti e permessi';
INSERTINTO`zz_views`(`id`,`id_module`,`name`,`query`,`order`,`search`,`slow`,`format`,`html_format`,`search_inside`,`order_by`,`visible`,`summable`,`default`)VALUES(NULL,(SELECT`id`FROM`zz_modules`WHERE`name`='Utenti e permessi'),'Modulo iniziale','`module`.`title`','5','1','0','0','0','','','1','0','0');
-- Aggiunta colonna tema in utenti e permessi
INSERTINTO`zz_views`(`id_module`,`name`,`query`,`order`,`search`,`slow`,`format`,`html_format`,`search_inside`,`order_by`,`visible`,`summable`,`default`)VALUES((SELECT`id`FROM`zz_modules`WHEREname='Utenti e permessi'),'_bg_','zz_groups.theme','4','0','0','1','0','','','0','0','0');
INSERTINTO`zz_views`(`id`,`id_module`,`name`,`query`,`order`,`search`,`slow`,`format`,`html_format`,`search_inside`,`order_by`,`visible`,`summable`,`default`)VALUES(NULL,(SELECT`id`FROM`zz_modules`WHERE`name`='Utenti e permessi'),'Tema','`zz_groups`.`theme`','4','1','0','0','0','','','1','0','0');
INSERTINTO`zz_modules`(`id`,`name`,`title`,`directory`,`options`,`options2`,`icon`,`version`,`compatibility`,`order`,`parent`,`default`,`enabled`,`use_notes`,`use_checklists`)VALUES(NULL,'Accesso con OAuth','Accesso con OAuth','oauth','SELECT |select| FROM zz_oauth2 WHERE 1=1 AND is_login=1 HAVING 2=2','','fa fa-angle-right','1.0','2.4.54','100',(SELECT`t`.`id`FROM`zz_modules`AS`t`WHERE`t`.`name`='Tabelle'),'1','1','0','0');
LEFTJOIN(SELECTCOUNT(id)as`emails`,`em_emails`.`id_record`FROM`em_emails`INNERJOIN`zz_operations`ON`zz_operations`.`id_email`=`em_emails`.`id`WHERE`id_module`IN(SELECT`id`FROM`zz_modules`WHEREname='Fatture di vendita')AND`zz_operations`.`op`='send-email'GROUPBY`em_emails`.`id_record`)AS`email`ON`email`.`id_record`=`co_documenti`.`id`
INSERTINTO`zz_settings`(`nome`,`valore`,`tipo`,`editable`,`sezione`,`order`,`help`)VALUES("Secondi timeout tavoletta Wacom",'15','text',1,'Tavoletta Wacom','6','Definisce il numero di secondi prima del timeout della tavoletta Wacom');