Doku geht wieder im MoK

This commit is contained in:
2025-08-08 13:45:37 +02:00
parent f2361f0d54
commit e7752b0677
22 changed files with 722 additions and 360 deletions

View File

@@ -675,6 +675,7 @@
<Content Include="Views\DevTools\DevToolsSettingsPartial.cshtml" />
<Content Include="Views\DevTools\DevToolsUserRightsPartial.cshtml" />
<Content Include="Views\DevTools\DevToolsDataGenerationPartial.cshtml" />
<Content Include="Views\Main\RestoreServiceRecordInputsPartial.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />

View File

@@ -1300,17 +1300,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('.', ',');
@@ -5097,6 +5098,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

View File

@@ -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;

View File

@@ -841,6 +841,19 @@ namespace BeWoPlanerMobil.Models
return SelectedServiceDescription;
}
public BookingMode CurrentBookingMode
{
get
{
if(IsInGroupBookingMode)
{
return BookingMode.GroupBookingMode;
}
return IsInMultiBookingMode ? BookingMode.MultiBookingMode : BookingMode.SingleBookingMode;
}
}
}

View File

@@ -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;

View File

@@ -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();

View File

@@ -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";
}
}

View File

@@ -1,4 +1,5 @@
@using BeWoPlanerMobil.Util
@using BS.Shared
@model BeWoPlanerMobil.Models.MainModel
@{
@@ -10,6 +11,26 @@
</script>
</text>
}
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;
}
}
<script type="text/javascript">
@@ -18,7 +39,7 @@
}
function setSelectedServiceCategory() {
const selectedCategoryOid = $("#category-select").find(":selected").val();
const selectedCategoryOid = $("#@prefix-category-select").find(":selected").val();
$("#category-to-description-container").load("@Url.Action("SetSelectedServiceCategory")", {categoryOidStr: selectedCategoryOid}, function() {
$("#tree").load("@Url.Action("LoadUpToDateTextModules")");
@@ -26,14 +47,17 @@
}
$(document).ready(function() {
window.calcPrependWidth();
window.calcPrependWidth();
window.addEventListener("load", function() {
$("#@prefix-category-select, #@prefix-leistung-select").on("change", function() {
saveItemValueLocally(this);
});
});
});
</script>
@{
var selectedServiceDescription = Model.GetSelectedOrFirstServiceDescription();
var selectedCategory = selectedServiceDescription?.Category;
}
<!-- Kategorie -->
<div class="form-row">
@@ -45,17 +69,17 @@
Kategorie
</div>
</div>
<select id="category-select" class="custom-select" onchange="setSelectedServiceCategory()">
<select id="@prefix-category-select" class="custom-select" onchange="setSelectedServiceCategory()">
@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;
<option value="@category.ServiceCategoryOid"@selected>@category.Name</option>
}
@@ -75,7 +99,7 @@
Leistung
</div>
</div>
<select class="custom-select" id="leistung-select" name="ServiceDescription" onchange="setServiceDescription('leistung-select')">
<select class="custom-select" id="@prefix-leistung-select" name="ServiceDescription" onchange="setServiceDescription('@prefix-leistung-select')">
@if(selectedCategory != null && Model.Categories2Descriptions.ContainsKey(selectedCategory))
{
foreach(var serviceDescription in Model.Categories2Descriptions[selectedCategory])

View File

@@ -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 <span class='badge badge-light text-primary'>${numberOfSelectedGoals}</span>`);
});
} catch(error) {
@@ -128,11 +128,6 @@
}
</script>
@*
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";

View File

@@ -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));
}
</script>
@if(Model != null)
@@ -85,7 +110,7 @@
</div>
</div>
@* Hilfepläne und Mitarbeiter *@
<div id="groupbooking-selection-container">
<div id="gb-selection-container">
@Html.Partial("GroupBookingSelectionPartial", Model)
</div>
@@ -301,26 +326,27 @@
</div>
}
<div class="w-100 mt-2">
<button type="button" class="btn btn-primary float-right ml-1" id="create-button" onclick="submitGroupBookingForm()">@submitButtonText</button>
@if(Model.IsInTransferMode)
{
using(Html.BeginForm("ResetTransferMode", "Main", FormMethod.Post))
{
<button type="submit" id="reset-button" class="btn btn-primary float-right" onclick="showSpinner()">Abbrechen</button>
}
}
else
{
using(Html.BeginForm("ResetEditingMode", "Main", FormMethod.Post))
{
<button type="submit" id="reset-button" class="btn btn-primary float-right" onclick="showSpinner()">Abbrechen</button>
}
}
<div class="w-100 mt-2">
<button type="button" class="btn btn-primary float-right ml-1" id="create-button" onclick="submitGroupBookingForm()">@submitButtonText</button>
@*<button type="button" class="btn btn-bewo-dev bewo-restore-btn" onclick="window.restoreAllFields()">
<i class="fas fa-recycle"></i>
</button>*@
</div>
@if(Model.IsInTransferMode)
{
using(Html.BeginForm("ResetTransferMode", "Main", FormMethod.Post))
{
<button type="submit" id="reset-button" class="btn btn-primary float-right" onclick="showSpinner()">Abbrechen</button>
}
}
else
{
using(Html.BeginForm("ResetEditingMode", "Main", FormMethod.Post))
{
<button type="submit" id="reset-button" class="btn btn-primary float-right" onclick="showSpinner()">Abbrechen</button>
}
}
@if(Html.IsInDebugMode())
{
@Html.Partial("RestoreServiceRecordInputsPartial", Model)
}
</div>
}

View File

@@ -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 @@
</div>
<div class="modal-body">
<nav class="nav nav-pills nav-fill">
<a class="nav-item nav-link active" href="#group-booking-supportconcepts" data-toggle="tab" role="tab">Hilfepläne</a>
<a class="nav-item nav-link" href="#group-booking-groups" data-toggle="tab" role="tab">Gruppen</a>
<a class="nav-item nav-link active" href="#gb-supportconcepts" data-toggle="tab" role="tab">Hilfepläne</a>
<a class="nav-item nav-link" href="#gb-groups" data-toggle="tab" role="tab">Gruppen</a>
</nav>
<div class="tab-content" id="group-booking-sc-cb-rel-tab-content">
<div class="tab-content" id="gb-sc-cb-rel-tab-content">
@Html.Partial("GroupBookingScCbRelList", Model)
</div>
</div>
@@ -113,7 +116,7 @@
</div>
@* ----- (Gruppenbuchung) Mitarbeiterauswahl Popup ----- *@
<div class="modal" tabindex="-1" role="dialog" id="group-booking-employee-selection-popup">
<div class="modal" tabindex="-1" role="dialog" id="gb-employee-selection-popup">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -131,16 +134,17 @@
</button>
</div>
</div>
<div id="gb-employee-selection-list">
@foreach(var employee in Model.EmployeesForGroupAndMultiBooking)
{
var checkedValue = Model.GroupBookingSelectedEmployees.Contains(employee) ? "checked=\"checked\"" : string.Empty;
@foreach(var employee in Model.EmployeesForGroupAndMultiBooking)
{
var checkedValue = Model.GroupBookingSelectedEmployees.Contains(employee) ? "checked=\"checked\"" : string.Empty;
<div class="custom-control custom-checkbox employee-text">
<input type="checkbox" @checkedValue class="custom-control-input" id="group-employee-@employee.EmployeeOid" onchange="addEmployeeToGroupBooking()" value="@employee.EmployeeOid" />
<label for="group-employee-@employee.EmployeeOid" class="custom-control-label employee-name-label">@employee.DetailDescription</label>
</div>
}
<div class="custom-control custom-checkbox employee-text">
<input type="checkbox" @checkedValue class="custom-control-input" id="group-employee-@employee.EmployeeOid" onchange="addEmployeeToGroupBooking()" value="@employee.EmployeeOid" />
<label for="group-employee-@employee.EmployeeOid" class="custom-control-label employee-name-label">@employee.DetailDescription</label>
</div>
}
</div>
</div>
</div>
</div>

View File

@@ -12,7 +12,7 @@
}
}
<div class="tab-pane show active" role="tabpanel" id="group-booking-supportconcepts">
<div class="tab-pane show active" role="tabpanel" id="gb-supportconcepts">
<ul class="list-group">
@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);
}
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox"
@{ if(checkedValue) { @Html.Raw("checked=\"checked\"") } }
class="custom-control-input cb2sc-input" id="cb2sc-checkbox-@cb2Sc.CostBearer2SupportConceptOid" onchange="addScCbRelsToGroupBooking()" name="cb2sc-checkbox-@cb2Sc.CostBearer2SupportConceptOid" value="@cb2Sc.CostBearer2SupportConceptOid">
<label for="cb2sc-checkbox-@cb2Sc.CostBearer2SupportConceptOid" class="custom-control-label">
class="custom-control-input cb2sc-input" id="gb-cb2sc-checkbox-@cb2Sc.CostBearer2SupportConceptOid" onchange="addScCbRelsToGroupBooking()" name="cb2sc-checkbox-@cb2Sc.CostBearer2SupportConceptOid" value="@cb2Sc.CostBearer2SupportConceptOid">
<label for="gb-cb2sc-checkbox-@cb2Sc.CostBearer2SupportConceptOid" class="custom-control-label">
<span class="justify-content-between mb-1 text-dark text-left">
@cb2Sc.NameAndDateOfBirth
</span>
@@ -43,7 +41,7 @@
}
</ul>
</div>
<div class="tab-pane show" role="tabpanel" id="group-booking-groups">
<div class="tab-pane show" role="tabpanel" id="gb-groups">
<ul class="list-group">
@foreach(var group in Model.GroupOfPeopleListItems)
{

View File

@@ -57,7 +57,7 @@
<div class="form-row">
<div class="col-md">
<div class="form-group my-0">
<button type="button" class="btn btn-bewo-employee btn-block mt-2" data-toggle="modal" data-target="#group-booking-employee-selection-popup" id="employees-button">
<button type="button" class="btn btn-bewo-employee btn-block mt-2" data-toggle="modal" data-target="#gb-employee-selection-popup" id="employees-button">
Mitarbeiter hinzufügen <span class="badge badge-light text-primary" id="selected-employees-count-badge">@Model.GroupBookingSelectedEmployees.Count</span>
</button>
</div>

View File

@@ -133,7 +133,7 @@
</text>
}
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)
{
<text>
loadServiceRecords();
loadServiceRecords();
</text>
}
// 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);
}

View File

@@ -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));
}
</script>
@@ -284,16 +306,17 @@
</div>
}
<div class="w-100 mt-2">
<button type="button" class="btn btn-primary float-right ml-1" id="mb-create-btn" onclick="window.submitMultiBookingForm()">Anlegen</button>
<div class="w-100 mt-2">
<button type="button" class="btn btn-primary float-right ml-1" id="mb-create-btn" onclick="window.submitMultiBookingForm()">Anlegen</button>
@using(Html.BeginForm("ResetMultiBookingForm", "Main", FormMethod.Post))
{
<button type="submit" id="mb-reset-btn" class="btn btn-primary float-right" onclick="showSpinner()">Abbrechen</button>
}
@*<button type="button" class="btn btn-bewo-dev bewo-restore-btn" onclick="window.restoreAllFields()">
<i class="fas fa-recycle"></i>
</button>*@
</div>
@using(Html.BeginForm("ResetMultiBookingForm", "Main", FormMethod.Post))
{
<button type="submit" id="mb-reset-btn" class="btn btn-primary float-right" onclick="showSpinner()">Abbrechen</button>
}
@if(Html.IsInDebugMode())
{
@Html.Partial("RestoreServiceRecordInputsPartial", Model)
}
</div>
}

View File

@@ -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 @@
</div>
@* (Mehrfachbuchung) Hilfeplan- und Gruppenauswahl Popup *@
<div class="modal" data-backdrop="static" tabindex="-1" role="dialog" id="multi-booking-popup">
<div class="modal" data-backdrop="static" tabindex="-1" role="dialog" id="mb-sc-cb-rel-popup">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -123,10 +126,10 @@
</div>
<div class="modal-body">
<nav class="nav nav-pills nav-fill">
<a class="nav-item nav-link active" href="#multi-booking-supportconcepts" data-toggle="tab" role="tab">Hilfepläne</a>
<a class="nav-item nav-link" href="#multi-booking-groups" data-toggle="tab" role="tab">Gruppen</a>
<a class="nav-item nav-link active" href="#mb-supportconcepts" data-toggle="tab" role="tab">Hilfepläne</a>
<a class="nav-item nav-link" href="#mb-groups" data-toggle="tab" role="tab">Gruppen</a>
</nav>
<div class="tab-content" id="multi-booking-sc-cb-rel-tab-content">
<div class="tab-content" id="mb-sc-cb-rel-tab-content">
@Html.Partial("MultiBookingScCbRelList", Model)
</div>
</div>
@@ -135,7 +138,7 @@
</div>
@* (Mehrfachbuchung) Mitarbeiterauswahl Popup *@
<div class="modal" tabindex="-1" role="dialog" id="multi-booking-employee-selection-popup">
<div class="modal" tabindex="-1" role="dialog" id="mb-employee-selection-popup">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -153,16 +156,17 @@
</button>
</div>
</div>
<div id="mb-employee-selection-list">
@foreach(var employee in Model.EmployeesForGroupAndMultiBooking)
{
var checkedValue = Model.GroupBookingSelectedEmployees.Contains(employee) ? "checked=\"checked\"" : string.Empty;
@foreach(var employee in Model.EmployeesForGroupAndMultiBooking)
{
var checkedValue = Model.GroupBookingSelectedEmployees.Contains(employee) ? "checked=\"checked\"" : string.Empty;
<div class="custom-control custom-checkbox employee-text">
<input type="checkbox" @checkedValue class="custom-control-input" id="multi-employee-@employee.EmployeeOid" onchange="addEmployeeToMultiBooking()" value="@employee.EmployeeOid" />
<label for="multi-employee-@employee.EmployeeOid" class="custom-control-label employee-name-label">@employee.DetailDescription</label>
</div>
}
<div class="custom-control custom-checkbox employee-text">
<input type="checkbox" @checkedValue class="custom-control-input" id="mb-employee-@employee.EmployeeOid" onchange="addEmployeeToMultiBooking()" value="@employee.EmployeeOid" />
<label for="mb-employee-@employee.EmployeeOid" class="custom-control-label employee-name-label">@employee.DetailDescription</label>
</div>
}
</div>
</div>
</div>
</div>

View File

@@ -12,7 +12,7 @@
}
}
<div class="tab-pane show active" role="tabpanel" id="multi-booking-supportconcepts">
<div class="tab-pane show active" role="tabpanel" id="mb-supportconcepts">
<ul class="list-group">
@foreach(var cb2Sc in Model.SupportConceptListObjectsForGroupBooking)
{
@@ -41,7 +41,7 @@
}
</ul>
</div>
<div class="tab-pane show" role="tabpanel" id="multi-booking-groups">
<div class="tab-pane show" role="tabpanel" id="mb-groups">
<ul class="list-group">
@foreach(var group in Model.GroupOfPeopleListItems)
{

View File

@@ -15,7 +15,7 @@
@* (Mehrfachbuchung) Hilfeplanauswahl-Button *@
<div class="form-row">
<div class="col-md">
<button type="button" class="btn btn-bewo-task-red btn-block" data-toggle="modal" data-target="#multi-booking-popup" id="support-concepts-and-groups-button">Hilfepläne und Gruppen hinzufügen</button>
<button type="button" class="btn btn-bewo-task-red btn-block" data-toggle="modal" data-target="#mb-sc-cb-rel-popup" id="support-concepts-and-groups-button">Hilfepläne und Gruppen hinzufügen</button>
</div>
</div>
@@ -57,8 +57,8 @@
<div class="form-row">
<div class="col-md">
<div class="form-group my-0">
<button type="button" class="btn btn-bewo-employee btn-block mt-2" data-toggle="modal" data-target="#multi-booking-employee-selection-popup" id="multi-booking-employees-button">
Mitarbeiter hinzufügen <span class="badge badge-light text-primary" id="multi-booking-selected-employees-count-badge">@Model.GroupBookingSelectedEmployees.Count</span>
<button type="button" class="btn btn-bewo-employee btn-block mt-2" data-toggle="modal" data-target="#mb-employee-selection-popup" id="mb-employees-button">
Mitarbeiter hinzufügen <span class="badge badge-light text-primary" id="mb-selected-employees-count-badge">@Model.GroupBookingSelectedEmployees.Count</span>
</button>
</div>
</div>

View File

@@ -0,0 +1,390 @@
@using BeWoPlanerMobil.Service
@using BeWoPlanerMobil.Util
@model BeWoPlanerMobil.Models.MainModel
@*
ToDo: Bei Hilfeplan schauen, ob die Ziele/Maßnahmen, Kategorie/Leistung, Textbausteines korrekt sind.
*@
@if(TempData[TempDataConstants.AfterRestoreKey] is bool and true)
{
<text>
<script type="text/javascript">
</script>
</text>
}
<script type="text/javascript">
class LocalBeWoStorage {
id;
inputList;
groupBookingCb2ScRelOids;
multiBookingCb2ScRelOids;
groupBookingGroupOids;
multiBookingGroupOids;
groupBookingEmployeeOids;
multiBookingEmployeeOids;
constructor(id, inputList) {
this.id = id;
this.inputList = inputList;
this.groupBookingCb2ScRelOids = [];
this.groupBookingGroupOids = [];
this.groupBookingEmployeeOids = [];
this.multiBookingCb2ScRelOids = [];
this.multiBookingGroupOids = [];
this.multiBookingEmployeeOids = [];
}
clearInputList() {
if (this.inputList === null || this.inputList === undefined) {
this.inputList = [];
}
this.inputList.length = 0;
localStorage.setItem(this.id, JSON.stringify(this));
}
removeItemById(id) {
const newInputList = [];
for (let i = 0; i < this.inputList.length; i++) {
const input = this.inputList[i];
if (input.inputId !== id) {
newInputList.push(input);
}
}
this.inputList = newInputList;
localStorage.setItem(this.id, JSON.stringify(this));
}
removeItemByName(name) {
const newInputList = [];
for (let i = 0; i < this.inputList.length; i++) {
const input = this.inputList[i];
if (input.inputName !== name) {
newInputList.push(input);
}
}
this.inputList = newInputList;
localStorage.setItem(this.id, JSON.stringify(this));
}
addInputValue(inputId, inputName, inputType, inputValue, timeStamp) {
if (inputType === "radio") {
this.removeItemByName(inputName);
}
const obj = {
inputId: inputId,
inputName: inputName,
inputType: inputType,
inputValue: inputValue,
timeStamp: timeStamp
};
this.removeItemById(inputId);
this.inputList.push(obj);
localStorage.setItem(this.id, JSON.stringify(this));
}
getItemById(id) {
const item = this.inputList.find((element) => element.inputId === id);
return item;
}
getItemsByName(name) {
const result = [];
this.inputList.map((item) => {
if (item.inputName === name) {
result.push(item);
}
});
return result;
}
updateGroupBookingSelectedCb2ScRelOids(commaSeparatedOidString) {
if(commaSeparatedOidString === null || commaSeparatedOidString === undefined) {
commaSeparatedOidString = "";
}
const strArr = commaSeparatedOidString.split(",");
for(let i = 0; i < strArr.length; i++) {
if($.isNumeric(strArr[i])) {
this.groupBookingCb2ScRelOids.push(parseInt(strArr[i]));
}
}
localStorage.setItem(this.id, JSON.stringify(this));
}
updateGroupBookingSelectedGroupOids(commaSeparatedOidString) {
if(commaSeparatedOidString === null || commaSeparatedOidString === undefined) {
commaSeparatedOidString = "";
}
const strArr = commaSeparatedOidString.split(",");
for(let i = 0; i < strArr.length; i++) {
if($.isNumeric(strArr[i])) {
this.groupBookingGroupOids.push(parseInt(strArr[i]));
}
}
localStorage.setItem(this.id, JSON.stringify(this));
}
getGroupBookingSelectedCb2ScRelOids() {
return this.groupBookingCb2ScRelOids;
}
getGroupBookingSelectedGroupOids() {
return this.groupBookingGroupOids;
}
updateGroupBookingSelectedEmployeeOids(commaSeparatedOidString) {
if(commaSeparatedOidString === null || commaSeparatedOidString === undefined) {
commaSeparatedOidString = "";
}
const strArr = commaSeparatedOidString.split(",");
for(let i = 0; i < strArr.length; i++) {
if($.isNumeric(strArr[i])) {
this.groupBookingEmployeeOids.push(parseInt(strArr[i]));
}
}
localStorage.setItem(this.id, JSON.stringify(this));
}
getMultiBookingSelectedCb2ScRelOids() {
return this.multiBookingCb2ScRelOids;
}
getMultiBookingSelectedGroupOids() {
return this.multiBookingGroupOids;
}
updateMultiBookingSelectedCb2ScRelOids(commaSeparatedOidString) {
if(commaSeparatedOidString === null || commaSeparatedOidString === undefined) {
commaSeparatedOidString = "";
}
const strArr = commaSeparatedOidString.split(",");
for(let i = 0; i < strArr.length; i++) {
if($.isNumeric(strArr[i])) {
this.multiBookingCb2ScRelOids.push(parseInt(strArr[i]));
}
}
localStorage.setItem(this.id, JSON.stringify(this));
}
updateMultiBookingSelectedGroupOids(commaSeparatedOidString) {
if(commaSeparatedOidString === null || commaSeparatedOidString === undefined) {
commaSeparatedOidString = "";
}
const strArr = commaSeparatedOidString.split(",");
for(let i = 0; i < strArr.length; i++) {
if($.isNumeric(strArr[i])) {
this.multiBookingGroupOids.push(parseInt(strArr[i]));
}
}
localStorage.setItem(this.id, JSON.stringify(this));
}
updateMultiBookingSelectedEmployeeOids(commaSeparatedOidString) {
if(commaSeparatedOidString === null || commaSeparatedOidString === undefined) {
commaSeparatedOidString = "";
}
const strArr = commaSeparatedOidString.split(",");
for(let i = 0; i < strArr.length; i++) {
if($.isNumeric(strArr[i])) {
this.multiBookingEmployeeOids.push(parseInt(strArr[i]));
}
}
localStorage.setItem(this.id, JSON.stringify(this));
}
}
function getLocalStorageKey() {
return "@MobileSessionFacade.LocalStorageKey";
}
function getBeWoStorage() {
const localStorageKey = getLocalStorageKey();
const unparsedLocalStorageJson = localStorage.getItem(localStorageKey);
let beWoStorage = new LocalBeWoStorage(localStorageKey, []);
if(unparsedLocalStorageJson === null || unparsedLocalStorageJson === undefined || unparsedLocalStorageJson.length === 0) {
localStorage.setItem(localStorageKey, JSON.stringify(beWoStorage));
} else {
const parsedJson = JSON.parse(unparsedLocalStorageJson);
beWoStorage = new LocalBeWoStorage(localStorageKey, parsedJson.inputList);
}
return beWoStorage;
}
function clearLocalBeWoStorage() {
const beWoStorage = getBeWoStorage();
beWoStorage.clearInputList();
}
function getRestoreButtonState() {
const beWoStorage = getBeWoStorage();
return beWoStorage.inputList.length > 0;
}
window.addEventListener("load", function() {
$(".booking-form-container, #goals-tree").find("textarea, select, input").on("change", function() { saveItemValueLocally(this); });
$("#IsInGroupBookingMode, #IsInMultiBookingMode").on("change", function() { saveItemValueLocally(this); });
});
function restoreField(id) {
const beWoStorage = getBeWoStorage();
const inputObj = beWoStorage.getItemById(id);
if(inputObj === undefined || inputObj === null) {
return;
}
$(`#${id}`).val(inputObj.inputValue);
$(`#${id}`).trigger("change");
}
function saveItemValueLocally(htmlElement) {
const item = $(htmlElement);
const id = item.attr("id");
const type = item.prop("type");
const value = type === "checkbox" ? item.is(":checked").toString() : item.val();
if((value === null || value === undefined) || value.length === 0) {
return;
}
const name = item.prop("name");
const beWoStorage = getBeWoStorage();
beWoStorage.addInputValue(id, name, type, value, new Date());
toggleRestoreButton();
}
function restoreAllFields() {
const beWoStorage = getBeWoStorage();
$.each(beWoStorage.inputList, (index, item) => {
logInfo3(`Id: ${item.inputId}; Wert: ${item.inputValue};`);
});
// ToDo: die versteckten Felder ausfüllen und das Formular an den Server schicken, wo ein neues ServiceRecord-Objekt mithilfe des versteckten Formulars erzeugt wird.
$("#srr-gb-cb2sc-oids").val(beWoStorage.groupBookingCb2ScRelOids);
$("#srr-gb-group-oids").val(beWoStorage.groupBookingGroupOids);
$("#srr-gb-emp-oids").val(beWoStorage.groupBookingEmployeeOids);
$("#srr-mb-cb2sc-oids").val(beWoStorage.multiBookingCb2ScRelOids);
$("#srr-mb-group-oids").val(beWoStorage.multiBookingGroupOids);
$("#srr-mb-emp-oids").val(beWoStorage.multiBookingEmployeeOids);
$.each(beWoStorage.inputList, (index, item) => {
if (item.inputType === "checkbox") {
$(`#${item.inputId}`).prop("checked", item.inputValue);
} else {
$(`#${item.inputId}`).val(item.inputValue);
}
let inputId = item.inputId;
if(item.inputId.startsWith("sb-") || item.inputId.startsWith("gb-") || item.inputId.startsWith("mb-")) {
inputId = item.inputId.slice(3);
}
if(inputId === "doku-textarea") {
inputId += "-6";
}
logInfo(`Id: ${inputId}; Wert: ${item.inputValue};`);
//$(`#srr-${inputId}`).val(item.inputValue);
//$(`#${item.inputId}`).trigger("change");
});
$("#restore-service-record-form").submit();
}
$(window).ready(function() {
const sbDate = $("#sb-start-date-input").val();
const gbDate = $("#gb-start-date-input").val();
const mbDate = $("#mb-start-date-input").val();
logInfo(`Einzelbuchung: ${sbDate}\r\nGruppenbuchung: ${gbDate}\r\nMehrfachbuchung: ${mbDate}`);
});
</script>
@using(Html.BeginForm("RestoreServiceRecordForm", "Main", FormMethod.Post, new {id="restore-service-record-form"}))
{
<input type="hidden" id="srr-start-time-input" name="@FormCollectionConstants.DateKey" />
<input type="hidden" id="srr-end-time-input" name="@FormCollectionConstants.EndKey" />
<input type="hidden" id="srr-start-date-input" name="@FormCollectionConstants.StartKey" />
<input type="hidden" id="srr-end-date-input" name="@FormCollectionConstants.EndDateKey" />
<input type="hidden" id="srr-doku-textarea-1" name="@FormCollectionConstants.Dokumentation1Key" />
<input type="hidden" id="srr-doku-textarea-2" name="@FormCollectionConstants.Dokumentation2Key" />
<input type="hidden" id="srr-doku-textarea-3" name="@FormCollectionConstants.Dokumentation3Key" />
<input type="hidden" id="srr-doku-textarea-4" name="@FormCollectionConstants.Dokumentation4Key" />
<input type="hidden" id="srr-doku-textarea-5" name="@FormCollectionConstants.Dokumentation5Key" />
<input type="hidden" id="srr-doku-textarea-6" name="@FormCollectionConstants.Dokumentation6Key" />
<input type="hidden" id="srr-distance-input" name="@FormCollectionConstants.DistanceKey" />
<input type="hidden" id="srr-form-id" name="@FormCollectionConstants.FormIdKey" />
<input type="hidden" id="srr-marker-cb" name="@FormCollectionConstants.MarkerKey" />
<input type="hidden" id="srr-leistung-select" name="@FormCollectionConstants.ServiceDescriptionKey" />
<input type="hidden" id="srr-duration-input" name="@FormCollectionConstants.DurationKey" />
<input type="hidden" id="srr-betrag" name="@FormCollectionConstants.BetragKey" />
<input type="hidden" id="srr-sb-emp-oid" name="@FormCollectionConstants.SingleBookingEmployeeOidKey" />
<input type="hidden" id="srr-gb-cb2sc-oids" name="@FormCollectionConstants.GroupBookingSelectedCb2ScOidsKey" />
<input type="hidden" id="srr-gb-emp-oids" name="@FormCollectionConstants.GroupBookingSelectedEmployeeOidsKey" />
<input type="hidden" id="srr-gb-group-oids" name="@FormCollectionConstants.GroupBookingSelectedGroupOidsKey" />
<input type="hidden" id="srr-mb-cb2sc-oids" name="@FormCollectionConstants.MultiBookingSelectedCb2ScOidsKey" />
<input type="hidden" id="srr-mb-emp-oids" name="@FormCollectionConstants.MultiBookingSelectedEmployeeOidsKey" />
<input type="hidden" id="srr-mb-group-oids" name="@FormCollectionConstants.MultiBookingSelectedGroupOidsKey" />
<button type="button" class="btn btn-bewo-dev bewo-restore-btn" onclick="window.restoreAllFields()">
<i class="fas fa-recycle"></i>
</button>
}

View File

@@ -5,7 +5,7 @@
@model MainModel
@{
if(TempData[TempDataConstants.DoLogoutKey] is bool doLogout && doLogout)
if(TempData[TempDataConstants.DoLogoutKey] is bool and true)
{
<text>
<script type="text/javascript">
@@ -242,7 +242,7 @@
</div>
@* /Hilfeplanauswahlpopup *@
<input type="hidden" name="CostBearer2SupportConceptOid" id="CostBearer2SupportConceptOid" value="@Model.SelectedSupportConceptListObject.CostBearer2SupportConceptOid">
<input type="hidden" name="CostBearer2SupportConceptOid" id="sb-cb2ScRelOid" value="@Model.SelectedSupportConceptListObject.CostBearer2SupportConceptOid">
}
if(Model.IsCustomerAbsence)
@@ -264,6 +264,17 @@
<div class="col-md">
<div class="mt-2" id="single-booking-employee-container">
@Html.PopupWithSearchForIFilterables(Model.Employees, "setSelectedEmployeeForSingleBooking", null, Model.SelectedEmployee?.DetailDescription, "single-booking-employee-modal-popup", false)
@{
var sbEmployeeInputValue = string.Empty;
if(Model.SelectedEmployeeOid.HasValue)
{
sbEmployeeInputValue = $"value=\"{Model.SelectedEmployeeOid.Value}\"";
}
}
<input type="hidden" id="sb-employee-input" @sbEmployeeInputValue />
</div>
</div>
</div>
@@ -468,8 +479,8 @@
@if(Model.NumberOfDokuTypes == 0)
{
<div class="form-group my-0">
<label for="sb-dokufeld-textarea">Dokumentation</label>
<textarea class="form-control" autocomplete="on" style="overflow: scroll;" name="Dokumentation6" id="sb-dokufeld-textarea">@Model.NoticeToEdit</textarea>
<label for="sb-doku-textarea">Dokumentation</label>
<textarea class="form-control" autocomplete="on" style="overflow: scroll;" name="Dokumentation6" id="sb-doku-textarea">@Model.NoticeToEdit</textarea>
</div>
}
else
@@ -521,12 +532,13 @@
}
else
{
<button type="button" class="btn btn-primary float-right" id="reset-button" onclick="window.restoreAllFields(); resetSingleBookingForm();">Abbrechen</button>
}
<button type="button" class="btn btn-primary float-right" id="reset-button" onclick="resetSingleBookingForm();">Abbrechen</button>
}
@*<button type="button" class="btn btn-bewo-dev bewo-restore-btn" onclick="window.restoreAllFields()">
<i class="fas fa-recycle"></i>
</button>*@
@if(Html.IsInDebugMode())
{
@Html.Partial("RestoreServiceRecordInputsPartial", Model)
}
</div>
}
</div>

