';
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,