();
+
+ return PartialView("ResourceSelectionPopupListPartial", Model);
+ }
+
+ [Authorize]
+ public ActionResult LoadUpdatedResourcePopupList()
+ {
+ if(Model is null)
+ {
+ TempData[TempDataConstants.DoLogoutKey] = true;
+ return PartialView("ResourceSelectionPopupListPartial");
+ }
+
+ return PartialView("ResourceSelectionPopupListPartial", Model);
+ }
+
+ [Authorize]
+ public ActionResult LoadUpdatedResources()
+ {
+ if(Model is null)
+ {
+ TempData[TempDataConstants.DoLogoutKey] = true;
+ return PartialView("SchedulerResourceSelectionPartial");
+ }
+
+ return PartialView("SchedulerResourceSelectionPartial", Model);
+ }
+ #endregion
+
+
+
[Authorize]
public ActionResult FetchCustomersForFiltering()
{
diff --git a/BeWoPlanerMobil/Models/SchedulerModel.cs b/BeWoPlanerMobil/Models/SchedulerModel.cs
index 6a5858a23..f8320b4b3 100644
--- a/BeWoPlanerMobil/Models/SchedulerModel.cs
+++ b/BeWoPlanerMobil/Models/SchedulerModel.cs
@@ -64,13 +64,9 @@ namespace BeWoPlanerMobil.Models
public string SubjectToEdit => SelectedAppointment?.Subject ?? string.Empty;
- public string StartDateToEdit => SelectedAppointment?.StartDate?.ToShortDateString() ?? SelectedDate.ToShortDateString();
+ public string StartDateToEdit => SelectedAppointment?.StartDate?.ToString("yyyy-MM-ddTHH:mm") ?? SelectedDate.ToString("yyyy-MM-ddTHH:mm");
- public string EndDateToEdit => SelectedAppointment?.EndDate?.ToShortDateString() ?? SelectedDate.ToShortDateString();
-
- public string StartTimeToEdit => SelectedAppointment?.StartDate?.ToShortTimeString() ?? string.Empty;
-
- public string EndTimeToEdit => SelectedAppointment?.EndDate?.ToShortTimeString() ?? string.Empty;
+ public string EndDateToEdit => SelectedAppointment?.EndDate?.ToString("yyyy-MM-ddTHH:mm") ?? SelectedDate.ToString("yyyy-MM-ddTHH:mm");
public string LocationToEdit => SelectedAppointment?.Location ?? string.Empty;
diff --git a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/signature.js b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/signature.js
index 037fc5259..c5f14a7f0 100644
--- a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/signature.js
+++ b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/signature.js
@@ -5,17 +5,17 @@ function hideSignature() {
function resizeCanvas(sketchPadId, canvasRoId) {
if($(sketchPadId).length !== 0) {
- var rowWidth = $(canvasRoId).innerWidth();
- var sourceCanvas = document.getElementById(sketchPadId.split("#")[1]);
+ const rowWidth = $(canvasRoId).innerWidth();
+ const sourceCanvas = document.getElementById(sketchPadId.split("#")[1]);
- var canvasWidth = sourceCanvas.scrollWidth;
+ const canvasWidth = sourceCanvas.scrollWidth;
- var newWidth = rowWidth;
+ const newWidth = rowWidth;
var parsedNewWidth = parseInt(newWidth, 10);
- var parsedCanvasWidth = parseInt(canvasWidth, 10);
+ const parsedCanvasWidth = parseInt(canvasWidth, 10);
- var isMinDifferenceMet = false;
+ let isMinDifferenceMet = false;
if (parsedCanvasWidth > parsedNewWidth) {
isMinDifferenceMet = parsedCanvasWidth - parsedNewWidth > 4;
@@ -56,19 +56,19 @@ function resizeCanvas(sketchPadId, canvasRoId) {
function initializeSignature(selectedServiceRecordOid) {
$("#main-container, #checkbox-container").hide();
$("#signature-container").addClass("d-block");
-
+
$.get(getSelectedRecordInformationUrlWithOid(), { oid: selectedServiceRecordOid }).done(function(jsonServiceRecord2Monatsunterschrift) {
- if (jsonServiceRecord2Monatsunterschrift === "SessionTimeout") {
+ if(jsonServiceRecord2Monatsunterschrift === "SessionTimeout") {
window.location.href = getRedirectLink();
return;
}
- if (isEmptyOrSpaces(jsonServiceRecord2Monatsunterschrift)) {
+ if(isEmptyOrSpaces(jsonServiceRecord2Monatsunterschrift)) {
$("#main-container, #checkbox-container").show();
$("#signature-container").removeClass("d-block");
showMessagePopupWithHtmlAndCallback("Fehler", "Der zu unterschreibende Zeiterfassungseintrag konnte nicht geladen werden. Bitte wenden Sie sich an den Support.
support@bewoplaner.de", false,
- function () {
+ function() {
showSpinner();
location.reload();
@@ -107,21 +107,21 @@ function initializeSignature(selectedServiceRecordOid) {
$("#signature-employee").text(record.Employee.FirstName + " " + record.Employee.LastName);
$("#signature-date-time").text(datum + " " + startDate + " - " + endDate);
- if (hasMonatsunterschrift === true) {
+ if(hasMonatsunterschrift === true) {
var customerFirstName = record.Customer.FirstName;
var customerLastName = record.Customer.LastName;
var customerName = "";
- if (isEmptyOrSpaces(customerFirstName) && isEmptyOrSpaces(customerLastName) === false) {
+ if(isEmptyOrSpaces(customerFirstName) && isEmptyOrSpaces(customerLastName) === false) {
customerName = customerLastName;
- } else if (isEmptyOrSpaces(customerLastName) && false === isEmptyOrSpaces(customerFirstName)) {
+ } else if(isEmptyOrSpaces(customerLastName) && false === isEmptyOrSpaces(customerFirstName)) {
customerName = customerFirstName;
} else {
customerName = customerLastName + ", " + customerFirstName;
}
- $("#signature-alert").html("Für diesen Eintrag (" + datum + " " + startDate + " - " + endDate + ") existiert bereits eine Monatsunterschrift von " + customerName + ".
Das Leisten dieser Unterschrift ist nicht notwendig.");
+ $("#signature-alert").html(`Für diesen Eintrag (${datum} ${startDate} - ${endDate}) existiert bereits eine Monatsunterschrift von ${customerName}.
Das Leisten dieser Unterschrift ist nicht notwendig.`);
$("#signature-alert").removeClass("d-none");
}
@@ -165,43 +165,26 @@ function initializeSignature(selectedServiceRecordOid) {
function saveButtonClick(selectedServiceRecordOid) {
try {
- var url = getSetSelectedSignatureUrl();
- var date = moment(new Date());
+ const date = moment(new Date());
- var clonedCanvas = trimCanvas(cloneCanvas(document.getElementById("sketch-pad")));
+ const clonedCanvas = trimCanvas(cloneCanvas(document.getElementById("sketch-pad")));
- var context = clonedCanvas.getContext("2d", {willReadFrequently: true});
+ const context = clonedCanvas.getContext("2d", {willReadFrequently: true});
context.globalCompositeOperation = "destination-over";
context.fillStyle = "white";
context.fillRect(0, 0, clonedCanvas.width, clonedCanvas.height);
- var dataUrl = clonedCanvas.toDataURL("image/png");
-
- var formattedDate = date.format("DD.MM.YYYY HH:mm:ss");
+ const dataUrl = clonedCanvas.toDataURL("image/png");
+ const formattedDate = date.format("DD.MM.YYYY HH:mm:ss");
+
showSpinner();
- $.post(url, {blob: dataUrl, timeStamp: formattedDate, serviceRecordOid: selectedServiceRecordOid}).done(function (json) {
- hideSpinner();
-
- if(json === "1") {
- $("#signature-container").removeClass("d-block");
- $("#main-container, #checkbox-container").show();
- showMessagePopupWithCallback("Unterschrift", "Die Unterschrift wurde erfolgreich gespeichert.", function () {
- showSpinner();
- $("#signature-alert").addClass("d-none");
- location.reload();
- }, true);
- } else {
- var errorMessage = json === "0" ? "Es ist ein Fehler beim Speichern der Unterschrift aufgetreten. Bitte wenden Sie sich an Ihren Administrator." : json;
-
- showMessagePopup("Fehler", errorMessage);
- $("#signature-alert").addClass("d-none");
- signaturePad.clear();
- }
- });
+ $(`#sr-sig-blob-${selectedServiceRecordOid}`).val(dataUrl);
+ $(`#sr-sig-date-${selectedServiceRecordOid}`).val(formattedDate);
+ $(`#save-signature-form-${selectedServiceRecordOid}`).submit();
} catch (error) {
- showErrorPopup(error);
+ window.showErrorPopup(error);
}
}
@@ -216,7 +199,7 @@ function cancelButtonClick(signaturePad) {
signaturePad.clear();
}, false);
} catch(error) {
- showErrorPopup(error);
+ window.showErrorPopup(error);
}
}
@@ -224,6 +207,6 @@ function clearButtonClick(signaturePad) {
try {
signaturePad.clear();
} catch(error) {
- showErrorPopup(error);
+ window.showErrorPopup(error);
}
}
diff --git a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/list-utils.js b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/list-utils.js
index c6cb3782a..b70e98228 100644
--- a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/list-utils.js
+++ b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/list-utils.js
@@ -2,18 +2,17 @@
function changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer, checkBoxIdSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids, allItemsCheckBoxId) {
try {
if(url === undefined || url === null) {
- logError("url ist undefined oder null");
return;
}
- var selectedItemOids = $("#" + popupId + " .popup-list-item-container input:checked").map(function () { return $(this).attr("id").split("-")[1]; }).get();
- var allItemOids = $("#" + popupId + " .popup-list-item-container input[type=checkbox]").map(function () { return $(this).attr("id").split("-")[1]; }).get();
+ const selectedItemOids = $(`#${popupId} .popup-list-item-container input:checked`).map(function () { return $(this).attr("id").split("-")[1]; }).get();
+ const allItemOids = $(`#${popupId} .popup-list-item-container input[type=checkbox]`).map(function () { return $(this).attr("id").split("-")[1]; }).get();
if(!isCustomer) {
- $("#my-teams-checkbox" + allItemsCheckBoxSuffix).prop("checked", arrayContainsAllItems(selectedItemOids, teamMemberOids));
+ $(`#my-teams-checkbox${allItemsCheckBoxSuffix}`).prop("checked", arrayContainsAllItems(selectedItemOids, teamMemberOids));
}
- $("#" + allItemsCheckBoxId).prop("checked", arrayContainsAllItems(selectedItemOids, allItemOids));
+ $(`#${allItemsCheckBoxId}`).prop("checked", arrayContainsAllItems(selectedItemOids, allItemOids));
$.get(url, { oidString: selectedItemOids.toString() }).done(function (jsonResult) {
updateSelectedList(jsonResult, listId, itemIdPrefix, isCustomer, popupId, checkBoxIdSuffix, url, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids);
@@ -21,7 +20,7 @@ function changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer,
$("#one-day-scheduler-partial-container").load(filterAppointmentsUrl);
});
} catch(error) {
- showErrorPopup(error);
+ window.showErrorPopup(error);
}
}
@@ -34,9 +33,9 @@ function updateSelectedList(jsonResult, listId, itemIdPrefix, isCustomer, popupI
return;
}
- var listItems = parseJason(jsonResult);
+ const listItems = parseJason(jsonResult);
- var list = $("#" + listId);
+ var list = $(`#${listId}`);
list.empty();
var colorClass = "text-bewo-employee";
@@ -54,41 +53,24 @@ function updateSelectedList(jsonResult, listId, itemIdPrefix, isCustomer, popupI
oid = item.EmployeeOid;
}
- var id = itemIdPrefix + oid;
+ const id = itemIdPrefix + oid;
- var removeParams = oid + ", '" + checkBoxIdSuffix + "', " + isCustomer + ", '" + url + "', '" + popupId + "', '" + listId + "', '" + itemIdPrefix + "', '" + filterAppointmentsUrl + "', '" + allItemsCheckBoxSuffix + "', " + teamMemberOids;
+ const removeParams = oid + ", '" + checkBoxIdSuffix + "', " + isCustomer + ", '" + url + "', '" + popupId + "', '" + listId + "', '" + itemIdPrefix + "', '" + filterAppointmentsUrl + "', '" + allItemsCheckBoxSuffix + "', " + teamMemberOids;
- var html =
- "";
+ const html = ``;
list.append(html);
});
} catch(error) {
- showErrorPopup(error);
+ window.showErrorPopup(error);
}
}
function removeSelectedItem(itemOid, itemSuffix, isCustomer, url, popupId, listId, itemIdPrefix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids, allItemsCheckBoxId) {
try {
- var prefix = isCustomer ? "customer-" : "employee-";
+ const prefix = isCustomer ? "customer-" : "employee-";
- var checkBox = $("#" + prefix + itemOid + itemSuffix);
+ const checkBox = $("#" + prefix + itemOid + itemSuffix);
if(checkBox.length) {
checkBox.prop("checked", false);
@@ -96,6 +78,6 @@ function removeSelectedItem(itemOid, itemSuffix, isCustomer, url, popupId, listI
changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer, itemSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids, allItemsCheckBoxId);
} catch(error) {
- showErrorPopup(error);
+ window.showErrorPopup(error);
}
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/service-record-time-calc.js b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/service-record-time-calc.js
index e8b37850e..4dcc56622 100644
--- a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/service-record-time-calc.js
+++ b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/utils/service-record-time-calc.js
@@ -1,10 +1,10 @@
function calculateTimeWithDuration(timeInputValue, timeElement, startDate, duration, hoursMinutesDropdownBtnId) {
var isInMin = getIsZeiterfassungseinheitInMinutes();
- var hoursToMinutes = parseTimeInputToIntegerArray(timeInputValue);
- var hours = parseInt(hoursToMinutes[0]);
- var minutes = parseInt(hoursToMinutes[1]);
- var stdMinDropdown = $("#" + hoursMinutesDropdownBtnId);
+ const hoursToMinutes = parseTimeInputToIntegerArray(timeInputValue);
+ const hours = parseInt(hoursToMinutes[0]);
+ const minutes = parseInt(hoursToMinutes[1]);
+ const stdMinDropdown = $(`#${hoursMinutesDropdownBtnId}`);
startDate.hours(hours);
startDate.minutes(minutes);
@@ -13,7 +13,7 @@
isInMin = stdMinDropdown.text().replaceAll(/\s/g, "") === "Minuten";
}
- var durationFormat = isInMin ? "m" : "h";
+ const durationFormat = isInMin ? "m" : "h";
startDate.add(duration, durationFormat);
@@ -26,10 +26,10 @@ function onDurationChange(startTimeId, endTimeId, startDateId, endDateId, durati
try {
var isInMin = getIsZeiterfassungseinheitInMinutes();
- var startTime = $("#" + startTimeId).val();
- var endTime = $("#" + endTimeId).val();
- var duration = $("#" + durationId).val();
- var hoursMinutesDropdownButton = $("#" + hoursMinutesDropdownBtnId);
+ var startTime = $(`#${startTimeId}`).val();
+ var endTime = $(`#${endTimeId}`).val();
+ var duration = $(`#${durationId}`).val();
+ var hoursMinutesDropdownButton = $(`#${hoursMinutesDropdownBtnId}`);
var startTimeCondition = startTime !== undefined && startTime !== null && startTime.length > 0;
var endTimeCondition = endTime !== undefined && endTime !== null && endTime.length > 0;
@@ -40,7 +40,7 @@ function onDurationChange(startTimeId, endTimeId, startDateId, endDateId, durati
return;
}
- var startDateString = $("#" + startDatePickerId).datetimepicker("date");
+ var startDateString = $(`#${startDatePickerId}`).datetimepicker("date");
var endDate = moment(new Date());
var startDate = moment(new Date());
@@ -49,8 +49,8 @@ function onDurationChange(startTimeId, endTimeId, startDateId, endDateId, durati
endDate = startDate.clone();
}
- if($("#" + endDatePickerId).length !== 0) {
- var endDateString = $("#" + endDatePickerId).datetimepicker("date");
+ if($(`#${endDatePickerId}`).length !== 0) {
+ var endDateString = $(`#${endDatePickerId}`).datetimepicker("date");
endDate = moment(endDateString);
}
@@ -68,19 +68,19 @@ function onDurationChange(startTimeId, endTimeId, startDateId, endDateId, durati
startDate = startDate.hours(h2m[0]).minutes(h2m[1]);
endDate = startDate.clone().add(durationNumber, durationFormat);
- $("#" + endTimeId).val(endDate.format("HH:mm"));
- $("#" + endDateId).val(endDate.format("DD.MM.yyyy"));
+ $(`#${endTimeId}`).val(endDate.format("HH:mm"));
+ $(`#${endDateId}`).val(endDate.format("DD.MM.yyyy"));
} else {
h2m = parseTimeInputToIntegerArray(endTime);
endDate = endDate.hours(h2m[0]).minutes(h2m[1]);
startDate = endDate.clone().add(durationNumber * -1, durationFormat);
- $("#" + startTimeId).val(startDate.format("HH:mm"));
- $("#" + startDateId).val(startDate.format("DD.MM.yyyy"));
+ $(`#${startTimeId}`).val(startDate.format("HH:mm"));
+ $(`#${startDateId}`).val(startDate.format("DD.MM.yyyy"));
}
} catch(error) {
- showErrorPopup(error);
+ window.showErrorPopup(error);
}
}
@@ -94,7 +94,7 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
var isInMin = getIsZeiterfassungseinheitInMinutes();
- if (hoursMinutesDropdownButton.length) {
+ if(hoursMinutesDropdownButton.length) {
isInMin = hoursMinutesDropdownButton.text().replaceAll(/\s/g, "") === "Minuten";
}
@@ -122,8 +122,8 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
}
// Es gibt ein Enddatumsfeld
- if($("#" + endDatePickerId).length !== 0) {
- var endDateString = $("#" + endDatePickerId).datetimepicker("date");
+ if($(`#${endDatePickerId}`).length !== 0) {
+ var endDateString = $(`#${endDatePickerId}`).datetimepicker("date");
// Das Enddatum hat einen Wert
if(endDateString !== null && endDateString.length !== 0) {
endDate = moment(endDateString);
@@ -147,48 +147,45 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
if(durationNumber > 0 && isInvokedByStartElement && startDate >= endDate) {
endDate = startDate.clone().add(durationNumber, durationFormat);
- $("#" + endTimeId).val(endDate.format("HH:mm"));
- $("#" + endDatePickerId).val(endDate.format("DD.MM.yyyy"));
+ $(`#${endTimeId}`).val(endDate.format("HH:mm"));
+ $(`#${endDatePickerId}`).val(endDate.format("DD.MM.yyyy"));
momentDuration = moment.duration(endDate.diff(startDate));
}
- if (durationNumber > 0 && isInvokedByEndElement && startDate >= endDate) {
+ if(durationNumber > 0 && isInvokedByEndElement && startDate >= endDate) {
startDate = endDate.clone().subtract(durationNumber, durationFormat);
- $("#" + startTimeId).val(startDate.format("HH:mm"));
- $("#" + startDatePickerId).val(startDate.format("DD.MM.yyyy"));
+ $(`#${startTimeId}`).val(startDate.format("HH:mm"));
+ $(`#${startDatePickerId}`).val(startDate.format("DD.MM.yyyy"));
momentDuration = moment.duration(endDate.diff(startDate));
}
newDurationValue = isInMin ? momentDuration.asMinutes() : momentDuration.asHours();
- $("#" + durationId).val(newDurationValue);
+ $(`#${durationId}`).val(newDurationValue);
// Startdatum und Dauer sind vorhanden
} else if(isStartTimeValid && isDurationValid) {
- if (isInvocatedByHoursMinutesButton) {
+ if(isInvocatedByHoursMinutesButton) {
durationNumber = isInMin ? durationNumber *= 60 : durationNumber /= 60;
- $("#" + durationId).val(durationNumber);
+ $(`#${durationId}`).val(durationNumber);
}
- calculateTimeWithDuration(startTime, $("#" + endTimeId), startDate, durationNumber, hoursMinutesDropdownBtnId);
+ calculateTimeWithDuration(startTime, $(`#${endTimeId}`), startDate, durationNumber, hoursMinutesDropdownBtnId);
// Enddatum und Dauer sind vorhanden
} else if(isEndTimeValid && isDurationValid) {
- if (isInvocatedByHoursMinutesButton) {
+ if(isInvocatedByHoursMinutesButton) {
durationNumber = isInMin ? durationNumber *= 60 : durationNumber /= 60;
- $("#" + durationId).val(durationNumber);
+ $(`#${durationId}`).val(durationNumber);
}
- calculateTimeWithDuration(endTime, $("#" + startTimeId), startDate, durationNumber * -1, hoursMinutesDropdownBtnId);
- } else if (isInvocatedByHoursMinutesButton) {
+ calculateTimeWithDuration(endTime, $(`#${startTimeId}`), startDate, durationNumber * -1, hoursMinutesDropdownBtnId);
+ } else if(isInvocatedByHoursMinutesButton) {
// Wurde von Min zu Std oder Std zu Min
- if (isInvocatedByHoursMinutesButton && isDurationValid) {
- // Das jetzige Format ist das Gegenteil des vorherigen
- // Ist es jetzt Minuten, war es vorher Stunden; es muss also mit 60 multipliziert werden.
- // Ist es jetzt Stunden, war es vorher Minuten; es muss also durch 60 geteilt werden.
+ if(isInvocatedByHoursMinutesButton && isDurationValid) {
durationNumber = isInMin ? durationNumber * 60 : durationNumber / 60;
- $("#" + durationId).val(durationNumber);
+ $(`#${durationId}`).val(durationNumber);
}
}
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js
index 445de2572..34b2f3be6 100644
--- a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js
+++ b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js
@@ -224,7 +224,7 @@ function validateForm(form, prefix) {
$("#srv-doku5").val(doku5);
$("#srv-distance").val($(`#${prefix}distance`).val());
$("#srv-form-id").val(form.attr("id"));
- $("#srv-marker").val($(`${prefix}marker-cb`).val());
+ $("#srv-marker").val($(`#${prefix}marker-cb`).is(":checked") ? "on" : "off");
$("#srv-service-description").val($(`#${prefix}leistung-select`).find(":selected").val());
$("#srv-duration").val($(`#${prefix}duration`).val());
$("#srv-betrag").val($("#betrag").val());
diff --git a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/scheduler.js b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/scheduler.js
index 4de59135c..eade6ac9b 100644
--- a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/scheduler.js
+++ b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/scheduler.js
@@ -1,8 +1,6 @@
-
-
-function submitInsertAppointmentForm() {
+function submitInsertAppointmentForm() {
showSpinner();
- validateAppointmentForm();
+ window.validateAppointmentForm();
}
function submitSchedulerDateForm() {
@@ -10,205 +8,19 @@ function submitSchedulerDateForm() {
$("#scheduler-date-form").submit();
}
-function validateAppointmentForm() {
- var isAllDay = $("#IsAllDay").prop("checked") === true;
-
-
- var startTimePicker = $("#scheduler-start-time-picker");
- var startDatePicker = $("#scheduler-start-date-picker");
- var endTimePicker = $("#scheduler-end-time-picker");
- var endDatePicker = $("#scheduler-end-date-picker");
-
- var isStartTimeInputEmpty = isAllDay ? false : isEmptyOrSpaces($("#scheduler-start-time").val());
- var isEndTimeInputEmpty = isAllDay ? false : isEmptyOrSpaces($("#scheduler-end-time").val());
- var isStartDateInputEmpty = isEmptyOrSpaces($("#scheduler-start-date").val());
- var isEndDateInputEmpty = isEmptyOrSpaces($("#scheduler-end-date").val());
-
- startTimePicker.datetimepicker("show");
- startTimePicker.datetimepicker("hide");
-
- startDatePicker.datetimepicker("show");
- startDatePicker.datetimepicker("hide");
-
- endTimePicker.datetimepicker("show");
- endTimePicker.datetimepicker("hide");
-
- endDatePicker.datetimepicker("show");
- endDatePicker.datetimepicker("hide");
-
- var startTime = startTimePicker.datetimepicker("date");
- var endTime = endTimePicker.datetimepicker("date");
- var startDate = startDatePicker.datetimepicker("date");
- var endDate = endDatePicker.datetimepicker("date");
-
- var a = startDate === undefined || startDate === null || !startDate.isValid();
- var b = endDate === undefined || endDate === null || !endDate.isValid();
- var c = isAllDay ? false : startTime === undefined || startTime === null || !startTime.isValid();
- var d = isAllDay ? false : endTime === undefined || endTime === null || !endTime.isValid();
-
- if (a || b || c || d || isStartDateInputEmpty || isStartTimeInputEmpty || isEndTimeInputEmpty || isEndDateInputEmpty) {
- hideSpinner();
-
- logInfo3("Datumsproblem!");
-
- showMessagePopupWithHtml("Fehler", 'Die Zeit- und/oder Datumsangaben sind nicht korrekt.
');
-
- $("#scheduler-start-time, #scheduler-end-time").val("");
- return;
- }
-
- if(endDate.isValid() === false) {
- endDate = startDate.clone();
- }
-
- var startHours = 0;
- var startMinutes = 0;
- var endHours = 0;
- var endMinutes = 0;
-
- if(isAllDay === false) {
- startHours = startTime.hours();
- startMinutes = startTime.minutes();
- endHours = endTime.hours();
- endMinutes = endTime.minutes();
- }
-
- startDate = startDate.hours(startHours);
- startDate = startDate.minutes(startMinutes);
-
- endDate = endDate.hours(endHours);
- endDate = endDate.minutes(endMinutes);
-
- if(endDate.isBefore(startDate)) {
- hideSpinner();
- showMessagePopupWithHtml("Fehler", 'Das Startdatum muss vor dem Enddatum liegen.
');
- return;
- }
-
- var selectedOids = [];
- var oidString = "";
-
- $("#resources-popup input:checked").each(function() {
- var id = $(this).attr("id");
- 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, allDay: isAllDay }).done(function(result) {
- if (result.length > 1) {
- try {
- 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);
- }
-
- // ALT!
- //var unavailableResources = parseJason(result);
- //var resourceCount = 0;
- //var names = "";
-
- //$.each(unavailableResources, function(index, resource) {
- // if (names.length > 1) {
- // names += ", ";
- // }
-
- // resourceCount++;
-
- // names += resource.Name;
- //});
-
- //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() {
- // $("#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);
-
- // return;
- //}
- } 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"));
- }
- });
-}
-
-function insertOrUpdateAppointment(formattedStartDate, formattedEndDate, formattedStartTime, formattedEndTime) {
- $.get(
- getCheckForOverlappingAppointmentsUrl(),
- {
- startDateRaw: formattedStartDate,
- endDateRaw: formattedEndDate,
- startTimeRaw: formattedStartTime,
- endTimeRaw: formattedEndTime
- }
- ).done(function(result) {
- if(false === checkJson(result)) {
- logWarning("insertOrUpdateAppointment: Der zurückgegebene Wert ist kein gültiges JSON!");
- return;
- }
-
- var isOverlapping = parseJason(result);
-
- if(isOverlapping === true) {
- hideSpinner();
- $("#messagePopup .modal-body").html('Dieser Termin überschneidet sich mit einem anderen bereits existierenden Termin.
Möchten Sie ihn wirklich speichern?
');
- showMessagePopupWithCallback(
- "Überschneidung",
- null,
- function() {
- $("#messagePopup .modal-body").html();
- showSpinner();
- $("#insert-appointment-form").submit();
- },
- false);
- } else {
- $("#insert-appointment-form").submit();
- }
- });
-}
-
function hideAppointmentForm() {
$("#form-container").addClass("d-none d-sm-none");
}
function showAppointmentForm() {
$("#form-container").removeClass("d-none d-sm-none");
- calcPrependTextSizes();
+ window.calcPrependTextSizes();
}
function toggleAppointmentForm() {
- var isVisible = $("#form-container").css("display") === "block";
+ const isVisible = $("#form-container").css("display") === "block";
- if (isVisible) {
+ if(isVisible) {
hideAppointmentForm();
} else {
showAppointmentForm();
@@ -217,33 +29,33 @@ function toggleAppointmentForm() {
function listSearchOnChange(searchInputId, entryClass, textClass) {
try {
- var text = $("#" + searchInputId).val().toLowerCase();
+ var text = $(`#${searchInputId}`).val().toLowerCase();
- var entries = $("." + entryClass);
+ const entries = $(`.${entryClass}`);
- if (text.length === 0) {
+ if(text.length === 0) {
entries.show();
}
- $.each(entries, function (index, item) {
- var customer = $(item);
+ $.each(entries, function(index, item) {
+ const customer = $(item);
- if (customer.find("." + textClass).text().toLowerCase().includes(text)) {
+ if(customer.find(`.${textClass}`).text().toLowerCase().includes(text)) {
customer.show();
} else {
customer.hide();
}
});
- } catch (error) {
- showErrorPopup(error);
+ } catch(error) {
+ window.showErrorPopup(error);
}
}
function resetSearch(searchInputId, entryClass) {
try {
- $("#" + searchInputId).val("");
- $("." + entryClass).show();
+ $(`#${searchInputId}`).val("");
+ $(`.${entryClass}`).show();
} catch (error) {
- showErrorPopup(error);
+ window.showErrorPopup(error);
}
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Util/AppointmentListItem.cs b/BeWoPlanerMobil/Util/AppointmentListItem.cs
index dbf2aa9a4..13e83b48d 100644
--- a/BeWoPlanerMobil/Util/AppointmentListItem.cs
+++ b/BeWoPlanerMobil/Util/AppointmentListItem.cs
@@ -178,6 +178,11 @@ namespace BeWoPlanerMobil.Util
schedulerAppointment.ResourceList.DoForEach(resource => { ResourceListInfo += $"{resource.Name}; "; });
ResourceListInfo = ResourceListInfo.Trim(' ').Trim(';');
+
+ if(IsTask && schedulerAppointment.SupportConceptList.Any())
+ {
+ CustomerListInfo = schedulerAppointment.SupportConceptList.First().CustomerName;
+ }
}
private static string GetHexColorValueForCss(string argbHexColorValue)
diff --git a/BeWoPlanerMobil/Util/FormCollectionConstants.cs b/BeWoPlanerMobil/Util/FormCollectionConstants.cs
index 665a3fbbf..c2cd30953 100644
--- a/BeWoPlanerMobil/Util/FormCollectionConstants.cs
+++ b/BeWoPlanerMobil/Util/FormCollectionConstants.cs
@@ -29,6 +29,9 @@
public static string MarkerKey => "marker-cb";
public static string FormIdKey => "form-id";
public static string BetragKey => "betrag";
+ public static string ServiceRecordSignatureBlobKey => "service-record-signature-blob";
+ public static string ServiceRecordSignatureDateKey => "service-record-signature-date";
+ public static string ServiceRecordSignatureRecordOidKey => "service-record-signature-record-oid";
// Kalender
public static string AppointmentStartDateKey => "StartDate";
@@ -79,5 +82,6 @@
public static string DoLogoutKey => "DoLogout";
public static string ReportErrorMessageKey => "ReportErrorMessage";
public static string ErrorAlertPopupMessage => "ErrorAlertPopupMessage";
+ public static string InfoMessageKey => "InfoMessage";
}
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Util/MobileUtils.cs b/BeWoPlanerMobil/Util/MobileUtils.cs
index 6fc584e80..3655ba1fe 100644
--- a/BeWoPlanerMobil/Util/MobileUtils.cs
+++ b/BeWoPlanerMobil/Util/MobileUtils.cs
@@ -448,8 +448,11 @@ namespace BeWoPlanerMobil.Util
{
try
{
- var isSuccessfulStartDate = DateTime.TryParseExact(start, "dd.MM.yyyy HH:mm", null, DateTimeStyles.None, out var startDate);
- var isSuccessfulEndDate = DateTime.TryParseExact(end, "dd.MM.yyyy HH:mm", null, DateTimeStyles.None, out var endDate);
+ //var isSuccessfulStartDate = DateTime.TryParseExact(start, "dd.MM.yyyy HH:mm", null, DateTimeStyles.None, out var startDate);
+ //var isSuccessfulEndDate = DateTime.TryParseExact(end, "dd.MM.yyyy HH:mm", null, DateTimeStyles.None, out var endDate);
+
+ var isSuccessfulStartDate = DateTime.TryParse(start, out var startDate);
+ var isSuccessfulEndDate = DateTime.TryParse(end, out var endDate);
if(isSuccessfulStartDate && isSuccessfulEndDate)
{
@@ -477,7 +480,7 @@ namespace BeWoPlanerMobil.Util
foreach(var par in paragraphs)
{
- stringBuilder.AppendLine("");
+ stringBuilder.AppendLine($"
");
var p = par.Replace(Environment.NewLine, "
\r\n");
if(nofollow)
diff --git a/BeWoPlanerMobil/Views/Customer/DocumentPartial.cshtml b/BeWoPlanerMobil/Views/Customer/DocumentPartial.cshtml
index 0c0971e65..ce2351254 100644
--- a/BeWoPlanerMobil/Views/Customer/DocumentPartial.cshtml
+++ b/BeWoPlanerMobil/Views/Customer/DocumentPartial.cshtml
@@ -3,7 +3,7 @@
@using BS.Shared.DataContracts
@model CustomerModel
-
@{
@@ -261,241 +272,265 @@