From 5232b0e2d1e7ff2d37833d9d6bdd442dde4684b5 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 26 Mar 2018 18:09:02 +0200 Subject: [PATCH 1/9] =?UTF-8?q?FIX=20=E2=80=93=20In=20fase=20di=20migrazio?= =?UTF-8?q?ne=20da=202.2=20a=202.3=20NON=20veniva=20calcolato=20correttame?= =?UTF-8?q?nte=20il=20campo=20=E2=80=98id=5Fmodule=E2=80=99=20perdendo=20d?= =?UTF-8?q?i=20fatto=20il=20riferimento=20con=20il=20modulo=20di=20proveni?= =?UTF-8?q?enza=20degli=20allegati.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update/2_3.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/2_3.sql b/update/2_3.sql index 93ec5d087..e1485c4d8 100644 --- a/update/2_3.sql +++ b/update/2_3.sql @@ -707,7 +707,7 @@ UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_mod UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Fatture di acquisto') WHERE `module`= 'fatture' AND `id_record` IN (SELECT `id` FROM `co_documenti` WHERE `idtipodocumento` IN (SELECT `id` FROM `co_tipidocumento` WHERE `dir` = 'uscita')); -- Adeguamento generico di zz_files -UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`directory` = `zz_files`.`module`) WHERE `id_module` IS NULL; +UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`directory` = `zz_files`.`module`); ALTER TABLE `zz_files` DROP `module`; -- Fix del widget 'Tutte le anagrafiche' From 885b193173c5d526f036555a39ebab5f66f56cc2 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 26 Mar 2018 18:13:10 +0200 Subject: [PATCH 2/9] =?UTF-8?q?Revert=20"FIX=20=E2=80=93=20In=20fase=20di?= =?UTF-8?q?=20migrazione=20da=202.2=20a=202.3=20NON=20veniva=20calcolato?= =?UTF-8?q?=20correttamente=20il=20campo=20=E2=80=98id=5Fmodule=E2=80=99?= =?UTF-8?q?=20perdendo=20di=20fatto=20il=20riferimento=20con=20il=20modulo?= =?UTF-8?q?=20di=20provenienza=20degli=20allegati."?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5232b0e2d1e7ff2d37833d9d6bdd442dde4684b5. --- update/2_3.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/2_3.sql b/update/2_3.sql index e1485c4d8..93ec5d087 100644 --- a/update/2_3.sql +++ b/update/2_3.sql @@ -707,7 +707,7 @@ UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_mod UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Fatture di acquisto') WHERE `module`= 'fatture' AND `id_record` IN (SELECT `id` FROM `co_documenti` WHERE `idtipodocumento` IN (SELECT `id` FROM `co_tipidocumento` WHERE `dir` = 'uscita')); -- Adeguamento generico di zz_files -UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`directory` = `zz_files`.`module`); +UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`directory` = `zz_files`.`module`) WHERE `id_module` IS NULL; ALTER TABLE `zz_files` DROP `module`; -- Fix del widget 'Tutte le anagrafiche' From 1fbfcb6b1295bd0d2ce353647b59afd49ad29a65 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 26 Mar 2018 18:15:30 +0200 Subject: [PATCH 3/9] =?UTF-8?q?FIX=20=E2=80=93=20In=20fase=20di=20migrazio?= =?UTF-8?q?ne=20da=202.2=20a=202.3=20NON=20veniva=20calcolato=20correttame?= =?UTF-8?q?nte=20il=20campo=20=E2=80=98id=5Fmodule=E2=80=99=20perdendo=20d?= =?UTF-8?q?i=20fatto=20il=20riferimento=20con=20il=20modulo=20di=20proveni?= =?UTF-8?q?enza=20degli=20allegati.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update/2_3.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/2_3.sql b/update/2_3.sql index 93ec5d087..08d3dfd53 100644 --- a/update/2_3.sql +++ b/update/2_3.sql @@ -707,7 +707,7 @@ UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_mod UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Fatture di acquisto') WHERE `module`= 'fatture' AND `id_record` IN (SELECT `id` FROM `co_documenti` WHERE `idtipodocumento` IN (SELECT `id` FROM `co_tipidocumento` WHERE `dir` = 'uscita')); -- Adeguamento generico di zz_files -UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`directory` = `zz_files`.`module`) WHERE `id_module` IS NULL; +UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`directory` = `zz_files`.`module`) WHERE `id_module` = 0; ALTER TABLE `zz_files` DROP `module`; -- Fix del widget 'Tutte le anagrafiche' From e754e3ba3318d1e9ea0ae0cc96ca9f8ec71a6740 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 26 Mar 2018 18:34:56 +0200 Subject: [PATCH 4/9] FIX - Aggiunte eccezioni anche per ddt e ordini --- update/2_3.sql | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/update/2_3.sql b/update/2_3.sql index 08d3dfd53..7e7e60e09 100644 --- a/update/2_3.sql +++ b/update/2_3.sql @@ -706,7 +706,15 @@ ALTER TABLE `zz_files` CHANGE `externalid` `id_record` int(11) NOT NULL, ADD `id UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Fatture di vendita') WHERE `module`= 'fatture' AND `id_record` IN (SELECT `id` FROM `co_documenti` WHERE `idtipodocumento` IN (SELECT `id` FROM `co_tipidocumento` WHERE `dir` = 'entrata')); UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Fatture di acquisto') WHERE `module`= 'fatture' AND `id_record` IN (SELECT `id` FROM `co_documenti` WHERE `idtipodocumento` IN (SELECT `id` FROM `co_tipidocumento` WHERE `dir` = 'uscita')); --- Adeguamento generico di zz_files +-- Adeguamento dei ddt (zz_files) +UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Ddt di vendita') WHERE `module`= 'ddt' AND `id_record` IN (SELECT `id` FROM `dt_ddt` WHERE `idtipoddt` IN (SELECT `id` FROM `dt_tipiddt` WHERE `dir` = 'entrata')); +UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Ddt di acquisto') WHERE `module`= 'ddt' AND `id_record` IN (SELECT `id` FROM `dt_ddt` WHERE `idtipoddt` IN (SELECT `id` FROM `dt_tipiddt` WHERE `dir` = 'uscita')); + +-- Adeguamento degli ordini (zz_files) +UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Ordini cliente') WHERE `module`= 'ordini' AND `id_record` IN (SELECT `id` FROM `or_ordini` WHERE `idtipoordine` IN (SELECT `id` FROM `or_tipiordine` WHERE `dir` = 'entrata')); +UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Ordini fornitore') WHERE `module`= 'ordini' AND `id_record` IN (SELECT `id` FROM `or_ordini` WHERE `idtipoordine` IN (SELECT `id` FROM `or_tipiordine` WHERE `dir` = 'uscita')); + +-- Adeguamento resto dei moduli (zz_files) UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`directory` = `zz_files`.`module`) WHERE `id_module` = 0; ALTER TABLE `zz_files` DROP `module`; From 93fafb03ff224e8a194fedb9c423eae251a67363 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 26 Mar 2018 18:53:21 +0200 Subject: [PATCH 5/9] FIX - Adeguamento id zz_files anche per interventi e impianti --- update/2_3.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/update/2_3.sql b/update/2_3.sql index 7e7e60e09..b79eca36a 100644 --- a/update/2_3.sql +++ b/update/2_3.sql @@ -699,6 +699,12 @@ ALTER TABLE `my_impianto_componenti` CHANGE `idsostituto` `idsostituto` int(11); UPDATE `my_impianto_componenti` SET `idsostituto` = NULL WHERE `idsostituto` = 0; ALTER TABLE `my_impianto_componenti` ADD FOREIGN KEY (`idsostituto`) REFERENCES `my_impianto_componenti`(`id`) ON DELETE CASCADE; +-- Adeguamento degli id di zz_files per interventi +UPDATE `zz_files` SET `externalid` = (SELECT `id` FROM `in_interventi` WHERE `in_interventi`.`idintervento` = `externalid`); + +-- Adeguamento degli id di zz_files per impianti +UPDATE `zz_files` SET `externalid` = (SELECT `id` FROM `my_impianti` WHERE `my_impianti`.`matricola` = `externalid`); + -- Adeguamento dei contenuti di zz_files ALTER TABLE `zz_files` CHANGE `externalid` `id_record` int(11) NOT NULL, ADD `id_module` int(11) NOT NULL AFTER `filename`, ADD `original` varchar(255) NOT NULL AFTER `filename`; From f9c65acf224df9afcd4208c6ac523b3398a3d939 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 26 Mar 2018 19:00:37 +0200 Subject: [PATCH 6/9] FIX - Adeguamento id zz_files anche per interventi e impianti --- update/2_3.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update/2_3.sql b/update/2_3.sql index b79eca36a..422647f8f 100644 --- a/update/2_3.sql +++ b/update/2_3.sql @@ -700,10 +700,10 @@ UPDATE `my_impianto_componenti` SET `idsostituto` = NULL WHERE `idsostituto` = 0 ALTER TABLE `my_impianto_componenti` ADD FOREIGN KEY (`idsostituto`) REFERENCES `my_impianto_componenti`(`id`) ON DELETE CASCADE; -- Adeguamento degli id di zz_files per interventi -UPDATE `zz_files` SET `externalid` = (SELECT `id` FROM `in_interventi` WHERE `in_interventi`.`idintervento` = `externalid`); +UPDATE `zz_files` SET `externalid` = (SELECT `id` FROM `in_interventi` WHERE `in_interventi`.`idintervento` = `externalid`) WHERE module = 'interventi' ; -- Adeguamento degli id di zz_files per impianti -UPDATE `zz_files` SET `externalid` = (SELECT `id` FROM `my_impianti` WHERE `my_impianti`.`matricola` = `externalid`); +UPDATE `zz_files` SET `externalid` = (SELECT `id` FROM `my_impianti` WHERE `my_impianti`.`matricola` = `externalid`) WHERE module = 'myimpianti' ; -- Adeguamento dei contenuti di zz_files ALTER TABLE `zz_files` CHANGE `externalid` `id_record` int(11) NOT NULL, ADD `id_module` int(11) NOT NULL AFTER `filename`, ADD `original` varchar(255) NOT NULL AFTER `filename`; From b128541c35f2651e4199de6ecf1ec88d3b5e3c9a Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 27 Mar 2018 01:00:15 +0200 Subject: [PATCH 7/9] Fix colorpicker stati intervento + associazione componente articolo --- modules/articoli/add.php | 2 +- modules/articoli/edit.php | 2 +- modules/my_impianti/modutil.php | 11 +++++++---- modules/stati_intervento/add.php | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/modules/articoli/add.php b/modules/articoli/add.php index 4ec020d53..df9e3967f 100644 --- a/modules/articoli/add.php +++ b/modules/articoli/add.php @@ -10,7 +10,7 @@ unset($_SESSION['superselect']['id_categoria']);
- {[ "type": "text", "label": "", "name": "codice", "required": 1, "value": "" ]} + {[ "type": "text", "label": "", "name": "codice", "class":"alphanumeric-mask", "required": 1, "value": "" ]}
diff --git a/modules/articoli/edit.php b/modules/articoli/edit.php index a52e4f37f..dcafc9b86 100644 --- a/modules/articoli/edit.php +++ b/modules/articoli/edit.php @@ -25,7 +25,7 @@ $_SESSION['superselect']['id_categoria'] = $records[0]['id_categoria'];
- {[ "type": "text", "label": "", "name": "codice", "required": 1, "value": "$codice$" ]} + {[ "type": "text", "label": "", "name": "codice", "class":"alphanumeric-mask", "required": 1, "value": "$codice$" ]}
{[ "type": "checkbox", "label": "", "name": "attivo", "value": "$attivo$", "help": "", "placeholder": "" ]} diff --git a/modules/my_impianti/modutil.php b/modules/my_impianti/modutil.php index 90314cef4..a8a3d3d27 100644 --- a/modules/my_impianti/modutil.php +++ b/modules/my_impianti/modutil.php @@ -6,10 +6,13 @@ function genera_form_componente($contenuto) { $fields = \Util\Ini::getFields($contenuto); $title = array_shift($fields); - + foreach ($fields as $key => $value) { $fields[$key] = '
'.$value.'
'; } - - echo $title.PHP_EOL.implode(PHP_EOL, $fields).PHP_EOL.''; -} + + echo $title; + echo '
'; + echo PHP_EOL.implode(PHP_EOL, $fields).PHP_EOL.''; + echo '
'; +} \ No newline at end of file diff --git a/modules/stati_intervento/add.php b/modules/stati_intervento/add.php index f4f6f659b..0c31490f4 100644 --- a/modules/stati_intervento/add.php +++ b/modules/stati_intervento/add.php @@ -16,7 +16,7 @@ include_once __DIR__.'/../../core.php';
- {[ "type": "text", "label": "", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "#ffffff", "extra": "maxlength='7'", "icon-after": "
" ]} + {[ "type": "text", "label": "", "name": "colore", "id": "colore_", "required": 1, "class": "colorpicker text-center", "value": "#ffffff", "extra": "maxlength='7'", "icon-after": "
" ]}
@@ -31,9 +31,9 @@ include_once __DIR__.'/../../core.php'; From 5802c3f932c0df43c4f9d517d6b9886ede9a9a7d Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 27 Mar 2018 01:12:34 +0200 Subject: [PATCH 8/9] =?UTF-8?q?Se=20ci=20sono=20seriali=20caricati=20per?= =?UTF-8?q?=20l'articolo,=20'abilita=20serial'=20=C3=A8=20attivo=20e=20in?= =?UTF-8?q?=20sola=20lettura?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/articoli/edit.php | 3 ++- modules/articoli/init.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/articoli/edit.php b/modules/articoli/edit.php index dcafc9b86..bf7159070 100644 --- a/modules/articoli/edit.php +++ b/modules/articoli/edit.php @@ -69,6 +69,7 @@ $_SESSION['superselect']['id_categoria'] = $records[0]['id_categoria'];
0) ? $records[0]['abilita_serial'] = 1 : $records[0]['abilita_serial'] = $records[0]['abilita_serial']; if (empty($records[0]['abilita_serial'])) { $plugin = $dbo->fetchArray("SELECT id FROM zz_plugins WHERE name='Serial'"); echo ''; @@ -76,7 +77,7 @@ $_SESSION['superselect']['id_categoria'] = $records[0]['id_categoria']; ?>
- {[ "type": "checkbox", "label": "", "name": "abilita_serial", "value": "$abilita_serial$", "help": "", "placeholder": "" ]} + {[ "type": "checkbox", "label": "", "name": "abilita_serial", "value": "$abilita_serial$", "help": "", "placeholder": "", "extra": "0) ? 'readonly' : ''; ?>" ]}
diff --git a/modules/articoli/init.php b/modules/articoli/init.php index c71d416bc..894dba964 100644 --- a/modules/articoli/init.php +++ b/modules/articoli/init.php @@ -3,5 +3,5 @@ include_once __DIR__.'/../../core.php'; if (isset($id_record)) { - $records = $dbo->fetchArray('SELECT * FROM mg_articoli WHERE id='.prepare($id_record)); + $records = $dbo->fetchArray('SELECT *, (SELECT COUNT(id) FROM mg_prodotti WHERE id_articolo = mg_articoli.id) AS serial FROM mg_articoli WHERE id='.prepare($id_record)); } From 74e924c3bbf10892b5fdae23c42e5a9302bb156d Mon Sep 17 00:00:00 2001 From: Bacca97 Date: Tue, 27 Mar 2018 11:55:12 +0200 Subject: [PATCH 9/9] Bugfix: aggiunto supporto cartella custom actions in add.php --- add.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/add.php b/add.php index b70b53ad7..6229452f9 100644 --- a/add.php +++ b/add.php @@ -72,11 +72,17 @@ $(document).ready(function(){ echo ' data.'.$key.' = "'.$value.'";'; } + + if (file_exists($docroot.$directory.'/custom/actions.php')) { + $url = $rootdir.$directory.'/custom/actions.php'; + } elseif (file_exists($docroot.$directory.'/actions.php')) { + $url = $rootdir.$directory.'/actions.php'; + } echo ' $("#form_'.$id_module.'-'.$id_plugin.'").find("form").ajaxForm({ - url: "'.$rootdir.$directory.'/actions.php", + url: "'.$url.'", beforeSubmit: function(arr, $form, options) { return $form.parsley().validate(); },