diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index 82f38c36a..1a2ce855a 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -675,6 +675,7 @@ + diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index b2911ebe8..b525780bd 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -1308,17 +1308,18 @@ namespace BeWoPlanerMobil.Controllers appointmentPrototype = MapperFactory.SchedulerAppointmentDCSchedulerAppointment.MapToNewDC(app); } - var marker = "on" == collection[FormCollectionConstants.MarkerKey]; - string doku1; + var d1 = collection[FormCollectionConstants.Dokumentation1Key]; + var d2 = collection[FormCollectionConstants.Dokumentation2Key]; + var d3 = collection[FormCollectionConstants.Dokumentation3Key]; + var d4 = collection[FormCollectionConstants.Dokumentation4Key]; + var d5 = collection[FormCollectionConstants.Dokumentation5Key]; + var d6 = collection[FormCollectionConstants.Dokumentation6Key]; - if(Model.Dokutypes != null && Model.Dokutypes.Length > 0) - { - doku1 = collection[FormCollectionConstants.Dokumentation1Key]; - } - else - { - doku1 = collection[FormCollectionConstants.Dokumentation6Key]; - } + var marker = "on" == collection[FormCollectionConstants.MarkerKey]; + + var doku1 = Model.Dokutypes?.Length > 0 ? + collection[FormCollectionConstants.Dokumentation1Key] : + collection[FormCollectionConstants.Dokumentation6Key]; decimal? betrag = null; var betragAsString = collection[FormCollectionConstants.BetragKey]?.Replace('.', ','); @@ -5105,6 +5106,44 @@ namespace BeWoPlanerMobil.Controllers return LeerzeichenFuerGetMethoden; } + + [Authorize] + [HttpPost] + public ActionResult RestoreServiceRecordForm(FormCollection formCollection) + { + // Neuen ServiceRecord bauen, als wenn der Nutzer das normal gemacht hätte? + // Geht das auch bei Gruppen- und Mehrfachbuchungen? Ja, siehe Bearbeiten! + + var dateInputValue = formCollection[FormCollectionConstants.DateKey]; + var startTimeInputValue = formCollection[FormCollectionConstants.StartKey]; + var endTimeInputValue = formCollection[FormCollectionConstants.EndKey]; + var endDateInputValue = formCollection[FormCollectionConstants.EndDateKey]; + var doku1 = formCollection[FormCollectionConstants.Dokumentation1Key]; + var doku2 = formCollection[FormCollectionConstants.Dokumentation2Key]; + var doku3 = formCollection[FormCollectionConstants.Dokumentation3Key]; + var doku4 = formCollection[FormCollectionConstants.Dokumentation4Key]; + var doku5 = formCollection[FormCollectionConstants.Dokumentation5Key]; + var doku6 = formCollection[FormCollectionConstants.Dokumentation6Key]; + var distanceInputValue = formCollection[FormCollectionConstants.DistanceKey]; + var markerInputValue = formCollection[FormCollectionConstants.MarkerKey]; + var serviceDescriptionOidInputValue = formCollection[FormCollectionConstants.ServiceDescriptionKey]; + var durationInputValue = formCollection[FormCollectionConstants.DurationKey]; + var betragInputValue = formCollection[FormCollectionConstants.BetragKey]; + var selectedGroupBookingCb2ScOidsInputValue = formCollection[FormCollectionConstants.GroupBookingSelectedCb2ScOidsKey]; + var selectedMultiBookingCb2ScOidsInputValue = formCollection[FormCollectionConstants.MultiBookingSelectedCb2ScOidsKey]; + var selectedSingleBookingEmployeeOidInputValue = formCollection[FormCollectionConstants.SingleBookingEmployeeOidKey]; + var selectedGroupBookingEmployeeOidsInputValue = formCollection[FormCollectionConstants.GroupBookingSelectedEmployeeOidsKey]; + var selectedMultiBookingEmployeeOidsInputValue = formCollection[FormCollectionConstants.MultiBookingSelectedEmployeeOidsKey]; + var selectedGoalOidsInputValue = formCollection[FormCollectionConstants.SelectedGoalOids]; + + DateTime.TryParse(dateInputValue, out var date); + DateTime.TryParse(endDateInputValue, out var endDate); + decimal.TryParse(distanceInputValue, out var distance); + + TempData[TempDataConstants.AfterRestoreKey] = true; + + return View("Main", Model); + } } public class ServiceRecord2Monatsunterschrift diff --git a/BeWoPlanerMobil/Controllers/SchedulerController.cs b/BeWoPlanerMobil/Controllers/SchedulerController.cs index 4cb90f93e..f43d57cf4 100644 --- a/BeWoPlanerMobil/Controllers/SchedulerController.cs +++ b/BeWoPlanerMobil/Controllers/SchedulerController.cs @@ -527,7 +527,7 @@ namespace BeWoPlanerMobil.Controllers var rawSchedulerDate = formCollection[FormCollectionConstants.AppointmentSchedulerDateKey]; - var schedulerDate = DateTime.ParseExact(rawSchedulerDate, "dd.MM.yyyy", null); + var schedulerDate = DateTime.ParseExact(rawSchedulerDate, "yyyy-MM-dd", null); Model.SelectedDate = schedulerDate; diff --git a/BeWoPlanerMobil/Models/MainModel.cs b/BeWoPlanerMobil/Models/MainModel.cs index 3610906be..5f58abc99 100644 --- a/BeWoPlanerMobil/Models/MainModel.cs +++ b/BeWoPlanerMobil/Models/MainModel.cs @@ -841,6 +841,19 @@ namespace BeWoPlanerMobil.Models return SelectedServiceDescription; } + public BookingMode CurrentBookingMode + { + get + { + if(IsInGroupBookingMode) + { + return BookingMode.GroupBookingMode; + } + + return IsInMultiBookingMode ? BookingMode.MultiBookingMode : BookingMode.SingleBookingMode; + } + } + } diff --git a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/signature.js b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/signature.js index 534fd64c1..d43611854 100644 --- a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/signature.js +++ b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/signature.js @@ -11,7 +11,7 @@ function updateCanvasSize(canvasJQueryElement) { const rowWidth = canvasJQueryElement.parent().parent().innerWidth(); - const sourceCanvas = document.getElementById(canvasJQueryElement.attr("id")); + const sourceCanvas = document.getElementById(canvasJQueryElement.prop("id")); const canvasWidth = sourceCanvas.scrollWidth; @@ -22,13 +22,13 @@ function updateCanvasSize(canvasJQueryElement) { let isMinDifferenceMet = false; - if (parsedCanvasWidth > parsedNewWidth) { + if(parsedCanvasWidth > parsedNewWidth) { isMinDifferenceMet = parsedCanvasWidth - parsedNewWidth > 4; } else { isMinDifferenceMet = parsedNewWidth - parsedCanvasWidth > 4; } - if (isMinDifferenceMet) { + if(isMinDifferenceMet) { var trimmedCanvas = trimCanvas(cloneCanvas(sourceCanvas)); var canvasContext = sourceCanvas.getContext("2d", { willReadFrequently: true }); @@ -39,10 +39,10 @@ function updateCanvasSize(canvasJQueryElement) { return; } - var img = new Image; + var img = new Image(); img.onload = function () { - if (trimmedCanvas.width > parsedNewWidth) { + if(trimmedCanvas.width > parsedNewWidth) { const factor = trimmedCanvas.height / trimmedCanvas.width; const newHeight = parsedNewWidth * factor; diff --git a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js index f27b11e50..3b8a3b232 100644 --- a/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js +++ b/BeWoPlanerMobil/Scripts/ownSoft-Scripts/view-scripts/main.js @@ -1,16 +1,22 @@ function selectSupportConcept(cb2ScOid) { showSpinner(); - $("#CostBearer2SupportConceptOid").val(cb2ScOid); + + $("#sb-cb2ScRelOid").val(cb2ScOid); + window.saveItemValueLocally(document.getElementById("sb-cb2ScRelOid")); + $("#selectSupportConceptForm").submit(); } function setSelectedEmployee() { const employeeOid = parseInt($("#employeesDropDown").find(":selected").val()); - if (isNaN(employeeOid)) { + if(isNaN(employeeOid)) { return; } + $("#sb-employee-input").val(employeeOid); + window.saveItemValueLocally($("#sb-employee-input").val()); + $.get(window.getSetServiceRecordEmployeeUrl(), { employeeOid: employeeOid }); } @@ -67,9 +73,9 @@ function toggleGroupBookingForm() { function changeMultiBookingFormEnableState(enableState) { $( - "#multi-booking-employees-button, " + - "#category-select, " + - "#leistung-select, " + + "#mb-employees-button, " + + "#mb-category-select, " + + "#mb-leistung-select, " + "#mb-start-date-input, " + "#mb-end-date-input, " + "#mb-start-time-input, " + @@ -82,15 +88,15 @@ function changeMultiBookingFormEnableState(enableState) { "#mb-betrag," + "#mb-textbausteine-btn, " + "#mb-hours-minutes-dropdown-btn, " + - "#mb-marker-cb, " + - ".bewo-restore-btn").prop("disabled", enableState); + "#mb-marker-cb" + ).prop("disabled", enableState); } function changeGroupBookingFormEnableState(enableState) { $( "#employees-button, " + - "#category-select, " + - "#leistung-select, " + + "#gb-category-select, " + + "#gb-leistung-select, " + "#gb-start-date-input, " + "#gb-end-date-input, " + "#gb-start-time-input, " + @@ -103,16 +109,15 @@ function changeGroupBookingFormEnableState(enableState) { "#gb-textbausteine-btn, " + "#gb-hours-minutes-dropdown-btn, " + "#gb-marker-cb, " + - "#gb-betrag, " + - ".bewo-restore-btn" + "#gb-betrag" ).prop("disabled", enableState); } function changeSingleBookingFormEnableState(enableState) { $( "#employeesDropDown, " + - "#category-select, " + - "#leistung-select, " + + "#sb-category-select, " + + "#sb-leistung-select, " + "#sb-start-date-input, " + "#sb-end-date-input, " + "#sb-start-time-input, " + @@ -128,8 +133,7 @@ function changeSingleBookingFormEnableState(enableState) { "#statistics-button, " + "#timeFrameSelect, " + "#sb-marker-cb, " + - "#sb-betrag, " + - ".bewo-restore-btn" + "#sb-betrag" ).prop("disabled", enableState); } @@ -213,7 +217,7 @@ function validateForm(form, prefix) { if(isNoticeMandatory) { if(numberOfNoticeTextareas === 0) { - var doku = $(`#${prefix}-dokufeld-textarea`).val(); + var doku = $(`#${prefix}-doku-textarea`).val(); if(doku === undefined || doku === null) { doku = ""; @@ -291,7 +295,9 @@ function validateForm(form, prefix) { $("#srv-service-description").val($(`#${prefix}-leistung-select`).find(":selected").val()); $("#srv-duration").val($(`#${prefix}-duration-input`).val()); $("#srv-betrag").val($(`#${prefix}-betrag`).val()); - + + // ToDo: Hier lokal speichern? + showSpinner(); $("#service-record-validation-form").submit(); } @@ -301,7 +307,7 @@ function getDokuTexte(prefix) { const noticeList = [null, null, null, null, null]; try { - const hasMultipleDokufelder = $(`#${prefix}-dokufeld-textarea`).length === 0; + const hasMultipleDokufelder = $(`#${prefix}-doku-textarea`).length === 0; let dokufeldCounter = 0; @@ -315,7 +321,7 @@ function getDokuTexte(prefix) { } } } else { - noticeList[0] = $(`#${prefix}-dokufeld-textarea`).val(); + noticeList[0] = $(`#${prefix}-doku-textarea`).val(); dokufeldCounter = 1; } @@ -351,8 +357,6 @@ function hideGoalRatingPopup() { } } - - function checkChildNodes(parentOid) { const rootElement = $(`#c-${parentOid}`); const checkboxes = rootElement.find("input"); @@ -369,10 +373,6 @@ function checkChildNodes(parentOid) { }); } - - - - function validateDistanceInput() { checkNumberInput("distance"); } @@ -434,7 +434,6 @@ function validateStartAndEndInputs(startDateInput, startTimeInput, endDateInput, return [combineDateAndTime(startDate, startTime), combineDateAndTime(endDate, endTime)]; } - function supportConceptSearchOnChange() { try { var text = $("#support-concept-search-input").val().toLowerCase(); diff --git a/BeWoPlanerMobil/Util/FormCollectionConstants.cs b/BeWoPlanerMobil/Util/FormCollectionConstants.cs index 69cbaca95..4c88ddf31 100644 --- a/BeWoPlanerMobil/Util/FormCollectionConstants.cs +++ b/BeWoPlanerMobil/Util/FormCollectionConstants.cs @@ -32,6 +32,15 @@ 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"; + public static string GroupBookingSelectedCb2ScOidsKey => "service-record-group-booking-cb2sc-oids"; + public static string GroupBookingSelectedEmployeeOidsKey => "service-record-group-booking-employee-oids"; + public static string MultiBookingSelectedCb2ScOidsKey => "service-record-multi-booking-cb2sc-oids"; + public static string MultiBookingSelectedEmployeeOidsKey => "service-record-multi-booking-employee-oids"; + public static string SingleBookingEmployeeOidKey => "service-record-single-booking-employee-oid"; + public static string SelectedGoalOids => "service-record-selected-goal-oids"; + public static string GroupBookingSelectedGroupOidsKey => "service-record-group-booking-employee-oids"; + public static string MultiBookingSelectedGroupOidsKey => "service-record-multi-booking-employee-oids"; + // Kalender public static string AppointmentStartDateKey => "StartDate"; @@ -84,5 +93,7 @@ public static string InfoMessageKey => "InfoMessage"; public static string ReportMessageKey => "ReportMessage"; public static string AppointmentOidKey => "AppointmentOid"; + public static string AfterRestoreKey => "AfterRestore"; + public static string SaveSupportConceptDependenciesKey => "SaveSupportConceptDependencies"; } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Main/Category2ServiceDescriptionPartial.cshtml b/BeWoPlanerMobil/Views/Main/Category2ServiceDescriptionPartial.cshtml index a420ff17c..f19446770 100644 --- a/BeWoPlanerMobil/Views/Main/Category2ServiceDescriptionPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/Category2ServiceDescriptionPartial.cshtml @@ -1,4 +1,5 @@ @using BeWoPlanerMobil.Util +@using BS.Shared @model BeWoPlanerMobil.Models.MainModel @{ @@ -10,6 +11,26 @@ } + + var selectedServiceDescription = Model.GetSelectedOrFirstServiceDescription(); + var selectedCategory = selectedServiceDescription?.Category; + + var bookingMode = Model.CurrentBookingMode; + + string prefix; + + switch(bookingMode) + { + case BookingMode.GroupBookingMode: + prefix = "gb"; + break; + case BookingMode.MultiBookingMode: + prefix = "mb"; + break; + default: + prefix = "sb"; + break; + } } -@{ - var selectedServiceDescription = Model.GetSelectedOrFirstServiceDescription(); - var selectedCategory = selectedServiceDescription?.Category; -} +
@@ -45,17 +69,17 @@ Kategorie
- @foreach(var serviceCategory2ServiceDescriptions in Model.Categories2Descriptions) - { - var category = serviceCategory2ServiceDescriptions.Key; + { + var category = serviceCategory2ServiceDescriptions.Key; - if(category is null) - { - continue; - } + if(category is null) + { + continue; + } - var selected = selectedCategory != null && selectedCategory.Equals(category) ? " selected" : string.Empty; + var selected = selectedCategory != null && selectedCategory.Equals(category) ? " selected" : string.Empty; } @@ -75,7 +99,7 @@ Leistung - @if(selectedCategory != null && Model.Categories2Descriptions.ContainsKey(selectedCategory)) { foreach(var serviceDescription in Model.Categories2Descriptions[selectedCategory]) diff --git a/BeWoPlanerMobil/Views/Main/GoalTreePartial.cshtml b/BeWoPlanerMobil/Views/Main/GoalTreePartial.cshtml index 4c1438c08..075ade629 100644 --- a/BeWoPlanerMobil/Views/Main/GoalTreePartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/GoalTreePartial.cshtml @@ -32,18 +32,18 @@ $(".goal-card, .goal-text").hide(); - var goalLabels = $(".goal-name-label"); + const goalLabels = $(".goal-name-label"); $.each(goalLabels, function (index, item) { - var label = $(item); + const label = $(item); - var goalText = $.trim(label.text()); + const goalText = $.trim(label.text()); if (false === goalText.toLowerCase().includes(text)) { return; } - var parents = label.parents(".goal-card, .goal-text"); + const parents = label.parents(".goal-card, .goal-text"); parents.show(); }); } catch(error) { @@ -55,9 +55,9 @@ try { $("#goal-search-input").val(""); - var entries = $(".goal-text"); - var treeCard = $(".goal-card"); - var collapsable = treeCard.find(".collapse"); + const entries = $(".goal-text"); + const treeCard = $(".goal-card"); + const collapsable = treeCard.find(".collapse"); entries.show(); treeCard.show(); @@ -70,14 +70,14 @@ function getCheckedGoals() { try { - var rootElement = $("#goals-tree"); - var checkboxes = rootElement.find("input"); + const rootElement = $("#goals-tree"); + const checkboxes = rootElement.find("input"); var selectedGoals = ""; $.each(checkboxes, function(index, checkbox) { - var box = $(checkbox); - var id = box.attr("id").split("-")[2]; + const box = $(checkbox); + const id = box.attr("id").split("-")[2]; if(box.prop("checked") === true && !id.includes("goal")) { selectedGoals += id + ";"; @@ -92,9 +92,9 @@ function updateSelectedGoals() { try { - var selectedGoals = getCheckedGoals(); + const selectedGoals = getCheckedGoals(); - $.get("@Url.Action("UpdateGoals")", {pGoalOids: selectedGoals}, function (numberOfSelectedGoals) { + $.get("@Url.Action("UpdateGoals")", {pGoalOids: selectedGoals}, function (numberOfSelectedGoals) { $("#goals-button").html(`Ziele ${numberOfSelectedGoals}`); }); } catch(error) { @@ -128,11 +128,6 @@ } -@* - ToDo für Montag, 15.07.2024: Bis 30 Ziele/Maßnahmen standardmäßig alles ausklappen, ansonsten einklappen - ToDo: Alles/Nichts auswählen implementieren -*@ - @helper BuildGoalTreeBranch(GoalTreeItem goalTreeItem) { var collapseClass = Model.GoalTree.Count <= 30 ? "collapse show" : "collapse"; diff --git a/BeWoPlanerMobil/Views/Main/GroupBookingFormPartial.cshtml b/BeWoPlanerMobil/Views/Main/GroupBookingFormPartial.cshtml index 8f2a16604..f31c69117 100644 --- a/BeWoPlanerMobil/Views/Main/GroupBookingFormPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/GroupBookingFormPartial.cshtml @@ -19,16 +19,18 @@ var selectedGroups = []; var selectedSupportConcepts = []; - $("#group-booking-supportconcepts input:checked").each(function () { + $("#gb-supportconcepts input:checked").each(function () { selectedSupportConcepts.push($(this).attr("value")); }); - $("#group-booking-groups input:checked").each(function () { + $("#gb-groups input:checked").each(function () { selectedGroups.push($(this).attr("value")); }); - $("#group-booking-sc-cb-rel-tab-content").load("@Url.Action("AddScCbRelsToGroupBooking")", {relOids: selectedSupportConcepts, groupOids: selectedGroups}, function() { - $("#groupbooking-selection-container").load("@Url.Action("ReloadGroupBookingForm")", function () { + updateLocallyStoredGroupBookingCb2ScRelOids(); + + $("#gb-sc-cb-rel-tab-content").load("@Url.Action("AddScCbRelsToGroupBooking")", {relOids: selectedSupportConcepts, groupOids: selectedGroups}, function() { + $("#gb-selection-container").load("@Url.Action("ReloadGroupBookingForm")", function () { toggleGroupBookingForm(); $("#goals-tree").load("@Url.Action("ReloadGoals")", function() { @@ -39,9 +41,11 @@ } function removeSupportConceptCostBearerRel(relOid) { - $(`#cb2sc-checkbox-${relOid}`).prop("checked", false); + $(`#gb-cb2sc-checkbox-${relOid}`).prop("checked", false); - $("#groupbooking-selection-container").load("@Url.Action("RemoveSupportConceptCostbearerRel")", {relOid: relOid} + updateLocallyStoredGroupBookingCb2ScRelOids(); + + $("#gb-selection-container").load("@Url.Action("RemoveSupportConceptCostbearerRel")", {relOid: relOid} , function () { $("#goals-tree").load("@Url.Action("ReloadGoals")" , function () { @@ -50,7 +54,28 @@ $("#tree").load("@Url.Action("LoadUpToDateTextModules")"); }); }); - } + } + + function updateLocallyStoredGroupBookingCb2ScRelOids() { + let cb2ScOidString = ""; + const storage = window.getBeWoStorage(); + $("#gb-supportconcepts input:checked").each(function () { + cb2ScOidString += `${$(this).attr("value")},`; + }); + + storage.updateGroupBookingSelectedCb2ScRelOids(cb2ScOidString.slice(0, -1)); + } + + function updateLocallyStoredGroupOids() { + let groupOidString = ""; + const storage = window.getBeWoStorage(); + + $("#gb-supportconcepts input:checked").each(function () { + groupOidString += `${$(this).attr("value")},`; + }); + + storage.updateGroupBookingSelectedGroupOids(groupOidString.slice(0, -1)); + } @if(Model != null) @@ -85,7 +110,7 @@ @* Hilfepläne und Mitarbeiter *@ -
+
@Html.Partial("GroupBookingSelectionPartial", Model)
@@ -301,26 +326,27 @@
} -
- - - @if(Model.IsInTransferMode) - { - using(Html.BeginForm("ResetTransferMode", "Main", FormMethod.Post)) - { - - } - } - else - { - using(Html.BeginForm("ResetEditingMode", "Main", FormMethod.Post)) - { - - } - } +
+ - @**@ -
+ @if(Model.IsInTransferMode) + { + using(Html.BeginForm("ResetTransferMode", "Main", FormMethod.Post)) + { + + } + } + else + { + using(Html.BeginForm("ResetEditingMode", "Main", FormMethod.Post)) + { + + } + } + + @if(Html.IsInDebugMode()) + { + @Html.Partial("RestoreServiceRecordInputsPartial", Model) + } +
} \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Main/GroupBookingPartial.cshtml b/BeWoPlanerMobil/Views/Main/GroupBookingPartial.cshtml index 089a52782..68bc68b3a 100644 --- a/BeWoPlanerMobil/Views/Main/GroupBookingPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/GroupBookingPartial.cshtml @@ -53,7 +53,7 @@ var oidString = ""; - $("#group-booking-employee-selection-popup input:checked").each(function() { + $("#gb-employee-selection-popup input:checked").each(function() { const oid = $(this).val(); selectedEmployees.push(oid); @@ -67,6 +67,9 @@ } } + const storage = window.getBeWoStorage(); + storage.updateGroupBookingSelectedEmployeeOids(oidString); + $.get("@Url.Action("AddEmployeesToGroupBooking")", { pEmployeeOids: oidString }).done(function(numberOfSelectedEmployees) { $("#selected-employees-count-badge").text(numberOfSelectedEmployees); @@ -101,10 +104,10 @@ @* ----- (Gruppenbuchung) Mitarbeiterauswahl Popup ----- *@ - diff --git a/BeWoPlanerMobil/Views/Main/GroupBookingScCbRelList.cshtml b/BeWoPlanerMobil/Views/Main/GroupBookingScCbRelList.cshtml index d54562a15..f6c26cbc0 100644 --- a/BeWoPlanerMobil/Views/Main/GroupBookingScCbRelList.cshtml +++ b/BeWoPlanerMobil/Views/Main/GroupBookingScCbRelList.cshtml @@ -12,7 +12,7 @@ } } -
+
    @foreach(var cb2Sc in Model.SupportConceptListObjectsForGroupBooking) { @@ -20,16 +20,14 @@ @{ var timeSpanColorClass2 = cb2Sc.IsAboutToExpire ? "text-bewo-is-about-to-expire" : cb2Sc.ExpiresInThreeMonthsOrLess ? "text-bewo-expires-in-three-months" : "text-dark"; - var checkedValue = Model.GroupBookingSelectedCostBearerSupportConceptOids.Any(a => a == cb2Sc.CostBearer2SupportConceptOid); - }
    -
-
+
    @foreach(var group in Model.GroupOfPeopleListItems) { diff --git a/BeWoPlanerMobil/Views/Main/GroupBookingSelectionPartial.cshtml b/BeWoPlanerMobil/Views/Main/GroupBookingSelectionPartial.cshtml index c401995bd..46866dbb3 100644 --- a/BeWoPlanerMobil/Views/Main/GroupBookingSelectionPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/GroupBookingSelectionPartial.cshtml @@ -57,7 +57,7 @@
    -
    diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index c13f46adc..3d82b8554 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -133,7 +133,7 @@ } - const supportConceptOid = parseInt($("#CostBearer2SupportConceptOid").val()); + const supportConceptOid = parseInt($("#sb-cb2ScRelOid").val()); const isSupportConceptSelected = supportConceptOid !== -1; @@ -196,9 +196,18 @@ @if(TempData[TempDataConstants.AppointmentOidKey] is long && false == Model.IsInGroupBookingMode && false == Model.IsInMultiBookingMode) { - loadServiceRecords(); + loadServiceRecords(); } + + + + + // ToDo: Falls ein Hilfeplan im Einzelbuchungsformular ausgewählt ist, auch die davon abhängigen Dinge lokal speichern + + if("@Model.CurrentBookingMode".toLowerCase() === "0") { + alert("EINZELBUCHUNGSMODUS"); + } } catch(error) { window.showErrorPopup(error); } diff --git a/BeWoPlanerMobil/Views/Main/MultiBookingFormPartial.cshtml b/BeWoPlanerMobil/Views/Main/MultiBookingFormPartial.cshtml index 3916ca3ef..3faa0c224 100644 --- a/BeWoPlanerMobil/Views/Main/MultiBookingFormPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/MultiBookingFormPartial.cshtml @@ -18,15 +18,15 @@ var selectedGroups = []; var selectedSupportConcepts = []; - $("#multi-booking-supportconcepts input:checked").each(function () { + $("#mb-supportconcepts input:checked").each(function () { selectedSupportConcepts.push($(this).attr("value")); }); - $("#multi-booking-groups input:checked").each(function () { + $("#mb-groups input:checked").each(function () { selectedGroups.push($(this).attr("value")); }); - $("#multi-booking-sc-cb-rel-tab-content").load("@Url.Action("AddScCbRelsToMultiBooking")", {relOids: selectedSupportConcepts, groupOids: selectedGroups}, function() { + $("#mb-sc-cb-rel-tab-content").load("@Url.Action("AddScCbRelsToMultiBooking")", {relOids: selectedSupportConcepts, groupOids: selectedGroups}, function() { $("#multibooking-selection-container").load("@Url.Action("ReloadMultiBookingForm")", function () { changeMultiBookingFormEnableState($(".mb-cb2sc-input:checkbox:checked").length > 0 ? false : true); @@ -49,6 +49,28 @@ ); } ); + } + + function updateLocallyStoredMultiBookingCb2ScRelOids() { + let cb2ScOidString = ""; + const storage = window.getBeWoStorage(); + + $("#mb-supportconcepts input:checked").each(function () { + cb2ScOidString += `${$(this).attr("value")},`; + }); + + storage.updateGroupBookingSelectedCb2ScRelOids(cb2ScOidString.slice(0, -1)); + } + + function updateLocallyStoredMultiBookingGroupOids() { + let groupOidString = ""; + const storage = window.getBeWoStorage(); + + $("#mb-supportconcepts input:checked").each(function () { + groupOidString += `${$(this).attr("value")},`; + }); + + storage.updateGroupBookingSelectedGroupOids(groupOidString.slice(0, -1)); } @@ -284,16 +306,17 @@
    } -
    - +
    + - @using(Html.BeginForm("ResetMultiBookingForm", "Main", FormMethod.Post)) - { - - } - - @**@ -
    + @using(Html.BeginForm("ResetMultiBookingForm", "Main", FormMethod.Post)) + { + + } + + @if(Html.IsInDebugMode()) + { + @Html.Partial("RestoreServiceRecordInputsPartial", Model) + } +
    } \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Main/MultiBookingPartial.cshtml b/BeWoPlanerMobil/Views/Main/MultiBookingPartial.cshtml index 5dcb8e666..05a48d2e4 100644 --- a/BeWoPlanerMobil/Views/Main/MultiBookingPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/MultiBookingPartial.cshtml @@ -44,7 +44,7 @@ let oidString = ""; - $("#multi-booking-employee-selection-popup input:checked").each(function() { + $("#mb-employee-selection-popup input:checked").each(function() { selectedEmployees.push($(this).val()); }); @@ -56,10 +56,13 @@ } } - $.get("@Url.Action("AddEmployeesToMultiBooking")", { pEmployeeOids: oidString }).done(function(numberOfSelectedEmployees) { - $("#multi-booking-selected-employees-count-badge").text(numberOfSelectedEmployees); + const storage = window.getBeWoStorage(); + storage.updateMultiBookingSelectedEmployeeOids(oidString); - $("#multi-booking-create-button").prop("disabled", numberOfSelectedEmployees === "0" ? true : false); + $.get("@Url.Action("AddEmployeesToMultiBooking")", { pEmployeeOids: oidString }).done(function(numberOfSelectedEmployees) { + $("#mb-selected-employees-count-badge").text(numberOfSelectedEmployees); + + $("#mb-create-btn").prop("disabled", numberOfSelectedEmployees === "0" ? true : false); }); } @@ -112,7 +115,7 @@
    @* (Mehrfachbuchung) Hilfeplan- und Gruppenauswahl Popup *@ -