This commit is contained in:
MatteoPistorello 2021-06-28 15:46:02 +02:00
commit aad3eb180b
7 changed files with 47 additions and 19 deletions

View File

@ -131,7 +131,7 @@ echo '
</div>
<script>
loadSize("", "total_size");
loadSize('.count($backups).', "total_size");
</script>';
$upload_max_filesize = ini_get('upload_max_filesize');

View File

@ -39,6 +39,7 @@ use Plugins\ExportFE\FatturaElettronica;
use Traits\RecordTrait;
use Traits\ReferenceTrait;
use Util\Generator;
use Translator;
class Fattura extends Document
{
@ -193,10 +194,10 @@ class Fattura extends Document
// Registrazione dell'operazione nelle note
$model->note = tr("Operazione non imponibile come da vostra dichiarazione d'intento nr _PROT_ del _PROT_DATE_ emessa in data _RELEASE_DATE_, da noi registrata al nr _ID_ del _DATE_", [
'_PROT_' => $dichiarazione->numero_protocollo,
'_PROT_DATE_' => $dichiarazione->data_protocollo,
'_RELEASE_DATE_' => $dichiarazione->data_emissione,
'_PROT_DATE_' => Translator::dateToLocale($dichiarazione->data_protocollo),
'_RELEASE_DATE_' => Translator::dateToLocale($dichiarazione->data_emissione),
'_ID_' => $dichiarazione->id,
'_DATE_' => $dichiarazione->data,
'_DATE_' => Translator::dateToLocale($dichiarazione->data),
]).'.';
}

View File

