1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-29 23:14:55 +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) {
@ -556,13 +559,12 @@ echo '
}, },
selectable: globals.dashboard.write_permission, selectable: globals.dashboard.write_permission,
select: function(start, end, allDay) { // info select: function (start, end, allDay) { // info
// 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");
@ -578,35 +580,35 @@ echo '
}, },
editable: globals.dashboard.write_permission, editable: globals.dashboard.write_permission,
eventDrop: function(event, delta, revertFunc ) {// info eventDrop: function (event, delta, revertFunc) {// info
// let event = info.event; // let event = info.event;
if (event.allDay!==true){ if (event.allDay !== true) {
$.post(globals.dashboard.load_url, { $.post(globals.dashboard.load_url, {
op: "modifica_intervento", op: "modifica_intervento",
id: event.id, id: event.id,
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") {
revertFunc(); // info.revert(); revertFunc(); // info.revert();
} }
}); });
}else{ } else {
revertFunc(); revertFunc();
} }
}, },
eventResize: function(event, delta, revertFunc) { // info eventResize: function (event, delta, revertFunc) { // info
// let event = info.event; // let event = info.event;
$.post(globals.dashboard.load_url, { $.post(globals.dashboard.load_url, {
@ -615,16 +617,16 @@ 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") {
revertFunc(); // info.revert(); revertFunc(); // info.revert();
} }
@ -632,7 +634,7 @@ echo '
}, },
// eventPositioned: function (info) { // eventPositioned: function (info) {
eventAfterRender: function(event, element) { eventAfterRender: function (event, element) {
// let event = info.event; // let event = info.event;
// let element = $(info.el); // let element = $(info.el);
element.find(".fc-title").html(event.title); element.find(".fc-title").html(event.title);
@ -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,
@ -652,7 +654,7 @@ echo '
touchDevices: true, touchDevices: true,
trigger: "hover", trigger: "hover",
position: "left", position: "left",
functionBefore: function(instance, helper) { functionBefore: function (instance, helper) {
let $origin = $(helper.origin); let $origin = $(helper.origin);
if ($origin.data("loaded") !== true) { if ($origin.data("loaded") !== 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");
} }
} }
}); });