diff --git a/modules/interventi/actions.php b/modules/interventi/actions.php index e71332322..716c431db 100644 --- a/modules/interventi/actions.php +++ b/modules/interventi/actions.php @@ -739,5 +739,14 @@ switch (post('op')) { flash()->info(tr('Attività duplicata correttamente!')); + break; + + case 'update_position': + $order = explode(',', post('order', true)); + + foreach ($order as $i => $id_riga) { + $dbo->query('UPDATE `in_righe_interventi` SET `order` = '.prepare($i + 1).' WHERE id='.prepare($id_riga)); + } + break; } diff --git a/modules/interventi/row-list.php b/modules/interventi/row-list.php index 2156a297d..03d3184d3 100755 --- a/modules/interventi/row-list.php +++ b/modules/interventi/row-list.php @@ -47,7 +47,7 @@ if (!$righe->isEmpty()) { - '; + '; foreach ($righe as $riga) { $extra = ''; @@ -158,6 +158,10 @@ if (!$righe->isEmpty()) { + + + + '; echo ' @@ -234,4 +238,23 @@ function modificaSeriali(button) { openModal("'.tr('Aggiorna SN').'", globals.rootdir + "/modules/fatture/add_serial.php?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&riga_id=" + id + "&riga_type=" + type); } + +$(document).ready(function() { + sortable(".sortable", { + axis: "y", + handle: ".handle", + cursor: "move", + dropOnEmpty: true, + scroll: true, + })[0].addEventListener("sortupdate", function(e) { + let order = $(".table tr[data-id]").toArray().map(a => $(a).data("id")) + + $.post(globals.rootdir + "/actions.php", { + id_module: globals.id_module, + id_record: globals.id_record, + op: "update_position", + order: order.join(","), + }); + }); +}); '; diff --git a/modules/preventivi/src/Preventivo.php b/modules/preventivi/src/Preventivo.php index 12f9b9a57..2b01e2c28 100755 --- a/modules/preventivi/src/Preventivo.php +++ b/modules/preventivi/src/Preventivo.php @@ -55,6 +55,8 @@ class Preventivo extends Document 'data_rifiuto', ]; + protected $info = []; + /** * Crea un nuovo preventivo. * diff --git a/modules/stato_servizi/edit.php b/modules/stato_servizi/edit.php index 63c59d60a..0cd95b49b 100755 --- a/modules/stato_servizi/edit.php +++ b/modules/stato_servizi/edit.php @@ -128,68 +128,71 @@ if (Services::isEnabled()) { echo ' -

+

- + -

'.tr('Statistiche su Fatture Elettroniche').'

- - - - - +

'.tr('Statistiche su Fatture Elettroniche').'

+
'.tr('Anno').' - '.tr('Documenti archiviati').' - - - -
+ + + + - - - + + + - - - - - - - -
'.tr('Anno').' + '.tr('Documenti archiviati').' + + + + - '.tr('Totale spazio occupato').' - - - -
+ '.tr('Totale spazio occupato').' + + + +
'.tr('Totale').'
+ + + '.tr('Totale').' + + + + + - '; + '; } else { echo ' - '; + '; } echo ' + '; } else { + /* echo '
'; + */ } echo ' diff --git a/modules/stato_servizi/src/ServicesHook.php b/modules/stato_servizi/src/ServicesHook.php index 25aa40d78..3134ac210 100644 --- a/modules/stato_servizi/src/ServicesHook.php +++ b/modules/stato_servizi/src/ServicesHook.php @@ -38,7 +38,7 @@ class ServicesHook extends Manager return [ 'icon' => 'fa fa-refresh text-warning', 'message' => $message, - 'show' => !$risorse_in_scadenza->isEmpty(), + 'show' => Services::isEnabled() && !$risorse_in_scadenza->isEmpty(), ]; } diff --git a/update/2_4_27.sql b/update/2_4_27.sql index a553a5b2b..94326e26a 100644 --- a/update/2_4_27.sql +++ b/update/2_4_27.sql @@ -9,4 +9,7 @@ INSERT INTO `zz_group_module` (`idgruppo`, `idmodule`, `name`, `clause`, `positi UPDATE `zz_cache` SET `valid_time` = '1 day' WHERE `zz_cache`.`name` = 'Informazioni su Services'; -- Ridotto il valid time per la cache informazioni su spazio FE -UPDATE `zz_cache` SET `valid_time` = '1 day' WHERE `zz_cache`.`name` = 'Informazioni su spazio FE'; \ No newline at end of file +UPDATE `zz_cache` SET `valid_time` = '1 day' WHERE `zz_cache`.`name` = 'Informazioni su spazio FE'; + +-- Ordinamento righe intervento +ALTER TABLE `in_righe_interventi` ADD `order` INT NOT NULL AFTER `idsede_partenza`;