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(); }, 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..bf7159070 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": "" ]} @@ -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)); } 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'; diff --git a/update/2_3.sql b/update/2_3.sql index 93ec5d087..422647f8f 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`) 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`) 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`; @@ -706,8 +712,16 @@ 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 -UPDATE `zz_files` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `zz_modules`.`directory` = `zz_files`.`module`) WHERE `id_module` IS NULL; +-- 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`; -- Fix del widget 'Tutte le anagrafiche'