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:
parent
d0f2746d01
commit
f15b3925ff
@ -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) {
|
||||||
@ -408,7 +411,7 @@ echo '
|
|||||||
$("#elenco-promemoria").html(data);
|
$("#elenco-promemoria").html(data);
|
||||||
|
|
||||||
$("#external-events .fc-event").each(function () {
|
$("#external-events .fc-event").each(function () {
|
||||||
$(this).draggable({
|
$(this).draggable({
|
||||||
zIndex: 999,
|
zIndex: 999,
|
||||||
revert: true,
|
revert: true,
|
||||||
revertDuration: 0,
|
revertDuration: 0,
|
||||||
@ -507,7 +510,7 @@ echo '
|
|||||||
header: {
|
header: {
|
||||||
left: "prev,next today",
|
left: "prev,next today",
|
||||||
center: "title",
|
center: "title",
|
||||||
right: "month,agendaWeek,agendaDay"
|
right: "month,agendaWeek,agendaDay"
|
||||||
},
|
},
|
||||||
timeFormat: globals.dashboard.timeFormat,
|
timeFormat: globals.dashboard.timeFormat,
|
||||||
slotLabelFormat: globals.dashboard.timeFormat,
|
slotLabelFormat: globals.dashboard.timeFormat,
|
||||||
@ -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,11 +654,11 @@ 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) {
|
||||||
$.post(globals.dashboard.load_url, {
|
$.post(globals.dashboard.load_url, {
|
||||||
op: "tooltip_info",
|
op: "tooltip_info",
|
||||||
id_record: id_record,
|
id_record: id_record,
|
||||||
allDay: event.allDay,
|
allDay: event.allDay,
|
||||||
@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user