From f998adc626ee2e3c41029425fd785cf8b020998f Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 22 Mar 2018 12:45:29 +0100 Subject: [PATCH] =?UTF-8?q?Aumentata=20flessibilit=C3=A0=20segmenti=20con?= =?UTF-8?q?=20introduzione=20dei=20filtri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/top.php | 2 +- modules/ddt/bulk.php | 11 +++ modules/fatture/controller_before.php | 8 +- modules/segmenti/actions.php | 7 +- modules/segmenti/add.php | 2 +- modules/segmenti/edit.php | 118 +++++++++++++++++--------- modules/viste/edit.php | 2 +- src/Modules.php | 2 +- update/2_4.sql | 2 + 9 files changed, 107 insertions(+), 47 deletions(-) diff --git a/include/top.php b/include/top.php index 722ccf9ac..dd7b58543 100644 --- a/include/top.php +++ b/include/top.php @@ -176,7 +176,7 @@ if (Auth::check()) {
-
diff --git a/modules/viste/edit.php b/modules/viste/edit.php index e4bd46b53..1b6c787b2 100644 --- a/modules/viste/edit.php +++ b/modules/viste/edit.php @@ -434,7 +434,7 @@ if (!empty($options) && $options != 'custom') {
{[ "type": "select", "label": "'.tr('Posizione').'", "name": "position[-id-]", "list=\"0\":\"'.tr('WHERE').'\",\"1\": \"'.tr('HAVING').'\"" ]} -
+
'; diff --git a/src/Modules.php b/src/Modules.php index 682eab197..b60690494 100644 --- a/src/Modules.php +++ b/src/Modules.php @@ -38,7 +38,7 @@ class Modules $user = Auth::user(); - $results = $database->fetchArray('SELECT * FROM `zz_modules` LEFT JOIN (SELECT `idmodule`, `permessi` FROM `zz_permissions` WHERE `idgruppo` = (SELECT `idgruppo` FROM `zz_users` WHERE `id` = '.prepare($user['id_utente']).')) AS `zz_permissions` ON `zz_modules`.`id`=`zz_permissions`.`idmodule` LEFT JOIN (SELECT `idmodule`, `clause`, `position` FROM `zz_group_module` WHERE `idgruppo` = (SELECT `idgruppo` FROM `zz_users` WHERE `id` = '.prepare($user['id_utente']).') AND `enabled` = 1) AS `zz_group_module` ON `zz_modules`.`id`=`zz_group_module`.`idmodule`'); + $results = $database->fetchArray('SELECT * FROM `zz_modules` LEFT JOIN (SELECT `idmodule`, `permessi` FROM `zz_permissions` WHERE `idgruppo` = (SELECT `idgruppo` FROM `zz_users` WHERE `id` = '.prepare($user['id_utente']).')) AS `zz_permissions` ON `zz_modules`.`id`=`zz_permissions`.`idmodule` LEFT JOIN (SELECT `id_module`, `clause`, `position` FROM `zz_segments`) AS `zz_segments` ON `zz_modules`.`id`=`zz_segments`.`id_module` LEFT JOIN (SELECT `idmodule`, `clause`, `position` FROM `zz_group_module` WHERE `idgruppo` = (SELECT `idgruppo` FROM `zz_users` WHERE `id` = '.prepare($user['id_utente']).') AND `enabled` = 1) AS `zz_group_module` ON `zz_modules`.`id`=`zz_group_module`.`idmodule`'); $modules = []; $additionals = []; diff --git a/update/2_4.sql b/update/2_4.sql index 069e82683..a85c5278d 100644 --- a/update/2_4.sql +++ b/update/2_4.sql @@ -166,6 +166,8 @@ CREATE TABLE IF NOT EXISTS `zz_segments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_module` int(11) NOT NULL, `name` varchar(255) NOT NULL, + `clause` TEXT NOT NULL, + `position` enum('WHR', 'HVN') NOT NULL DEFAULT 'WHR', `pattern` varchar(255) NOT NULL, `note` text NOT NULL, `predefined` BOOLEAN NOT NULL,