1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-27 06:04:54 +01:00

Merge di OSM 2.4 su master

This commit is contained in:
Fabio Lovato 2018-03-27 12:09:16 +02:00
commit 53281ce209
7 changed files with 38 additions and 14 deletions

View File

@ -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();
},

View File

@ -10,7 +10,7 @@ unset($_SESSION['superselect']['id_categoria']);
<div class="row">
<div class="col-md-6">
{[ "type": "text", "label": "<?php echo tr('Inserisci il codice:'); ?>", "name": "codice", "required": 1, "value": "" ]}
{[ "type": "text", "label": "<?php echo tr('Inserisci il codice:'); ?>", "name": "codice", "class":"alphanumeric-mask", "required": 1, "value": "" ]}
</div>
<div class="col-md-6">

View File

@ -25,7 +25,7 @@ $_SESSION['superselect']['id_categoria'] = $records[0]['id_categoria'];
<div class="col-md-4">
{[ "type": "text", "label": "<?php echo tr('Codice'); ?>", "name": "codice", "required": 1, "value": "$codice$" ]}
{[ "type": "text", "label": "<?php echo tr('Codice'); ?>", "name": "codice", "class":"alphanumeric-mask", "required": 1, "value": "$codice$" ]}
<br>
{[ "type": "checkbox", "label": "<?php echo tr("Seleziona per rendere visibile l'articolo"); ?>", "name": "attivo", "value": "$attivo$", "help": "", "placeholder": "<?php echo tr('ATTIVO'); ?>" ]}
@ -69,6 +69,7 @@ $_SESSION['superselect']['id_categoria'] = $records[0]['id_categoria'];
</div>
<?php
($records[0]['serial']>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 '<script>$("#link-tab_'.$plugin[0]['id'].'").addClass("disabled");</script>';
@ -76,7 +77,7 @@ $_SESSION['superselect']['id_categoria'] = $records[0]['id_categoria'];
?>
<div class="col-md-3">
{[ "type": "checkbox", "label": "<?php echo tr('Abilita serial number'); ?>", "name": "abilita_serial", "value": "$abilita_serial$", "help": "", "placeholder": "<?php echo tr('Abilita serial number in fase di aggiunta articolo in fattura o ddt'); ?>" ]}
{[ "type": "checkbox", "label": "<?php echo tr('Abilita serial number'); ?>", "name": "abilita_serial", "value": "$abilita_serial$", "help": "", "placeholder": "<?php echo tr('Abilita serial number in fase di aggiunta articolo in fattura o ddt'); ?>", "extra": "<?php echo ($records[0]['serial']>0) ? 'readonly' : ''; ?>" ]}
</div>

View File

@ -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));
}

View File

@ -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] = '<div class="col-md-4">'.$value.'</div>';
}
echo $title.PHP_EOL.implode(PHP_EOL, $fields).PHP_EOL.'<script>start_inputmask( "#info_componente" );</script>';
}
echo $title;
echo '<div class="row">';
echo PHP_EOL.implode(PHP_EOL, $fields).PHP_EOL.'<script>start_inputmask( "#info_componente" );</script>';
echo '</div>';
}

View File

@ -16,7 +16,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-2">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "#ffffff", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "required": 1, "class": "colorpicker text-center", "value": "#ffffff", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>
@ -31,9 +31,9 @@ include_once __DIR__.'/../../core.php';
<script>
$(document).ready( function(){
$('.colorpicker').colorpicker().on('changeColor', function(){
$('#colore').parent().find('.square').css( 'background', $('#colore').val() );
$('#colore_').parent().find('.square').css( 'background', $('#colore_').val() );
});
$('#colore').parent().find('.square').css( 'background', $('#colore').val() );
$('#colore_').parent().find('.square').css( 'background', $('#colore_').val() );
});
</script>

View File

@ -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'