View File

@@ -130,7 +130,7 @@
<div class="col col-md-auto justify-content-center mx-1 px-0">
@using(Html.BeginForm("SelectSchedulerDate", "Scheduler", FormMethod.Post, new { id = "scheduler-date-form" }))
{
<input class="form-control" type="date" id="start-date" name="SchedulerDate" value="@Model.SelectedDate.ToString("yyyy-MM-dd")" />
<input class="form-control" type="date" id="start-date" name="SchedulerDate" onchange="submitSchedulerDateForm()" value="@Model.SelectedDate.ToString("yyyy-MM-dd")" />
}
</div>
<div class="col-auto justify-content-center mx-1 px-0">

View File

@@ -45,13 +45,11 @@
<script type="text/javascript" src="@Scripts.Url("~/Scripts/devexpress-dependencies/ace/ace.min.js")"></script>
<link type="text/css" rel="stylesheet" href="@Url.Content("~/Content/style.css")" />
<link type="text/css" rel="stylesheet" href="@Url.Content("~/Content/tempusdominus-bootstrap-4.min.css")" />
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/utils/dateUtils.js?v=1.3")"></script>
<script type="text/javascript" src="@Scripts.Url("~/Scripts/moment/moment.min.js")"></script>
<script type="text/javascript" src="@Scripts.Url("~/Scripts/moment/locale/de.js")"></script>
<script type="text/javascript" src="@Scripts.Url("~/Scripts/tempusdominus-boostrap-4.min.js")"></script>
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/mobileUtils.js?v=1.3")"></script>
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/view-scripts/main.js?v=1.5")"></script>
@@ -100,98 +98,6 @@
</style>
<script type="text/javascript">
class LocalBeWoStorage {
id;
inputList;
constructor(id, inputList) {
this.id = id;
this.inputList = inputList;
}
clearInputList() {
if(this.inputList === null || this.inputList === undefined) {
this.inputList = [];
}
this.inputList.length = 0;
localStorage.setItem(this.id, JSON.stringify(this));
}
removeItemById(id) {
const newInputList = [];
for(let i = 0; i < this.inputList.length; i++) {
const input = this.inputList[i];
if(input.inputId !== id) {
newInputList.push(input);
}
}
this.inputList = newInputList;
localStorage.setItem(this.id, JSON.stringify(this));
}
removeItemByName(name) {
const newInputList = [];
for(let i = 0; i < this.inputList.length; i++) {
const input = this.inputList[i];
if(input.inputName !== name) {
newInputList.push(input);
}
}
this.inputList = newInputList;
localStorage.setItem(this.id, JSON.stringify(this));
}
addInputValue(inputId, inputName, inputType, inputValue, timeStamp) {
if(inputType === "radio") {
this.removeItemByName(inputName);
}
const obj = {
inputId: inputId,
inputName: inputName,
inputType: inputType,
inputValue: inputValue,
timeStamp: timeStamp
};
this.removeItemById(inputId);
this.inputList.push(obj);
localStorage.setItem(this.id, JSON.stringify(this));
}
getItemById(id) {
const item = this.inputList.find((element) => element.inputId === id);
logInfo3(`Element: ${id}; Wert: ${item.inputValue}; Typ: ${item.inputType}`);
return item;
}
getItemsByName(name) {
const result = [];
this.inputList.map((item) => {
if (item.inputName === name) {
result.push(item);
}
});
return result;
}
}
function saveCollapsibleState(id, url) {
const isShown = $(`#${id}`).hasClass("show");
$.get(url, { isOpen: isShown, identifier: id });
@@ -446,98 +352,6 @@
function getMaxElementHeight(elementClassName) {
return Math.max.apply(Math, $(`.${elementClassName}`).map(function () { return $(this).height(); }).get());
}
@* Eingabenwiederherstellung *@
function getLocalStorageKey() {
return "@MobileSessionFacade.LocalStorageKey";
}
function getBeWoStorage() {
const localStorageKey = getLocalStorageKey();
const unparsedLocalStorageJson = localStorage.getItem(localStorageKey);
let beWoStorage = new LocalBeWoStorage(localStorageKey, []);
if(unparsedLocalStorageJson === null || unparsedLocalStorageJson === undefined || unparsedLocalStorageJson.length === 0) {
localStorage.setItem(localStorageKey, JSON.stringify(beWoStorage));
} else {
const parsedJson = JSON.parse(unparsedLocalStorageJson);
beWoStorage = new LocalBeWoStorage(localStorageKey, parsedJson.inputList);
}
return beWoStorage;
}
function clearLocalBeWoStorage() {
const beWoStorage = getBeWoStorage();
beWoStorage.clearInputList();
}
function getRestoreButtonState() {
const beWoStorage = getBeWoStorage();
return beWoStorage.inputList.length > 0;
}
window.addEventListener("load", function() {
$(".booking-form-container").find("textarea, select, input").on("change", function() {
const item = $(this);
const id = item.attr("id");
const type = item.prop("type");
const value = type === "checkbox" ? item.is(":checked").toString() : item.val();
if((value === null || value === undefined) || value.length === 0) {
logInfo2(`Element mit Id "${id}" hat ${(value !== null ? "einen leeren" : " keinen")} Wert.`);
return;
}
logInfo3(`${id}: ${value}`);
const name = item.prop("name");
const beWoStorage = getBeWoStorage();
beWoStorage.addInputValue(id, name, type, value, new Date());
// ToDo: Auch Hilfeplan- und Mitarbeiterauswahl berücksichtigen
// ToDo: 28.07.2025: Hilefplan einbauen und dabei dann ein Flag setzen in TempData und dann gegebenenfalls alle anderen Felder wiederherstellen
toggleRestoreButton();
});
});
function restoreField(id) {
const beWoStorage = getBeWoStorage();
const inputObj = beWoStorage.getItemById(id);
if(inputObj === undefined || inputObj === null) {
return;
}
$(`#${id}`).val(inputObj.inputValue);
$(`#${id}`).trigger("change");
}
function restoreAllFields() {
const beWoStorage = getBeWoStorage();
$.each(beWoStorage.inputList, (index, item) => {
if (item.inputType === "checkbox") {
$(`#${item.inputId}`).prop("checked", item.inputValue);
} else {
$(`#${item.inputId}`).val(item.inputValue);
}
$(`#${item.inputId}`).trigger("change");
});
}
@* /Eingabenwiederherstellung *@
</script>
</head>
<body>