1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-30 15:35:09 +01:00

Correzioni minori JS Dashboard

This commit is contained in:
Dasc3er 2021-08-05 10:01:49 +02:00
parent d0f2746d01
commit f15b3925ff

View File

@ -358,6 +358,9 @@ echo '
url: globals.rootdir + "/add.php?id_module='.$modulo_interventi->id.'", url: globals.rootdir + "/add.php?id_module='.$modulo_interventi->id.'",
}, },
error: "'.tr('Errore durante la creazione degli eventi').'", error: "'.tr('Errore durante la creazione degli eventi').'",
genericError: "'.tr('Errore').'",
genericWarning: "'.tr('Attenzione').'",
informazioni_aggiuntive: '.intval(setting('Visualizza informazioni aggiuntive sul calendario')).',
}; };
function aggiorna_contatore(counter_id) { function aggiorna_contatore(counter_id) {
@ -518,7 +521,7 @@ echo '
lazyFetching: true, lazyFetching: true,
selectMirror: true, selectMirror: true,
eventLimit: false, // allow "more" link when too many events eventLimit: false, // allow "more" link when too many events
allDaySlot: '.intval(setting('Visualizza informazioni aggiuntive sul calendario')).', allDaySlot: globals.dashboard.informazioni_aggiuntive,
loading: function (isLoading, view) { loading: function (isLoading, view) {
if (isLoading) { if (isLoading) {
@ -560,9 +563,8 @@ echo '
// let start = info.start; // let start = info.start;
// let end = info.end; // let end = info.end;
let is_allDay = !start.hasTime() && !end.hasTime(); let intero_giorno = !start.hasTime() && !end.hasTime();
if (intero_giorno !== true) {
if (is_allDay!==true){
let data = moment(start).format("YYYY-MM-DD"); let data = moment(start).format("YYYY-MM-DD");
let data_fine = moment(end).format("YYYY-MM-DD"); let data_fine = moment(end).format("YYYY-MM-DD");
let orario_inizio = moment(start).format("HH:mm"); let orario_inizio = moment(start).format("HH:mm");
@ -588,13 +590,13 @@ echo '
idintervento: event.idintervento, idintervento: event.idintervento,
timeStart: moment(event.start).format("YYYY-MM-DD HH:mm"), timeStart: moment(event.start).format("YYYY-MM-DD HH:mm"),
timeEnd: moment(event.end).format("YYYY-MM-DD HH:mm") timeEnd: moment(event.end).format("YYYY-MM-DD HH:mm")
}, function (data, response) { }, function (data, responseType) {
data = $.trim(data); data = $.trim(data);
if (response == "success" && data !== "ok") { if (responseType === "success" && data !== "ok") {
swal("'.tr('Attenzione').'", data, "warning"); swal(globals.dashboard.genericWarning, data, "warning");
}else if (response !== "success"){ } else if (responseType !== "success") {
swal("'.tr('Errore').'", data, "error"); swal(globals.dashboard.genericError, data, "error");
} }
if (data !== "ok") { if (data !== "ok") {
@ -615,13 +617,13 @@ echo '
idintervento: event.idintervento, idintervento: event.idintervento,
timeStart: moment(event.start).format("YYYY-MM-DD HH:mm"), timeStart: moment(event.start).format("YYYY-MM-DD HH:mm"),
timeEnd: moment(event.end).format("YYYY-MM-DD HH:mm") timeEnd: moment(event.end).format("YYYY-MM-DD HH:mm")
}, function (data, response) { }, function (data, responseType) {
data = $.trim(data); data = $.trim(data);
if (response == "success" && data !== "ok") { if (responseType === "success" && data !== "ok") {
swal("'.tr('Attenzione').'", data, "warning"); swal(globals.dashboard.genericWarning, data, "warning");
}else if (response !== "success"){ } else if (responseType !== "success") {
swal("'.tr('Errore').'", data, "error"); swal(globals.dashboard.genericError, data, "error");
} }
if (data !== "ok") { if (data !== "ok") {
@ -640,7 +642,7 @@ echo '
if (globals.dashboard.tooltip == 1) { if (globals.dashboard.tooltip == 1) {
element.tooltipster({ element.tooltipster({
content: "'.tr('Caricamento...').'", content: globals.translations.loading + "...",
animation: "grow", animation: "grow",
updateAnimation: "grow", updateAnimation: "grow",
contentAsHTML: true, contentAsHTML: true,
@ -674,7 +676,7 @@ echo '
url: globals.dashboard.load_url + "&op=interventi_periodo", url: globals.dashboard.load_url + "&op=interventi_periodo",
type: "GET", type: "GET",
error: function () { error: function () {
swal("'.tr('Errore').'", globals.dashboard.error, "error"); swal(globals.dashboard.genericError, globals.dashboard.error, "error");
} }
} }
}); });