Wenn keine Ziele auswählbar sind, es aber Pflicht ist, mindestens eines auszuwählen, kam bisher eine Fehlermeldung, die das Speichern verhindert hat.

Das ist jetzt behoben.

Hat man keine Uhrzeit eingetragen, wurde ein mehrtägiger ServiceRecord daraus.
This commit is contained in:
2025-11-18 13:36:30 +01:00
parent 9b9710915e
commit 6ebc263dc0
9 changed files with 33 additions and 67 deletions

View File

@@ -81,4 +81,8 @@ function ddMMyyyyToyyyyMMdd(dateString) {
const yyyy = dayMonthYear[2];
return `${yyyy}-${mm}-${dd}`;
}
function toStringWithSeconds(date) {
return `${date.getDate()}.${date.getMonth()}.${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
}

View File

@@ -32,10 +32,12 @@
let start = new Date(startDateValue);
let end = hasEndDate ? new Date(endDateValue) : start;
logInfo3(`Input-Values: startTimeValue: <<${startTimeValue}>>; endTimeValue: <<${endTimeValue}>>; duration: <<${durationValue}>>`);
// Von und Bis haben gültige Werte und es wurde nicht durch den Dauereinheitsbutton ausgelöst
if(true === isStartTimeValid && true === isEndTimeValid && false === isFormatChange) {
start = combineDateAndTime(start, startTimeValue);
end = combineDateAndTime(end, endTimeValue);
start = combineDateAndTime(start, startTimeValue, false);
end = combineDateAndTime(end, endTimeValue, false);
let dauer = (end.getTime() - start.getTime()) / 60000;
@@ -135,9 +137,7 @@ function formatDuration(isInMin, durationAsNumber) {
}
function calcTimeWithDuration(timeAsString, timeElement, start, duration, isFormatChange, isInMin) {
start = combineDateAndTime(start, timeAsString);
logInfo3(`calcTimeWithDuration(timeAsString: ${timeAsString}, timeElement: ${timeElement}, start: ${start}, duration: ${duration}, isFormatChange: ${isFormatChange}, isInMin: ${isInMin})`);
start = combineDateAndTime(start, timeAsString, false);
const x = new Date(start.getTime() + duration * 60000);
const timeString = `${x.getHours().toString().padStart(2, "0")}:${x.getMinutes().toString().padStart(2, "0")}`;
@@ -194,7 +194,7 @@ function beiDaueraenderung(idPrefix) {
}
if(true === isStartTimeValid) {
const startDateAndTimeCombined = combineDateAndTime(start, startTimeInput.val());
const startDateAndTimeCombined = combineDateAndTime(start, startTimeInput.val(), false);
end = new Date(startDateAndTimeCombined.getTime() + duration * 60000);
@@ -204,7 +204,7 @@ function beiDaueraenderung(idPrefix) {
endTimeInput.trigger("change");
endDateInput.trigger("change");
} else {
const endDateAndTimeCombined = combineDateAndTime(end, endTimeInput.val());
const endDateAndTimeCombined = combineDateAndTime(end, endTimeInput.val(), false);
start = new Date(endDateAndTimeCombined.getTime() - duration * 60000);
@@ -216,7 +216,11 @@ function beiDaueraenderung(idPrefix) {
}
}
function combineDateAndTime(date, time) {
function combineDateAndTime(date, time, isOneSecond) {
if(true === isOneSecond) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 1);
}
const hours = time.split(":")[0];
const minutes = time.split(":")[1];

View File

@@ -200,10 +200,12 @@ function validateForm(form, prefix) {
const isNoticeMandatory = window.getIsDocumentationMandatory();
const isServiceRecordGoalMandatory = window.getIsServiceRecordGoalMandatory();
const numberOfNoticeTextareas = window.getNumberOfDokutypes();
const hasGoalsToChooseFrom = $("#goals-tree").length > 0;
var isValid = true;
if(isServiceRecordGoalMandatory) {
if(isServiceRecordGoalMandatory && hasGoalsToChooseFrom) {
const selectedGoalOids = window.getCheckedGoalsAsArray();
if(selectedGoalOids.length === 0) {
@@ -272,7 +274,7 @@ function validateForm(form, prefix) {
if(startAndEndDates !== null && isValid) {
var [start, end] = startAndEndDates;
if(end.getTime() < start.getTime() || end.getTime() === start.getTime()) {
if((start.getSeconds() !== 1 && end.getSeconds() !== 1) && (end.getTime() < start.getTime() || end.getTime() === start.getTime())) {
end.setDate(end.getDate() + 1);
}
@@ -417,13 +419,16 @@ function validateStartAndEndInputs(startDateInput, startTimeInput, endDateInput,
}
const isStartDateValid = false === isNaN(startDate.getTime());
const isEndDateValid = endDateInput.length ? false === isNaN(endDate.getTime()) : true;
const isEndDateValid = false === isNaN(endDate.getTime());
if(isStartDateValid && startTime.length === 0 || isEndDateValid && endTime.length === 0) {
const startValue = `${getDateAsString(startDate)}T00:00:0${(isServiceRecord ? "1" : "0")}`;
const endValue = `${getDateAsString(endDate)}T00:00:0${(isServiceRecord ? "1" : "0")}`;
return [new Date(startValue), new Date(endValue)];
const newStartDate = new Date(startValue);
const newEndDate = new Date(endValue);
return [newStartDate, newEndDate];
}
const isStartTimeValid = startTime.length > 0;
@@ -433,7 +438,7 @@ function validateStartAndEndInputs(startDateInput, startTimeInput, endDateInput,
return null;
}
return [combineDateAndTime(startDate, startTime), combineDateAndTime(endDate, endTime)];
return [combineDateAndTime(startDate, startTime, false), combineDateAndTime(endDate, endTime, false)];
}
function supportConceptSearchOnChange() {

View File

@@ -183,7 +183,7 @@
if(!goalTreeItem.IsLeaf)
{
<div class="card w-100 mb-3 goal-card" id="c-@goalTreeItem.ValueListEntryOid">
<div class="card w-100 mb-1 goal-card" id="c-@goalTreeItem.ValueListEntryOid">
<div class="card-header px-2" onclick="cardHeaderClick('#goal-chevron-@goalTreeItem.ValueListEntryOid', '#collapsable-goal-tree-branch-@goalTreeItem.ValueListEntryOid')">
<div class="clearfix">
<div class="custom-control custom-checkbox goal-card-header float-left" onclick="stopToggle(event)" >

View File

@@ -15,6 +15,7 @@
var isSingleTabPaneActive = TempData[TempDataConstants.IsGroupTabActiveKey] is true ? string.Empty : "active";
}
@* ToDo: Suchfeld einbauen und je nach Auswahl (HP oder Gruppe) suchen/filtern *@
<div class="tab-pane show @isSingleTabPaneActive" role="tabpanel" id="gb-supportconcepts">
<ul class="list-group" id="gb-cb2sc-list">
@foreach(var cb2Sc in Model.SupportConceptListObjectsForGroupBooking)

View File

@@ -821,50 +821,3 @@
<input type="hidden" name="@FormCollectionConstants.DurationKey" id="srv-duration" />
<input type="hidden" name="@FormCollectionConstants.BetragKey" id="srv-betrag" />
}
@*----- Ziele/Maßnahmen-Popup ----- *@
<div class="modal" tabindex="-1" role="dialog" id="goal-popup">
<div class="modal-dialog modal-dialog-scrollable h-100" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title font-weight-bold">Ziele und Ma&szlig;nahmen</h6>
<button type="button" class="close" data-dismiss="modal" onclick="resetGoalTreeSearch()">
<span>&times;</span>
</button>
</div>
<div class="modal-body pb-0">
<div class="container-fluid px-0">
<div class="input-group mb-3">
<input class="form-control w-100" type="text" placeholder="Suchen..." oninput="goalTreeSearchOnChangeV2()" id="goal-search-input" />
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" onclick="resetGoalTreeSearch()">
<span class="fas fa-times-circle"></span>
</button>
</div>
</div>
</div>
<div id="goals-tree">
@Html.Partial("GoalTreePartial", Model)
</div>
</div>
<div class="modal-footer">
<div class="clearfix w-100">
<div class="custom-control custom-checkbox float-left mr-3">
<input type="checkbox" class="custom-control-input" id="checkAllGoalsButton" onchange="toggleAllGoalsSelection(this)" />
<label for="checkAllGoalsButton" class="custom-control-label">
Alle Ziele
</label>
</div>
<button type="button" class="btn btn-primary float-left mr-2" onclick="showAllGoals()">
Alle auf
</button>
<button type="button" class="btn btn-primary float-left" onclick="hideAllGoals()">
Alle zu
</button>
<button type="button" class="btn btn-primary float-right" data-dismiss="modal">Schlie&szlig;en</button>
</div>
</div>
</div>
</div>
</div>

View File

@@ -433,7 +433,6 @@
</div>
}
page = Model.CurrentQbEntryPage - 2;
if(page > Model.QbEntryPageCount - 4)

View File

@@ -55,7 +55,7 @@
<script type="text/javascript" src="@Scripts.Url("~/Scripts/moment/locale/de.js")"></script>
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/mobileUtils.js?v=1.7")"></script>
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/view-scripts/main.js?v=2.2")"></script>
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/view-scripts/main.js?v=2.5")"></script>
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/signature.js?v=1.5")"></script>
<link type="text/css" rel="stylesheet" href="@Url.Content("~/Scripts/bootstrap/bootstrap4-modal-fullscreen.min.css")" />

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<NameOfLastUsedPublishProfile>C:\Projects\Bewo\BeWo - Main\Host\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress>
</Use64BitIISExpress>
<IISExpressSSLPort />