@ -195,15 +195,15 @@ if (!empty($sessioni)) {
if (!$is_completato) {
echo '
<td class="text-center">
<button type="button" class="btn btn-xs btn-primary" onclick="copySessione(this)">
<button type="button" class="btn btn-xs btn-primary tip" title="'.tr('Salva e duplica sessione').'" onclick="copySessione(this)">
<i class="fa fa-files-o"></i>
</button>
<button type="button" class="btn btn-xs btn-warning tip" title="'.tr('Modifica sessione').'" onclick="modificaSessione(this)">
<button type="button" class="btn btn-xs btn-warning tip" title="'.tr('Salva e modifica sessione').'" onclick="modificaSessione(this)">
<i class="fa fa-edit"></i>
</button>
<button type="button" class="btn btn-xs btn-danger" id="delbtn_'.$sessione['id'].'" onclick="elimina_sessione(\''.$sessione['id'].'\');" title="Elimina riga" class="only_rw"><i class="fa fa-trash"></i></button>
<button type="button" class="btn btn-xs btn-danger tip" id="delbtn_'.$sessione['id'].'" onclick="elimina_sessione(\''.$sessione['id'].'\');" title="'.tr('Elimina sessione').'" class="only_rw"><i class="fa fa-trash"></i></button>
</td>';
}
@ -328,7 +328,13 @@ function add_tecnici(id_tecnico) {
* Rimuove la sessione di lavoro dall\'intervento.
*/
function elimina_sessione(id_sessione) {
if (confirm("Eliminare sessione di lavoro?")) {
swal({
title: "'.tr('Eliminare la sessione di lavoro?').'",
type: "warning",
showCancelButton: true,
confirmButtonText: "'.tr('Elimina').'"
}).then(function (result) {
$.ajax({
url: globals.rootdir + "/actions.php",
data: {
@ -341,11 +347,11 @@ function elimina_sessione(id_sessione) {
success: function() {
caricaTecnici();
caricaCosti();
calcolaConflittiTecnici();
}
});
}
}).catch(swal.noop);
}
async function copySessione(button) {

View File

@ -350,7 +350,7 @@ foreach ($tecnici as $tecnico) {
$sessioni = Stats::monthly($sessioni, $start, $end);
//Colore tecnico
$background = $tecnico['colore'];
$background = strtoupper($tecnico['colore']);
if (empty($background) || $background == '#FFFFFF') {
//Random color
$background = '#'.dechex(rand(256, 16777215));
@ -403,7 +403,7 @@ $(document).ready(function() {
// Include a dollar sign in the ticks
callback: function(value, index, values) {
var text = "";
if (value<=1){
if (value<=1 && value!=0){
text = " ora";
}else{
text = " ore";
@ -423,8 +423,16 @@ $(document).ready(function() {
if (label) {
label += ": ";
}
label += tooltipItem.xLabel+" ore (attività completate)";
label += tooltipItem.xLabel;
if (tooltipItem.xLabel<=1) {
label += " ora ";
}else{
label += " ore ";
}
label += "(in attività completate)";
return label;
}

View File

@ -145,7 +145,7 @@ if (Services::isEnabled()) {
$("#fe_spazio").html(response.size);
if (response.history.length) {
for (let i = 0; i < 5; i++) {
for (let i = 0; i < response.history.length; i++) {
const data = response.history[i];
$("#elenco-fe").append(`<tr>

View File

@ -37,6 +37,7 @@ if (!empty($utenti)) {
<table class="table table-hover table-condensed table-striped">
<tr>
<th>'.tr('Nome utente').'</th>
<th>'.tr('Email').'</th>
<th>'.tr('Ragione sociale').'</th>
<th>'.tr('Tipo di anagrafica').'</th>
<th>'.tr('Sedi').'</th>
@ -50,6 +51,14 @@ if (!empty($utenti)) {
<i class="fa fa-user"></i> '.$utente['username'].'
</td>';
if (!empty($utente['email'])) {
echo '
<td>'.$utente['email'].'</td>';
} else {
echo '
<td>-</td>';
}
if (!empty($utente['idanagrafica'])) {
echo '
<td>'.Modules::link('Anagrafiche', $utente['idanagrafica'], $utente['ragione_sociale']).'</td>
@ -71,7 +80,7 @@ if (!empty($utenti)) {
// Disabilitazione utente, se diverso da id_utente #1 (admin)
if ($utente['id'] == '1') {
echo '
<div data-toggle="tooltip" class="tip" title="'.tr("Non è possibile disabilitare l'utente admin").'" ><span class="btn btn-xs btn-default disabled">
<div data-toggle="tooltip" class="tip" title="'.tr("Non è possibile disabilitare l'utente admin").'" ><span class="btn btn-xs btn-danger disabled">
<i class="fa fa-eye-slash"></i>
</span></div>';
} elseif ($utente['enabled'] == 1) {
@ -95,7 +104,7 @@ if (!empty($utenti)) {
if ($utente['id'] == '1') {
echo '
<div data-toggle="tooltip" class="tip" title="'.tr("Non è possibile gestire l'accesso API per l'utente admin").'" ><span class="btn btn-xs btn-default disabled">
<div data-toggle="tooltip" class="tip" title="'.tr("Non è possibile gestire l'accesso API per l'utente admin").'" ><span class="btn btn-xs btn-danger disabled">
<i class="fa fa-key "></i>
</span></div>';
} elseif (!empty($token)) {
@ -113,7 +122,7 @@ if (!empty($utenti)) {
// Eliminazione utente, se diverso da id_utente #1 (admin)
if ($utente['id'] == '1') {
echo '
<div data-toggle="tooltip" class="tip" title="'.tr("Non è possibile eliminare l'utente admin").'" ><span class="btn btn-xs btn-default disabled">
<div data-toggle="tooltip" class="tip" title="'.tr("Non è possibile eliminare l'utente admin").'" ><span class="btn btn-xs btn-danger disabled">
<i class="fa fa-trash"></i>
</span></div>';
} else {

View File

@ -48,4 +48,8 @@ INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `
INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default`) VALUES
((SELECT `zz_modules`.`id` FROM `zz_modules` WHERE `zz_modules`.`name`='Scadenzario' ), 'Scaduto', 'IF(pagato = da_pagare, \'NO\', IF(data_concordata IS NOT NULL AND data_concordata > NOW(), \'NO\', IF(scadenza < NOW(), \'\', \'NO\')))', 14, 1, 0, 0, '', '', 1, 0, 0);
INSERT INTO `zz_group_view` (`id_gruppo`, `id_vista`) (SELECT `zz_groups`.`id`, `zz_views`.`id` FROM `zz_groups`, `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` WHERE `zz_modules`.`name` = 'Scadenzario' AND `zz_views`.`name` = 'Scaduto');
INSERT INTO `zz_group_view` (`id_gruppo`, `id_vista`) (SELECT `zz_groups`.`id`, `zz_views`.`id` FROM `zz_groups`, `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` WHERE `zz_modules`.`name` = 'Scadenzario' AND `zz_views`.`name` = 'Scaduto');
-- Aggiunta vista "N. utenti" per il modulo "Utenti e permessi"
INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default`) VALUES
(NULL, (SELECT `zz_modules`.`id` FROM `zz_modules` WHERE `zz_modules`.`name`='Utenti e permessi'), 'N. utenti', '(SELECT COUNT(`id`) FROM `zz_users` WHERE `idgruppo` = `zz_groups`.`id`)', 3, 1, 0, 0, '', '', 1, 0, 0);