This commit is contained in:
MatteoPistorello 2021-10-04 15:40:11 +02:00
commit 3577327acd
6 changed files with 85 additions and 45 deletions

View File

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

View File

@ -47,7 +47,7 @@ if (!$righe->isEmpty()) {
</tr>
</thead>
<tbody>';
<tbody class="sortable">';
foreach ($righe as $riga) {
$extra = '';
@ -158,6 +158,10 @@ if (!$righe->isEmpty()) {
<a class="btn btn-xs btn-danger" title="'.tr('Rimuovi riga').'" onclick="rimuoviRiga(this)">
<i class="fa fa-trash"></i>
</a>
<a class="btn btn-xs btn-default handle" title="'.tr('Modifica ordine delle righe').'">
<i class="fa fa-sort"></i>
</a>
</div>';
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(","),
});
});
});
</script>';

View File

@ -55,6 +55,8 @@ class Preventivo extends Document
'data_rifiuto',
];
protected $info = [];
/**
* Crea un nuovo preventivo.
*

View File

@ -182,14 +182,17 @@ if (Services::isEnabled()) {
echo '
</div>
</div>
</div>';
} else {
/*
echo '
<div class="col-md-12 col-lg-6">
<div class="alert alert-warning" role="alert">
<i class="fa fa-warning"></i> '.tr("Configurazione per l'accesso Services non completata correttamente").'. '.tr('Per abilitare i servizi, compilare l\'impostazione "OSMCloud Services API Token"').'.
</div>
</div>';
*/
}
echo '

View File

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

View File

@ -10,3 +10,6 @@ UPDATE `zz_cache` SET `valid_time` = '1 day' WHERE `zz_cache`.`name` = 'Informaz
-- 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';
-- Ordinamento righe intervento
ALTER TABLE `in_righe_interventi` ADD `order` INT NOT NULL AFTER `idsede_partenza`;