1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-18 12:30:35 +01:00
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!')); 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; break;
} }

View File

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

View File

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

View File

@ -128,68 +128,71 @@ if (Services::isEnabled()) {
echo ' echo '
<hr><br> <hr><br>
<div class="alert alert-warning hidden" role="alert" id="spazio-fe"> <div class="alert alert-warning hidden" role="alert" id="spazio-fe">
<i class="fa fa-warning"></i> '.tr('Spazio per Fatture Elettroniche in esaurimento: _NUM_/_TOT_', [ <i class="fa fa-warning"></i> '.tr('Spazio per Fatture Elettroniche in esaurimento: _NUM_/_TOT_', [
'_NUM_' => '<span id="spazio-fe-occupato"></span>', '_NUM_' => '<span id="spazio-fe-occupato"></span>',
'_TOT_' => '<span id="spazio-fe-totale"></span>', '_TOT_' => '<span id="spazio-fe-totale"></span>',
]).'. '.tr("Contatta l'assistenza per maggiori informazioni").'. ]).'. '.tr("Contatta l'assistenza per maggiori informazioni").'.
</div> </div>
<h4>'.tr('Statistiche su Fatture Elettroniche').'</h4> <h4>'.tr('Statistiche su Fatture Elettroniche').'</h4>
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>'.tr('Anno').'</th> <th>'.tr('Anno').'</th>
<th> <th>
'.tr('Documenti archiviati').' '.tr('Documenti archiviati').'
<span class="tip" title="'.tr('Fatture attive e relative ricevute, fatture passive').'."> <span class="tip" title="'.tr('Fatture attive e relative ricevute, fatture passive').'.">
<i class="fa fa-question-circle-o"></i> <i class="fa fa-question-circle-o"></i>
</span> </span>
</th> </th>
<th> <th>
'.tr('Totale spazio occupato').' '.tr('Totale spazio occupato').'
<span class="tip" title="'.tr('Fatture attive con eventuali allegati e ricevute, fatture passive con eventuali allegati').'."> <span class="tip" title="'.tr('Fatture attive con eventuali allegati e ricevute, fatture passive con eventuali allegati').'.">
<i class="fa fa-question-circle-o"></i> <i class="fa fa-question-circle-o"></i>
</span> </span>
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody id="elenco-fe"> <tbody id="elenco-fe">
<tr class="info"> <tr class="info">
<td>'.tr('Totale').'</td> <td>'.tr('Totale').'</td>
<td id="fe_numero"></td> <td id="fe_numero"></td>
<td id="fe_spazio"></td> <td id="fe_spazio"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<script> <script>
$(document).ready(function (){ $(document).ready(function (){
aggiornaStatisticheFE(); aggiornaStatisticheFE();
}); });
</script>'; </script>';
} else { } else {
echo ' echo '
<div class="alert alert-warning" role="alert"> <div class="alert alert-warning" role="alert">
<i class="fa fa-warning"></i> '.tr('Nessuna risorsa Services abilitata').'. <i class="fa fa-warning"></i> '.tr('Nessuna risorsa Services abilitata').'.
</div>'; </div>';
} }
echo ' echo '
</div>
</div> </div>
</div>'; </div>';
} else { } else {
/*
echo ' echo '
<div class="col-md-12 col-lg-6"> <div class="col-md-12 col-lg-6">
<div class="alert alert-warning" role="alert"> <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"').'. <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>
</div>'; </div>';
*/
} }
echo ' echo '

View File

@ -38,7 +38,7 @@ class ServicesHook extends Manager
return [ return [
'icon' => 'fa fa-refresh text-warning', 'icon' => 'fa fa-refresh text-warning',
'message' => $message, 'message' => $message,
'show' => !$risorse_in_scadenza->isEmpty(), 'show' => Services::isEnabled() && !$risorse_in_scadenza->isEmpty(),
]; ];
} }

View File

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