Quittierungsbeleg für SKF Leverkusen hinzugefügt

MoK erweiterte Ressourcenverfügbarkeitsprüfung hinzugefügt
MoK Darstellung von ServiceRecords mit Marker ist wie im FaC, Anpassung im Formular folgt
This commit is contained in:
2023-07-24 17:57:14 +02:00
parent b4ce085bba
commit 2a2cf05f5b
24 changed files with 2218 additions and 140 deletions

View File

@@ -101,7 +101,6 @@ function validateAppointmentForm() {
if(endDate.isBefore(startDate)) {
hideSpinner();
//$("#messagePopup .modal-body").html('<div class="alert alert-danger" role="alert">Das Startdatum muss vor dem Enddatum liegen.</div>');
showMessagePopupWithHtml("Fehler", '<div class="alert alert-danger" role="alert">Das Startdatum muss vor dem Enddatum liegen.</div>');
return;
}
@@ -111,20 +110,35 @@ function validateAppointmentForm() {
$("#resources-popup input:checked").each(function() {
var id = $(this).attr("id");
selectedOids.push(id.split("-")[0]);
logInfo(id);
selectedOids.push(id.split("-")[1]);
});
for(var i = 0; i < selectedOids.length; i++) {
oidString += selectedOids[i] + ",";
}
$.get(getCheckResourcesAvailabilityUrl(), { start: startDate.format("DD.MM.YYYY HH:mm"), end: endDate.format("DD.MM.YYYY HH:mm"), resourceOids: oidString }).done(function(result) {
if(result === undefined || result === null || result.length === 0) {
return;
}
$.get(getCheckResourcesAvailabilityUrl(), { start: startDate.format("DD.MM.YYYY HH:mm"), end: endDate.format("DD.MM.YYYY HH:mm"), resourceOids: oidString, allDay: isAllDay }).done(function(result) {
if (result.length > 1) {
try {
// ToDo: Wieder einchecken! (24.07.2023)
//hideSpinner();
//if (result.includes("Fehler!")) {
// showErrorMessagePopup(result.substring(7));
// return;
//} else {
// showMessagePopupWithHtml("Überschneidung",
// result,
// function() {
// $("#messagePopup .modal-body").html();
// showSpinner();
// insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm"));
// },
// false);
//}
var unavailableResources = $.parseJSON(result);
var resourceCount = 0;
var names = "";
@@ -140,14 +154,14 @@ function validateAppointmentForm() {
});
var unavailableResourcesMessage;
if(resourceCount > 0) {
if(resourceCount > 1) {
unavailableResourcesMessage = "Einige der ausgewählten Ressourcen (" + names + ") sind zum gewählten Zeitpunkt nicht verfügbar.";
} else {
unavailableResourcesMessage = "Eine der ausgewählten Ressourcen (" + names + ") ist zum gewählten Zeitpunkt nicht verfügbar.";
}
hideSpinner();
showWarningMessageBox("Überschneidung", unavailableResourcesMessage, function() {
@@ -158,13 +172,13 @@ function validateAppointmentForm() {
return;
}
} catch(error) {
} catch (error) {
showErrorPopup(error);
return;
}
} else {
insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm"));
}
insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm"));
});
}