.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31729.503
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36408.4 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeWoPlanerMobil", "BeWoPlanerMobil\BeWoPlanerMobil.csproj", "{284B02ED-114A-426C-9162-31BB6CF05589}"
|
||||
EndProject
|
||||
@@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HausDuelken", "ReportImp\Ha
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FeidPartnerReports", "ReportImp\FeidPartnerReports\FeidPartnerReports.csproj", "{36E7D251-2F15-4589-81C2-6BDDC67F16AE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Host", "Host\Host.csproj", "{E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -92,6 +94,12 @@ Global
|
||||
{36E7D251-2F15-4589-81C2-6BDDC67F16AE}.DebugRemote|Any CPU.Build.0 = DebugRemote|Any CPU
|
||||
{36E7D251-2F15-4589-81C2-6BDDC67F16AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{36E7D251-2F15-4589-81C2-6BDDC67F16AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.DebugRemote|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.DebugRemote|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -39,17 +39,17 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<TypeScriptTarget>ES2015</TypeScriptTarget>
|
||||
<TypeScriptTarget>ES2021</TypeScriptTarget>
|
||||
<TypeScriptJSXEmit>React</TypeScriptJSXEmit>
|
||||
<TypeScriptModuleKind>ES6</TypeScriptModuleKind>
|
||||
<TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
|
||||
<TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
|
||||
<TypeScriptRemoveComments>False</TypeScriptRemoveComments>
|
||||
<TypeScriptRemoveComments>True</TypeScriptRemoveComments>
|
||||
<TypeScriptOutFile />
|
||||
<TypeScriptOutDir />
|
||||
<TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
|
||||
<TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
|
||||
<TypeScriptSourceMap>True</TypeScriptSourceMap>
|
||||
<TypeScriptSourceMap>False</TypeScriptSourceMap>
|
||||
<TypeScriptMapRoot />
|
||||
<TypeScriptSourceRoot />
|
||||
</PropertyGroup>
|
||||
@@ -676,6 +676,7 @@
|
||||
<Content Include="Views\DevTools\DevToolsUserRightsPartial.cshtml" />
|
||||
<Content Include="Views\DevTools\DevToolsDataGenerationPartial.cshtml" />
|
||||
<Content Include="Views\Main\RestoreServiceRecordInputsPartial.cshtml" />
|
||||
<Content Include="Scripts\bs-custom-file-input.min.js.map" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="packages.config" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<UseIISExpress>false</UseIISExpress>
|
||||
@@ -8,7 +8,7 @@
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
|
||||
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||
@@ -34,13 +34,10 @@
|
||||
<SilverlightDebugging>False</SilverlightDebugging>
|
||||
<NativeDebugging>False</NativeDebugging>
|
||||
<SQLDebugging>False</SQLDebugging>
|
||||
<ExternalProgram>
|
||||
</ExternalProgram>
|
||||
<ExternalProgram>C:\Program Files\Google\Chrome\Application\chrome.exe</ExternalProgram>
|
||||
<StartExternalURL>http://localhost/BeWoPlanerMobil/Login/demo</StartExternalURL>
|
||||
<StartCmdLineArguments>
|
||||
</StartCmdLineArguments>
|
||||
<StartWorkingDirectory>
|
||||
</StartWorkingDirectory>
|
||||
<StartCmdLineArguments>--auto-open-devtools-for-tabs</StartCmdLineArguments>
|
||||
<StartWorkingDirectory>C:\Program Files (x86)\IIS Express</StartWorkingDirectory>
|
||||
<EnableENC>True</EnableENC>
|
||||
<AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
|
||||
</WebProjectProperties>
|
||||
|
||||
@@ -2119,6 +2119,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.SelectedCostBearerSupportConceptOid = cb2ScOid;
|
||||
Model.CurrentPage = 1;
|
||||
|
||||
// Sorgt dafür, dass nach dem Neuladen die Abhängigkeiten vom Hilfeplan erhalten bleiben
|
||||
TempData[TempDataConstants.SupportConceptRelSelectedKey] = true;
|
||||
|
||||
return RedirectToActionPermanent("Main");//ResetEditingMode();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -2590,7 +2594,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult SelectRecordToEdit(FormCollection formCollection)
|
||||
{
|
||||
if (!IsUserLoggedIn())
|
||||
if(!IsUserLoggedIn())
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return Logout();
|
||||
@@ -2616,6 +2620,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return RedirectToActionPermanent("Main");
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
Model.SelectedServiceRecord = selectedServiceRecord;
|
||||
#endif
|
||||
|
||||
Model.SelectedGoalOids = selectedServiceRecord.Goals.Select(g => g.ValueListEntryOid.Value).ToList();
|
||||
Model.SelectedGoals = DcToMokMapper.CreateZiele(selectedServiceRecord.Goals);
|
||||
|
||||
@@ -3749,6 +3757,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
CreateModelSupportConceptListObjects(false);
|
||||
LoadSupportConceptThings(null, true);
|
||||
|
||||
// Sorgt dafür, dass nach dem Neuladen die Abhängigkeiten vom Hilfeplan erhalten bleiben
|
||||
TempData[TempDataConstants.SupportConceptRelSelectedKey] = true;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -4909,42 +4920,20 @@ namespace BeWoPlanerMobil.Controllers
|
||||
.ThenBy(serviceRecord => serviceRecord.End.Value.Minute)
|
||||
.ThenByDescending(serviceRecord => serviceRecord.InsertedOn.Value).ToList();
|
||||
|
||||
var serviceRecordOids2GoalHeaders = new Dictionary<long, List<string>>();
|
||||
|
||||
var goalOids = new List<long>();
|
||||
//var measures = new List<ValueListEntryDC>();
|
||||
|
||||
serviceRecords.DoForEach(serviceRecord =>
|
||||
{
|
||||
//measures.AddRangeIfElementsNotIn(serviceRecord.Goals);
|
||||
goalOids.AddRangeIfElementsNotIn(serviceRecord.Goals.Where(goal => goal.ParentOid.HasValue).Select(goal => goal.ParentOid.Value));
|
||||
});
|
||||
|
||||
var goalCategories = ValueListService.GetGoalCategoriesByOids(goalOids);
|
||||
|
||||
//serviceRecords.DoForEach(serviceRecord =>
|
||||
//{
|
||||
// if(serviceRecord.ServiceRecordOid is null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// serviceRecord.Goals.OrderBy(vle => $"{vle.Abbreviation}-{vle.TypeDescription}").DoForEach(goal =>
|
||||
// {
|
||||
// var goalCategory = goalCategories.FirstOrDefault(g => g.ValueListEntryOid.HasValue && goal.ValueListEntryOid.HasValue && g.ValueListEntryOid.Value.Equals(goal.ValueListEntryOid.Value) || (g.ValueListEntryOid.HasValue && goal.ParentOid.HasValue && g.ValueListEntryOid.Value.Equals(goal.ParentOid.Value)));
|
||||
|
||||
// if(goalCategory != null)
|
||||
// {
|
||||
// serviceRecordOids2GoalHeaders.AddOrUpdateValueInDictionary(serviceRecord.ServiceRecordOid.Value, new List<string> { goalCategory.DisplayName });
|
||||
// }
|
||||
// });
|
||||
//});
|
||||
|
||||
Model.ServiceRecordOids2GoalHeader = GetServiceRecordOids2GoalHeaders(serviceRecords, goalCategories);
|
||||
|
||||
Model.ServiceRecords = serviceRecords;
|
||||
|
||||
if (selectedPage > 1 && Model.ServiceRecordPageCount < selectedPage)
|
||||
if(selectedPage > 1 && Model.ServiceRecordPageCount < selectedPage)
|
||||
{
|
||||
LoadPaginatedServiceRecordsToModel(1);
|
||||
}
|
||||
@@ -4987,7 +4976,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
return LoadServiceRecordPage(Model.ServiceRecordPageCount);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Einmal-Link für die Unterschrift
|
||||
@@ -5132,8 +5120,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var dateInputValue = formCollection[FormCollectionConstants.DateKey];
|
||||
var startTimeInputValue = formCollection[FormCollectionConstants.StartKey];
|
||||
var endTimeInputValue = formCollection[FormCollectionConstants.EndKey];
|
||||
|
||||
var endDateInputValue = formCollection[FormCollectionConstants.EndDateKey];
|
||||
var endTimeInputValue = formCollection[FormCollectionConstants.EndKey];
|
||||
|
||||
var doku1 = formCollection[FormCollectionConstants.Dokumentation1Key];
|
||||
var doku2 = formCollection[FormCollectionConstants.Dokumentation2Key];
|
||||
var doku3 = formCollection[FormCollectionConstants.Dokumentation3Key];
|
||||
@@ -5141,7 +5131,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var doku5 = formCollection[FormCollectionConstants.Dokumentation5Key];
|
||||
var doku6 = formCollection[FormCollectionConstants.Dokumentation6Key];
|
||||
var distanceInputValue = formCollection[FormCollectionConstants.DistanceKey];
|
||||
var markerInputValue = formCollection[FormCollectionConstants.MarkerKey];
|
||||
var marker = formCollection[FormCollectionConstants.MarkerKey] == "true";
|
||||
var serviceDescriptionOidInputValue = formCollection[FormCollectionConstants.ServiceDescriptionKey];
|
||||
var durationInputValue = formCollection[FormCollectionConstants.DurationKey];
|
||||
var betragInputValue = formCollection[FormCollectionConstants.BetragKey];
|
||||
@@ -5152,13 +5142,31 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var selectedMultiBookingEmployeeOidsInputValue = formCollection[FormCollectionConstants.MultiBookingSelectedEmployeeOidsKey];
|
||||
var selectedGoalOidsInputValue = formCollection[FormCollectionConstants.SelectedGoalOids];
|
||||
|
||||
DateTime.TryParse(dateInputValue, out var date);
|
||||
DateTime.TryParse(endDateInputValue, out var endDate);
|
||||
var isStartDateValid = DateTime.TryParse(dateInputValue, out var startDate);
|
||||
var isEndDateValid = DateTime.TryParse(endDateInputValue, out var endDate);
|
||||
decimal.TryParse(distanceInputValue, out var distance);
|
||||
|
||||
decimal.TryParse(betragInputValue, out var betrag);
|
||||
|
||||
TempData[TempDataConstants.AfterRestoreKey] = true;
|
||||
|
||||
return View("Main", Model);
|
||||
var serviceRecord = new ServiceRecordDC();
|
||||
|
||||
if(Model.SelectedServiceRecord is ServiceRecordDC selectedServiceRecord)
|
||||
{
|
||||
serviceRecord = selectedServiceRecord;
|
||||
}
|
||||
|
||||
serviceRecord.ServiceRecordType = marker ? ServiceRecordTypeId.Content : ServiceRecordTypeId.DefaultActivity;
|
||||
serviceRecord.Start = startDate.MergeDateAndTimeString(startTimeInputValue);
|
||||
|
||||
if(isEndDateValid == false)
|
||||
{
|
||||
endDate = startDate;
|
||||
}
|
||||
|
||||
serviceRecord.End = endDate.MergeDateAndTimeString(endTimeInputValue);
|
||||
|
||||
return RedirectToActionPermanent("Main", Model);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -459,4 +459,12 @@ function getCurrentTimeStamp() {
|
||||
const milliseconds = String(3).padStart(3, now.getMilliseconds().toString());
|
||||
|
||||
return `${date}.${month}.${now.getFullYear()} ${hours}:${minutes}:${seconds}.${milliseconds}`;
|
||||
}
|
||||
|
||||
function firstCharToUpperCase(str) {
|
||||
if(str === null || str === undefined || str.length === 0) {
|
||||
return str;
|
||||
}
|
||||
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
function arrayContainsAllItems(a1, a2) {
|
||||
var result = true;
|
||||
|
||||
if (a1 !== null && a2 !== null && Array.isArray(a1) && Array.isArray(a2)) {
|
||||
if (a1 !== undefined && a1 !== null && a2 !== undefined && a2 !== null && Array.isArray(a1) && Array.isArray(a2)) {
|
||||
for (let i = 0; i < a2.length; i++) {
|
||||
if (!a1.includes(a2[i])) {
|
||||
result = false;
|
||||
@@ -20,22 +20,22 @@ function isEmptyOrSpaces(str) {
|
||||
}
|
||||
|
||||
function isInArray(value, array) {
|
||||
if (value === undefined || value === null || array === undefined || array === null) {
|
||||
if(value === undefined || value === null || array === undefined || array === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Array.isArray(array)) {
|
||||
if(!Array.isArray(array)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const intValue = parseInt(value, 10);
|
||||
|
||||
if (isNaN(intValue)) {
|
||||
if(isNaN(intValue)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
if (array[i] === intValue) {
|
||||
for(let i = 0; i < array.length; i++) {
|
||||
if(array[i] === intValue) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -45,13 +45,13 @@ function isInArray(value, array) {
|
||||
|
||||
function checkArraysForEquality(a1, a2) {
|
||||
try {
|
||||
if (Array.isArray(a1) && Array.isArray(a2) && a1.length === a2.length) {
|
||||
if(Array.isArray(a1) && Array.isArray(a2) && a1.length === a2.length) {
|
||||
a1 = a1.sort();
|
||||
a2 = a2.sort();
|
||||
|
||||
for(var i = 0; i < a1.length; i++) {
|
||||
var obj1 = a1[i];
|
||||
var obj2 = a2[i];
|
||||
for(let i = 0; i < a1.length; i++) {
|
||||
const obj1 = a1[i];
|
||||
const obj2 = a2[i];
|
||||
|
||||
if(typeof obj1 !== typeof obj2 || obj1 !== obj2) {
|
||||
return false;
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
function logInfo(message) {
|
||||
logColorfulMessage(message, "#FF0094");
|
||||
logColorfulMessage(message, "#990059");
|
||||
}
|
||||
|
||||
function logWarning(message) {
|
||||
logColorfulMessage(message, "#FF5A00");
|
||||
logColorfulMessage(message, "#F2AA10");
|
||||
}
|
||||
|
||||
function logError(message) {
|
||||
console.error(`%c${message}`, "font-size: 14px; font-family: monospace; color: red");
|
||||
console.error(`%c${message}`, "font-size: 16px; font-weight: bold; font-family: IBM Plex Mono; color: red");
|
||||
}
|
||||
|
||||
function logDebug(message) {
|
||||
logColorfulMessage(message, "#AAF500");
|
||||
logColorfulMessage(message, "#6FA100");
|
||||
}
|
||||
|
||||
function logColorfulMessage(message, color) {
|
||||
console.log(`%c${message}`, `font-size: 14px; font-family: monospace; color: ${color}`);
|
||||
console.log(`%c${message}`, `font-size: 16px; font-weight: bold; font-family: IBM Plex Mono; color: ${color}`);
|
||||
}
|
||||
|
||||
function logInfo2(message) {
|
||||
logColorfulMessage(message, "#DBFF8C");
|
||||
logColorfulMessage(message, "#95AD5F");
|
||||
}
|
||||
|
||||
function logInfo3(message) {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
function calcDuration(idPrefix, isFormatChange, isInvokedByStart, isInvokedByEnd) {
|
||||
const endDateInput = $(`#${idPrefix}-end-date-input`);
|
||||
const startDateInput = $(`#${idPrefix}-start-date-input`);
|
||||
const endTimeInput = $(`#${idPrefix}-end-time-input`);
|
||||
const startTimeInput = $(`#${idPrefix}-start-time-input`);
|
||||
const durationInput = $(`#${idPrefix}-duration-input`);
|
||||
const endDateInput = $(`#${idPrefix}-end-date-input`);
|
||||
const startDateInput = $(`#${idPrefix}-start-date-input`);
|
||||
const endTimeInput = $(`#${idPrefix}-end-time-input`);
|
||||
const startTimeInput = $(`#${idPrefix}-start-time-input`);
|
||||
const durationInput = $(`#${idPrefix}-duration-input`);
|
||||
const hoursMinutesBtn = $(`#${idPrefix}-hours-minutes-dropdown-btn`);
|
||||
const durationLabel = $(`#${idPrefix}-duration-label`);
|
||||
const durationLabel = $(`#${idPrefix}-duration-label`);
|
||||
|
||||
const startDateValue = startDateInput.val();
|
||||
const startTimeValue = startTimeInput.val();
|
||||
const endDateValue = endDateInput.val();
|
||||
const endTimeValue = endTimeInput.val();
|
||||
const durationValue = durationInput.val();
|
||||
const endDateValue = endDateInput.val();
|
||||
const endTimeValue = endTimeInput.val();
|
||||
const durationValue = durationInput.val();
|
||||
|
||||
const hasMinutesHoursDropdown = hoursMinutesBtn.length > 0;
|
||||
|
||||
@@ -46,12 +46,18 @@
|
||||
|
||||
endTimeInput.val(getTimeAsString(end));
|
||||
endDateInput.val(getDateAsString(end));
|
||||
|
||||
updateEndDate(idPrefix, getDateAsString(end));
|
||||
updateEndTime(idPrefix, getTimeAsString(end));
|
||||
}
|
||||
else if(true === isInvokedByEnd) {
|
||||
end.setDate(end.getDate() + 1);
|
||||
|
||||
endTimeInput.val(getTimeAsString(end));
|
||||
endDateInput.val(getDateAsString(end));
|
||||
|
||||
updateEndDate(idPrefix, getDateAsString(end));
|
||||
updateEndTime(idPrefix, getTimeAsString(end));
|
||||
}
|
||||
|
||||
dauer = (end.getTime() - start.getTime()) / 60000;
|
||||
@@ -62,8 +68,10 @@
|
||||
}
|
||||
|
||||
durationInput.val(dauer);
|
||||
updateDuration(idPrefix, durationInput.val());
|
||||
} else if(true === isStartTimeValid && true === isDurationValid) {
|
||||
var newDuration = duration;
|
||||
|
||||
if(true === isFormatChange) {
|
||||
let newDurationValue = true === isInMin ? duration * 60.0 : duration / 60.0;
|
||||
|
||||
@@ -71,24 +79,27 @@
|
||||
durationInput.val("");
|
||||
} else {
|
||||
durationInput.val(newDurationValue);
|
||||
updateDuration(idPrefix, durationInput.val());
|
||||
}
|
||||
|
||||
if(true === isInMin)
|
||||
{
|
||||
newDuration = newDurationValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
calcTimeWithDuration(startTimeValue, endTimeInput, start, newDuration, isFormatChange, isInMin);
|
||||
} else if(true === isEndTimeValid && true === isDurationValid) {
|
||||
if(true === isFormatChange) {
|
||||
durationInput.val(formatDuration(isInMin, true === isInMin ? duration * 60.0 : duration / 60.0));
|
||||
updateDuration(idPrefix, durationInput.val());
|
||||
}
|
||||
|
||||
calcTimeWithDuration(endTimeValue, startTimeInput, start, duration * -1.0, isFormatChange, isInMin);
|
||||
} else if(true === isFormatChange) {
|
||||
if (true === isFormatChange) {
|
||||
durationInput.val(formatDuration(isInMin, true === isInMin ? duration * 60.0 : duration / 60.0));
|
||||
updateDuration(idPrefix, durationInput.val());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,6 +133,7 @@ function calcTimeWithDuration(timeAsString, timeElement, start, duration, isForm
|
||||
const x = new Date(start.getTime() + duration * 60000);
|
||||
const timeString = `${x.getHours().toString().padStart(2, "0")}:${x.getMinutes().toString().padStart(2, "0")}`;
|
||||
timeElement.val(timeString);
|
||||
timeElement.trigger("change");
|
||||
}
|
||||
|
||||
function beiDaueraenderung(idPrefix) {
|
||||
@@ -140,13 +152,15 @@ function beiDaueraenderung(idPrefix) {
|
||||
|
||||
const startTimeCondition = startTimeInput.val().length > 0;
|
||||
const endTimeCondition = endTimeInput.val().length > 0;
|
||||
|
||||
var dauerString = durationInput.val();
|
||||
if (dauerString.indexOf(".") >= 0) {
|
||||
|
||||
if(dauerString.indexOf(".") >= 0) {
|
||||
dauerString = dauerString.replace(".", ",");
|
||||
durationInput.val(dauerString);
|
||||
}
|
||||
|
||||
let duration = parseFloat(dauerString.replace(",", "."));
|
||||
|
||||
|
||||
const durationCondition = false === isNaN(duration);
|
||||
|
||||
@@ -177,6 +191,9 @@ function beiDaueraenderung(idPrefix) {
|
||||
|
||||
endTimeInput.val(getTimeAsString(end));
|
||||
endDateInput.val(getDateAsString(end));
|
||||
|
||||
endTimeInput.trigger("change");
|
||||
endDateInput.trigger("change");
|
||||
} else {
|
||||
const endDateAndTimeCombined = combineDateAndTime(end, endTimeInput.val());
|
||||
|
||||
@@ -184,6 +201,9 @@ function beiDaueraenderung(idPrefix) {
|
||||
|
||||
startTimeInput.val(getTimeAsString(start));
|
||||
startDateInput.val(getDateAsString(start));
|
||||
|
||||
startTimeInput.trigger("change");
|
||||
startDateInput.trigger("change");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,24 +2,11 @@
|
||||
showSpinner();
|
||||
|
||||
$("#sb-cb2ScRelOid").val(cb2ScOid);
|
||||
window.saveItemValueLocally(document.getElementById("sb-cb2ScRelOid"));
|
||||
window.updateCbScRelOids("sb", cb2ScOid);
|
||||
|
||||
$("#selectSupportConceptForm").submit();
|
||||
}
|
||||
|
||||
function setSelectedEmployee() {
|
||||
const employeeOid = parseInt($("#employeesDropDown").find(":selected").val());
|
||||
|
||||
if(isNaN(employeeOid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$("#sb-employee-input").val(employeeOid);
|
||||
window.saveItemValueLocally($("#sb-employee-input").val());
|
||||
|
||||
$.get(window.getSetServiceRecordEmployeeUrl(), { employeeOid: employeeOid });
|
||||
}
|
||||
|
||||
function checkJson(str) {
|
||||
try {
|
||||
JSON.parse(str);
|
||||
@@ -301,18 +288,15 @@ function validateForm(form, prefix) {
|
||||
$("#srv-duration").val(duration);
|
||||
$("#srv-betrag").val(betrag);
|
||||
|
||||
window.saveItemValueLocally(document.getElementById(`${prefix}-start-date-input`));
|
||||
window.saveItemValueLocally(document.getElementById(`${prefix}-end-date-input`));
|
||||
window.saveItemValueLocally(document.getElementById(`${prefix}-start-time-input`));
|
||||
window.saveItemValueLocally(document.getElementById(`${prefix}-end-time-input`));
|
||||
window.saveItemValueLocally(document.getElementById(`${prefix}-distance-input`));
|
||||
window.saveItemValueLocally(document.getElementById(`${prefix}-marker-cb`));
|
||||
|
||||
|
||||
window.saveItemValueLocally(document.getElementById(`${prefix}-service-description-${serviceDescriptionOid}`));
|
||||
|
||||
window.saveItemValueLocally(document.getElementById(`${prefix}-duration-input`));
|
||||
window.saveItemValueLocally(document.getElementById(`${prefix}-betrag`));
|
||||
window.updateStartDate(prefix, $(`${prefix}-start-date-input`).val());
|
||||
window.updateStartTime(prefix, $(`${prefix}-start-time-input`).val());
|
||||
window.updateEndDate(prefix, $(`${prefix}-end-date-input`).val());
|
||||
window.updateEndTime(prefix, $(`${prefix}-end-time-input`).val());
|
||||
window.updateDistance(prefix, $(`${prefix}-distance-input`).val());
|
||||
window.updateMarker(prefix, $(`${prefix}-marker-cb`).val());
|
||||
window.updateServiceDescription(prefix, $(`${prefix}-service-description-${serviceDescriptionOid}`).val());
|
||||
window.updateDuration(prefix, $(`${prefix}-duration-input`).val());
|
||||
window.updateBetrag(prefix, $(`${prefix}-betrag`).val());
|
||||
|
||||
showSpinner();
|
||||
$("#service-record-validation-form").submit();
|
||||
@@ -513,7 +497,7 @@ function setServiceDescription(id) {
|
||||
|
||||
const selectedServiceDescription = selectedOption.val();
|
||||
|
||||
window.saveServiceDescriptionLocally(selectedServiceDescription);
|
||||
window.updateServiceDescription(id.split("-")[0], selectedServiceDescription);
|
||||
|
||||
$.get(url, {pServiceDescriptionOid: selectedServiceDescription});
|
||||
} catch(error) {
|
||||
|
||||
@@ -64,7 +64,13 @@ namespace BeWoPlanerMobil.Service
|
||||
|
||||
if(!File.Exists(serverPath))
|
||||
{
|
||||
return null;
|
||||
serverPath = HttpContext.Current.Server.MapPath(null);
|
||||
serverPath = Path.Combine(serverPath, Path.Combine(@"..\..\", Path.Combine(multitenancyPath, configFileName)));
|
||||
|
||||
if(!File.Exists(serverPath))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
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";
|
||||
public static string BookingModeKey => "BookingMode";
|
||||
|
||||
|
||||
@@ -97,5 +95,6 @@
|
||||
public static string AfterRestoreKey => "AfterRestore";
|
||||
public static string SaveSupportConceptDependenciesKey => "SaveSupportConceptDependencies";
|
||||
public static string DeleteLocalInputsKey => "DeleteLocalInputsKey";
|
||||
public static string SupportConceptRelSelectedKey => "SupportConceptRelSelected";
|
||||
}
|
||||
}
|
||||
@@ -465,7 +465,7 @@
|
||||
</div>
|
||||
<div class="collapse @Html.GetCollapsibleClass(Model.Collapsibles2IsShown, $"bgts-collapsible-{bargeldkasse.BargeldkassenOid}")" id="bgts-collapsible-@bargeldkasse.BargeldkassenOid">
|
||||
<div class="card-body p-1">
|
||||
<table class="bg-bewo-dev table table-sm table-striped w-100 mx-0 px-0 service-record-table">
|
||||
<table class="table table-sm table-striped w-100 mx-0 px-0 service-record-table">
|
||||
<tbody>
|
||||
@{
|
||||
var count = 0;
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
{
|
||||
if(selectedBargeldtransaktion.Zahlungsdatum.HasValue)
|
||||
{
|
||||
transaktionsdatum = selectedBargeldtransaktion.Zahlungsdatum.Value.ToString("dd.MM.yyyy");
|
||||
transaktionsdatum = selectedBargeldtransaktion.Zahlungsdatum.Value.ToString("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
transaktionsbelegnummer = selectedBargeldtransaktion.Belegnummer;
|
||||
|
||||
@@ -41,12 +41,15 @@
|
||||
function setSelectedServiceCategory() {
|
||||
const selectedCategoryOid = $("#@(Model.BookingModePrefix)-category-select").find(":selected").val();
|
||||
|
||||
$("#category-to-description-container").load("@Url.Action("SetSelectedServiceCategory")", {categoryOidStr: selectedCategoryOid}, function() {
|
||||
window.saveServiceCategoryLocally($("#@prefix-category-select").find(":selected").val());
|
||||
window.saveServiceDescriptionLocally($("#@prefix-leistung-select").find(":selected").val());
|
||||
window.updateCategory("@prefix", selectedCategoryOid);
|
||||
|
||||
$("#tree").load("@Url.Action("LoadUpToDateTextModules")");
|
||||
});
|
||||
$("#category-to-description-container").load("@Url.Action("SetSelectedServiceCategory")", {categoryOidStr: selectedCategoryOid},
|
||||
function() {
|
||||
window.updateServiceDescription("@prefix", $("#@prefix-leistung-select").find(":selected").val());
|
||||
|
||||
$("#tree").load("@Url.Action("LoadUpToDateTextModules")");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
@@ -54,11 +57,11 @@
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
$("#@prefix-category-select").on("change", function() {
|
||||
window.saveServiceCategoryLocally($("#@prefix-category-select").find(":selected").val());
|
||||
window.updateCategory("@prefix", $("#@prefix-category-select").find(":selected").val());
|
||||
});
|
||||
|
||||
$("#@prefix-leistung-select").on("change", function() {
|
||||
window.saveServiceDescriptionLocally($("#@prefix-leistung-select").find(":selected").val());
|
||||
window.updateServiceDescription("@prefix", $("#@prefix-leistung-select").find(":selected").val());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
@using BeWoPlanerMobil.Models
|
||||
@using BeWoPlanerMobil.Util
|
||||
@using BeWoPlanerMobil.Util
|
||||
@model BeWoPlanerMobil.Models.MainModel
|
||||
|
||||
@{
|
||||
if(TempData[TempDataConstants.DoLogoutKey] is bool doLogout && doLogout)
|
||||
if(TempData[TempDataConstants.DoLogoutKey] is true)
|
||||
{
|
||||
<text>
|
||||
<script type="text/javascript">
|
||||
@@ -18,15 +17,20 @@
|
||||
try {
|
||||
var goalOid = $("#goal-to-rate-oid").val();
|
||||
|
||||
$.get("@Url.Action("RateSelectedGoal")", { ratingTypeOid: ratingTypeOid, goalOid: goalOid }).done(
|
||||
window.updateGoal2Rating("@Model.BookingModePrefix", goalOid, ratingTypeOid);
|
||||
|
||||
$.get("@Url.Action("RateSelectedGoal")",
|
||||
{
|
||||
ratingTypeOid: ratingTypeOid,
|
||||
goalOid: goalOid
|
||||
}).done(
|
||||
function (result) {
|
||||
if(false === checkJson(result)) {
|
||||
logWarning("rateGoal: Der zurückgegebene Wert ist kein gültiges JSON!");
|
||||
hideSpinner();
|
||||
return;
|
||||
}
|
||||
|
||||
var obj = parseJason(result);
|
||||
const obj = parseJason(result);
|
||||
|
||||
$(`#goal-rating-${goalOid}`).text(obj.RatingName);
|
||||
$(`#${goalOid}`).prop("checked", true);
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
@using BeWoPlanerMobil.Models
|
||||
@using BeWoPlanerMobil.Util
|
||||
@using BeWoPlanerMobil.Util
|
||||
@using BS.Shared
|
||||
@model BeWoPlanerMobil.Models.MainModel
|
||||
|
||||
@{
|
||||
if(TempData[TempDataConstants.DoLogoutKey] is bool doLogout && doLogout)
|
||||
if(TempData[TempDataConstants.DoLogoutKey] is true)
|
||||
{
|
||||
<text>
|
||||
<script type="text/javascript">
|
||||
@@ -43,7 +42,7 @@
|
||||
function removeSupportConceptCostBearerRel(relOid) {
|
||||
$(`#gb-cb2sc-checkbox-${relOid}`).prop("checked", false);
|
||||
|
||||
updateLocallyStoredGroupBookingCb2ScRelOids();
|
||||
updateLocallyStoredGroupBookingCb2ScRelOids();
|
||||
|
||||
$("#gb-selection-container").load("@Url.Action("RemoveSupportConceptCostbearerRel")", {relOid: relOid}
|
||||
, function () {
|
||||
@@ -58,23 +57,12 @@
|
||||
|
||||
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));
|
||||
window.updateCbScRelOids("gb-", cb2ScOidString.slice(0, -1));
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -122,7 +110,7 @@
|
||||
<div class="form-row mt-2">
|
||||
<div class="col-md">
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" class="custom-control-input" name="marker-cb" id="gb-marker-cb" @markerCheckedValue />
|
||||
<input type="checkbox" onchange="window.updateMarker('gb', $(this).val())" class="custom-control-input" name="marker-cb" id="gb-marker-cb" @markerCheckedValue />
|
||||
<label class="custom-control-label" for="gb-marker-cb">Marker</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -147,7 +135,7 @@
|
||||
Betrag
|
||||
</div>
|
||||
</div>
|
||||
<input class="form-control" type="text" autocomplete="on" id="gb-betrag" name="betrag" value="@betrag" />
|
||||
<input class="form-control" onchange="window.updateBetrag('gb', $(this).val())" type="text" autocomplete="on" id="gb-betrag" name="betrag" value="@betrag" />
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">€</div>
|
||||
</div>
|
||||
@@ -173,7 +161,7 @@
|
||||
Startdatum
|
||||
</span>
|
||||
</div>
|
||||
<input class="form-control" type="date" name="Datum" id="gb-start-date-input" onchange="calcDuration('gb', false, true, false)" value="@startDate" />
|
||||
<input class="form-control" type="date" name="Datum" id="gb-start-date-input" onchange="calcDuration('gb', false, true, false); window.updateStartDate('gb', $(this).val());" value="@startDate" />
|
||||
</div>
|
||||
</div>
|
||||
@if(Model.IsEndDateVisible)
|
||||
@@ -185,7 +173,7 @@
|
||||
Enddatum
|
||||
</span>
|
||||
</div>
|
||||
<input class="form-control" type="date" name="Enddatum" id="gb-end-date-input" onchange="calcDuration('gb', false, false, true)" value="@endDate"/>
|
||||
<input class="form-control" type="date" name="Enddatum" id="gb-end-date-input" onchange="calcDuration('gb', false, false, true); window.updateEndDate('gb', $(this).val());" value="@endDate"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -219,11 +207,11 @@
|
||||
Von
|
||||
</span>
|
||||
</div>
|
||||
<input class="form-control" type="time" name="Start" id="gb-start-time-input" onchange="calcDuration('gb', false, true, false)" value="@startTimeValue" />
|
||||
<input class="form-control" type="time" name="Start" id="gb-start-time-input" onchange="calcDuration('gb', false, true, false); window.updateStartTime('gb', $(this).val());" value="@startTimeValue" />
|
||||
<span class="input-group-text rounded-0 border-left-0 border-right-0">
|
||||
Bis
|
||||
</span>
|
||||
<input class="form-control" type="time" name="Ende" id="gb-end-time-input" onchange="calcDuration('gb', false, false, true)" value="@endTimeValue" />
|
||||
<input class="form-control" type="time" name="Ende" id="gb-end-time-input" onchange="calcDuration('gb', false, false, true); window.updateEndTime('gb', $(this).val());" value="@endTimeValue" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -241,7 +229,7 @@
|
||||
@labelText
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" autocomplete="on" class="form-control" id="gb-duration-input" name="Dauer" onchange="beiDaueraenderung('gb')" value="@durationValue">
|
||||
<input type="text" autocomplete="on" class="form-control" id="gb-duration-input" name="Dauer" onchange="beiDaueraenderung('gb'); window.updateDuration('gb', $(this).val());" value="@durationValue">
|
||||
@if(Model.IsZeiterfassungInStdMin)
|
||||
{
|
||||
<div class="input-group-append">
|
||||
@@ -269,7 +257,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text">Gefahrene Kilometer</div>
|
||||
</div>
|
||||
<input type="text" autocomplete="on" class="form-control" id="gb-distance-input" name="Distanz" onchange="validateDistanceInput()" value="@distance">
|
||||
<input type="text" autocomplete="on" class="form-control" id="gb-distance-input" name="Distanz" onchange="validateDistanceInput(); window.updateDistance('gb', $(this).val());" value="@distance">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -292,8 +280,8 @@
|
||||
@if(Model.NumberOfDokuTypes == 0)
|
||||
{
|
||||
<div class="form-group">
|
||||
<label for="gb-dokufeld-textarea">Dokumentation</label>
|
||||
<textarea class="form-control" autocomplete="on" name="Dokumentation6" id="gb-doku-textarea">@notice0</textarea>
|
||||
<label for="gb-doku-textarea">Dokumentation</label>
|
||||
<textarea class="form-control" onchange="window.updateDokuText('gb', $(this).val(), 6)" autocomplete="on" name="Dokumentation6" id="gb-doku-textarea">@notice0</textarea>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
@@ -316,7 +304,7 @@
|
||||
var textareaName = i + 1 < 1 ? "Dokumentation" : "Dokumentation" + (i + 1);
|
||||
|
||||
<div class="tab-pane show@(i == 0 ? " active" : string.Empty)" id="gb-doku_@i" role="tabpanel">
|
||||
<textarea class="form-control doku-form-control" autocomplete="on" id="gb-doku-textarea-@i" name="@textareaName">@noticeList[i]</textarea>
|
||||
<textarea onchange="window.updateDokuText('gb', $(this).val(), @i)" class="form-control doku-form-control" autocomplete="on" id="gb-doku-textarea-@i" name="@textareaName">@noticeList[i]</textarea>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -345,6 +333,5 @@
|
||||
}
|
||||
|
||||
@Html.Partial("RestoreServiceRecordInputsPartial", Model)
|
||||
|
||||
</div>
|
||||
}
|
||||
@@ -6,76 +6,95 @@
|
||||
{
|
||||
<text>
|
||||
<script type="text/javascript">
|
||||
$("#second-logout-form").submit();
|
||||
$("#second-logout-form").submit();
|
||||
</script>
|
||||
</text>
|
||||
}
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
const groupBookingHoursMinutesDropdownButton = $("#gb-hours-minutes-dropdown-btn");
|
||||
window.addEventListener("load", function() {
|
||||
@if(TempData[TempDataConstants.SupportConceptRelSelectedKey] is true)
|
||||
{
|
||||
<text>
|
||||
window.updateCategory("@Model.BookingModePrefix", @Model.SelectedServiceCategoryOid);
|
||||
window.updateServiceDescription("@Model.BookingModePrefix", @Model.SelectedServiceDescriptionOid);
|
||||
window.updateEmployeeOids("@Model.BookingModePrefix", getGroupBookingEmployeeOids());
|
||||
window.updateStartDate("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-start-date-input`).val());
|
||||
window.updateStartTime("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-start-time-input`).val());
|
||||
window.updateEndDate("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-end-date-input`).val());
|
||||
window.updateEndTime("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-end-time-input`).val());
|
||||
</text>
|
||||
}
|
||||
});
|
||||
|
||||
groupBookingHoursMinutesDropdownButton.on("click", function() {
|
||||
groupBookingHoursMinutesDropdownButton.data("text", groupBookingHoursMinutesDropdownButton.text().replaceAll(/\s/g, ""));
|
||||
});
|
||||
$(document).ready(function() {
|
||||
const groupBookingHoursMinutesDropdownButton = $("#gb-hours-minutes-dropdown-btn");
|
||||
|
||||
$(".hours-minutes-link").on("click", function () {
|
||||
const previousText = groupBookingHoursMinutesDropdownButton.data("text");
|
||||
const currentText = $(this).text().replaceAll(/\s/g, "");
|
||||
groupBookingHoursMinutesDropdownButton.on("click", function() {
|
||||
groupBookingHoursMinutesDropdownButton.data("text", groupBookingHoursMinutesDropdownButton.text().replaceAll(/\s/g, ""));
|
||||
});
|
||||
|
||||
if(previousText === currentText) {
|
||||
return;
|
||||
}
|
||||
$(".hours-minutes-link").on("click", function () {
|
||||
const previousText = groupBookingHoursMinutesDropdownButton.data("text");
|
||||
const currentText = $(this).text().replaceAll(/\s/g, "");
|
||||
|
||||
const buttonText = $(this).text();
|
||||
groupBookingHoursMinutesDropdownButton.text(buttonText);
|
||||
if(previousText === currentText) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.setInputFilter('gb-duration-input', 'distance', 'gb-hours-minutes-dropdown-btn');
|
||||
const buttonText = $(this).text();
|
||||
groupBookingHoursMinutesDropdownButton.text(buttonText);
|
||||
|
||||
$.get('@Url.Action("ToggleDurationUnit")', { isInHoursMode: buttonText === "Stunden" });
|
||||
window.setInputFilter('gb-duration-input', 'distance', 'gb-hours-minutes-dropdown-btn');
|
||||
|
||||
calcDuration("gb", true, false, false);
|
||||
});
|
||||
$.get('@Url.Action("ToggleDurationUnit")', { isInHoursMode: buttonText === "Stunden" });
|
||||
|
||||
toggleGroupBookingForm();
|
||||
calcDuration("gb", true, false, false);
|
||||
});
|
||||
|
||||
window.calcPrependWidth();
|
||||
});
|
||||
toggleGroupBookingForm();
|
||||
|
||||
function resetGroupBookingForm() {
|
||||
showSpinner();
|
||||
$("#reset-group-booking-form-form").submit();
|
||||
}
|
||||
window.calcPrependWidth();
|
||||
});
|
||||
|
||||
function addEmployeeToGroupBooking() {
|
||||
var selectedEmployees = [];
|
||||
function resetGroupBookingForm() {
|
||||
showSpinner();
|
||||
$("#reset-group-booking-form-form").submit();
|
||||
}
|
||||
|
||||
var oidString = "";
|
||||
function addEmployeeToGroupBooking() {
|
||||
const oidString = getGroupBookingEmployeeOids();
|
||||
|
||||
$("#gb-employee-selection-popup input:checked").each(function() {
|
||||
const oid = $(this).val();
|
||||
window.updateEmployeeOids("gb", oidString);
|
||||
|
||||
selectedEmployees.push(oid);
|
||||
});
|
||||
$.get("@Url.Action("AddEmployeesToGroupBooking")", { pEmployeeOids: oidString }).done(function(numberOfSelectedEmployees) {
|
||||
$("#selected-employees-count-badge").text(numberOfSelectedEmployees);
|
||||
|
||||
for(let i = 0; i < selectedEmployees.length; i++) {
|
||||
oidString += selectedEmployees[i];
|
||||
$("#create-button").prop("disabled", numberOfSelectedEmployees === "0" ? true : false);
|
||||
});
|
||||
}
|
||||
|
||||
if(i < selectedEmployees.length - 1) {
|
||||
oidString += ",";
|
||||
}
|
||||
}
|
||||
function getGroupBookingEmployeeOids() {
|
||||
var selectedEmployees = [];
|
||||
var oidString = "";
|
||||
|
||||
const storage = window.getBeWoStorage();
|
||||
storage.updateGroupBookingSelectedEmployeeOids(oidString);
|
||||
$("#gb-employee-selection-popup input:checked").each(function() {
|
||||
const oid = $(this).val();
|
||||
|
||||
$.get("@Url.Action("AddEmployeesToGroupBooking")", { pEmployeeOids: oidString }).done(function(numberOfSelectedEmployees) {
|
||||
$("#selected-employees-count-badge").text(numberOfSelectedEmployees);
|
||||
selectedEmployees.push(oid);
|
||||
});
|
||||
|
||||
$("#create-button").prop("disabled", numberOfSelectedEmployees === "0" ? true : false);
|
||||
});
|
||||
}
|
||||
for(let i = 0; i < selectedEmployees.length; i++) {
|
||||
oidString += selectedEmployees[i];
|
||||
|
||||
if(i < selectedEmployees.length - 1) {
|
||||
oidString += ",";
|
||||
}
|
||||
}
|
||||
|
||||
return oidString;
|
||||
}
|
||||
</script>
|
||||
|
||||
@using(Html.BeginForm("ResetGroupBookingForm", "Main", FormMethod.Post, new { Id = "reset-group-booking-form-form" }))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@using BeWoPlanerMobil.Models;
|
||||
@using BeWoPlanerMobil.Util;
|
||||
@using BS.Shared
|
||||
|
||||
@model MainModel
|
||||
@{
|
||||
@@ -25,6 +26,8 @@
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
function loadServiceRecords() {
|
||||
try {
|
||||
const selectedOption = $("#timeFrameSelect").val();
|
||||
@@ -42,12 +45,12 @@
|
||||
|
||||
$("#service-record-list-container").load("@Url.Action("LoadServiceRecordsNonPost")",
|
||||
{
|
||||
dayCountNumber: dayCount,
|
||||
start: start,
|
||||
end: end,
|
||||
month: parseInt(month),
|
||||
year: parseInt(year),
|
||||
recordsKey: parseInt(selectedOption)
|
||||
dayCountNumber: dayCount,
|
||||
start: start,
|
||||
end: end,
|
||||
month: parseInt(month),
|
||||
year: parseInt(year),
|
||||
recordsKey: parseInt(selectedOption)
|
||||
},
|
||||
() => {
|
||||
hideSpinner();
|
||||
@@ -98,117 +101,99 @@
|
||||
}
|
||||
}
|
||||
|
||||
function getIsZeiterfassungseinheitInMinutes() {
|
||||
function getIsZeiterfassungseinheitInMinutes() {
|
||||
return "@Model.EinheitZeiterfassung" === "0";
|
||||
}
|
||||
|
||||
function restoreInputValues() {
|
||||
const beWoStorage = getBeWoStorage();
|
||||
|
||||
for(let i = 0; i < beWoStorage.inputList.length; i++) {
|
||||
const item = beWoStorage.inputList[i];
|
||||
|
||||
$(`#${item.inputId}`).val(item.inputValue);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
try {
|
||||
$(".collapse").on("shown.bs.collapse", function () {
|
||||
window.saveCollapsibleState($(this).attr("id"), "@Url.Action("SaveCollapsibleStatus")");
|
||||
});
|
||||
try {
|
||||
$(".collapse").on("shown.bs.collapse", function () {
|
||||
window.saveCollapsibleState($(this).attr("id"), "@Url.Action("SaveCollapsibleStatus")");
|
||||
});
|
||||
|
||||
$(".collapse").on("hidden.bs.collapse", function () {
|
||||
window.saveCollapsibleState($(this).attr("id"), "@Url.Action("SaveCollapsibleStatus")");
|
||||
});
|
||||
$(".collapse").on("hidden.bs.collapse", function () {
|
||||
window.saveCollapsibleState($(this).attr("id"), "@Url.Action("SaveCollapsibleStatus")");
|
||||
});
|
||||
|
||||
@if(TempData[TempDataConstants.PwChErrKey] is string passwordChangeError)
|
||||
{
|
||||
<text>
|
||||
$("#password-change-error-alert").html("@passwordChangeError");
|
||||
$("#password-change-error-alert").removeClass("d-none");
|
||||
$("#password-changing-popup").modal("show");
|
||||
@if(TempData[TempDataConstants.PwChErrKey] is string passwordChangeError)
|
||||
{
|
||||
<text>
|
||||
$("#password-change-error-alert").html("@passwordChangeError");
|
||||
$("#password-change-error-alert").removeClass("d-none");
|
||||
$("#password-changing-popup").modal("show");
|
||||
|
||||
$(".pw-prepend").ready(calcChPwPrepend);
|
||||
</text>
|
||||
}
|
||||
$(".pw-prepend").ready(calcChPwPrepend);
|
||||
</text>
|
||||
}
|
||||
|
||||
const supportConceptOid = parseInt($("#sb-cb2ScRelOid").val());
|
||||
const supportConceptOid = parseInt($("#sb-cb2ScRelOid").val());
|
||||
|
||||
const isSupportConceptSelected = supportConceptOid !== -1;
|
||||
const isSupportConceptSelected = supportConceptOid !== -1;
|
||||
|
||||
$("#single-booking-employee-container").find(".dropdown-toggle").prop("disabled", (isSupportConceptSelected ? false : true));
|
||||
$("#single-booking-employee-container").find(".dropdown-toggle").prop("disabled", (isSupportConceptSelected ? false : true));
|
||||
|
||||
changeSingleBookingFormEnableState(!isSupportConceptSelected);
|
||||
changeSingleBookingFormEnableState(!isSupportConceptSelected);
|
||||
|
||||
if("@Model.IsInGroupBookingMode".toLowerCase() === "true") {
|
||||
const hasSelectedSupportConcepts = "@Model.GroupBookingSelectedCostBearerSupportConceptOids.Any()".toLowerCase() === "true";
|
||||
if("@Model.IsInGroupBookingMode".toLowerCase() === "true") {
|
||||
const hasSelectedSupportConcepts = "@Model.GroupBookingSelectedCostBearerSupportConceptOids.Any()".toLowerCase() === "true";
|
||||
|
||||
changeGroupBookingFormEnableState(!hasSelectedSupportConcepts);
|
||||
}
|
||||
changeGroupBookingFormEnableState(!hasSelectedSupportConcepts);
|
||||
}
|
||||
|
||||
$("#fehlerdetail-textarea").prop("disabled", false);
|
||||
$("#fehlerdetail-textarea").prop("disabled", false);
|
||||
|
||||
if ("@Model.IsInMultiBookingMode".toLowerCase() === "true") {
|
||||
const isMultiBookingFormDisabled = "@Model.GroupBookingSelectedCostBearerSupportConceptOids.Any()".toLowerCase() === "false";
|
||||
if ("@Model.IsInMultiBookingMode".toLowerCase() === "true") {
|
||||
const isMultiBookingFormDisabled = "@Model.GroupBookingSelectedCostBearerSupportConceptOids.Any()".toLowerCase() === "false";
|
||||
|
||||
changeMultiBookingFormEnableState(isMultiBookingFormDisabled);
|
||||
}
|
||||
changeMultiBookingFormEnableState(isMultiBookingFormDisabled);
|
||||
}
|
||||
|
||||
initializeSignatureImagePopup();
|
||||
initializeSignatureImagePopup();
|
||||
|
||||
@if(TempData[TempDataConstants.ShowPwChPopupKey] is string passwordWarning && !string.IsNullOrEmpty(passwordWarning))
|
||||
{
|
||||
<text>
|
||||
showMessagePopupWithHtml("Achtung!", "@Html.Raw(passwordWarning)");
|
||||
</text>
|
||||
}
|
||||
@if(TempData[TempDataConstants.ShowPwChPopupKey] is string passwordWarning && !string.IsNullOrEmpty(passwordWarning))
|
||||
{
|
||||
<text>
|
||||
showMessagePopupWithHtml("Achtung!", "@Html.Raw(passwordWarning)");
|
||||
</text>
|
||||
}
|
||||
|
||||
setInputFilter();
|
||||
setInputFilter();
|
||||
|
||||
@if(Model.IsInGroupBookingMode)
|
||||
{
|
||||
<text>
|
||||
$("#create-button").prop("disabled", @Model.GroupBookingSelectedEmployees.Count === 0 ? true : false);
|
||||
</text>
|
||||
}
|
||||
@if(Model.IsInGroupBookingMode)
|
||||
{
|
||||
<text>
|
||||
$("#create-button").prop("disabled", @Model.GroupBookingSelectedEmployees.Count === 0 ? true : false);
|
||||
</text>
|
||||
}
|
||||
|
||||
@{
|
||||
var shouldShowSignaturePopup = TempData[TempDataConstants.ShowSignatureSuggestionPopup]?.GetType() == typeof(bool) && (bool) TempData[TempDataConstants.ShowSignatureSuggestionPopup];
|
||||
@{
|
||||
var shouldShowSignaturePopup = TempData[TempDataConstants.ShowSignatureSuggestionPopup]?.GetType() == typeof(bool) && (bool) TempData[TempDataConstants.ShowSignatureSuggestionPopup];
|
||||
|
||||
if(Model.LastCreatedServiceRecordOid > 0)
|
||||
{
|
||||
<text>
|
||||
//window.clearLocalBeWoStorage();
|
||||
</text>
|
||||
if(Model.LastCreatedServiceRecordOid > 0)
|
||||
{
|
||||
<text>
|
||||
//window.clearLocalBeWoStorage();
|
||||
</text>
|
||||
|
||||
if(shouldShowSignaturePopup && Model.ShowSignature)
|
||||
{
|
||||
<text>
|
||||
showMessagePopupWithCallback("Erfolgreich gespeichert", "Möchten Sie den Eintrag unterschreiben lassen?", function() {
|
||||
initializeSignature(@Model.LastCreatedServiceRecordOid);
|
||||
}, false);
|
||||
</text>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if(TempData[TempDataConstants.AppointmentOidKey] is long && false == Model.IsInGroupBookingMode && false == Model.IsInMultiBookingMode)
|
||||
{
|
||||
<text>
|
||||
if(shouldShowSignaturePopup && Model.ShowSignature)
|
||||
{
|
||||
<text>
|
||||
showMessagePopupWithCallback("Erfolgreich gespeichert", "Möchten Sie den Eintrag unterschreiben lassen?", function() {
|
||||
initializeSignature(@Model.LastCreatedServiceRecordOid);
|
||||
}, false);
|
||||
</text>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if(TempData[TempDataConstants.AppointmentOidKey] is long && false == Model.IsInGroupBookingMode && false == Model.IsInMultiBookingMode)
|
||||
{
|
||||
<text>
|
||||
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) {
|
||||
</text>
|
||||
}
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
});
|
||||
@@ -218,31 +203,31 @@
|
||||
function() {
|
||||
$("#signature-img").attr("src", null);
|
||||
$("#signature-text").html("");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function setInputFilter() {
|
||||
function setInputFilter() {
|
||||
$(`#sb-duration-input, #gb-duration-input, #mb-duration-input`).inputFilter(function(value, id) {
|
||||
var result = /^\d*$/;
|
||||
var result = /^\d*$/;
|
||||
|
||||
const prefix = id.split("-")[0];
|
||||
const dropdownButton = $(`#${prefix}-hours-minutes-dropdown-btn`);
|
||||
const prefix = id.split("-")[0];
|
||||
const dropdownButton = $(`#${prefix}-hours-minutes-dropdown-btn`);
|
||||
|
||||
const labelText = $(`#${prefix}-duration-label`).text().trim();
|
||||
const labelText = $(`#${prefix}-duration-label`).text().trim();
|
||||
|
||||
if(dropdownButton.length && dropdownButton.text().trim() === "Stunden" || labelText.endsWith("(h)")) {
|
||||
if(dropdownButton.length && dropdownButton.text().trim() === "Stunden" || labelText.endsWith("(h)")) {
|
||||
result = /^\d*[.,]?\d*$/;
|
||||
}
|
||||
|
||||
return result.test(value);
|
||||
});
|
||||
|
||||
$(`#sb-distance-input, #gb-distance-input, #mb-distance-input`).inputFilter(function(value, id) {
|
||||
$(`#sb-distance-input, #gb-distance-input, #mb-distance-input`).inputFilter(function(value, id) {
|
||||
return /^\d*[.,]?\d*$/.test(value);
|
||||
});
|
||||
|
||||
$(`#sb-betrag-input, #gb-betrag-input, #mb-betrag-input`).inputFilter(function(value, id) {
|
||||
$(`#sb-betrag-input, #gb-betrag-input, #mb-betrag-input`).inputFilter(function(value, id) {
|
||||
return /^\d*([.,]?\d{0,2})?$/.test(value);
|
||||
});
|
||||
}
|
||||
@@ -265,7 +250,7 @@
|
||||
}(jQuery));
|
||||
|
||||
$(window).resize(function() {
|
||||
updateCanvasSize($("#sketch-pad"));
|
||||
updateCanvasSize($("#sketch-pad"));
|
||||
});
|
||||
|
||||
function getSetServiceRecordEmployeeUrl() {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using BeWoPlanerMobil.Models
|
||||
@using BeWoPlanerMobil.Util
|
||||
@using BeWoPlanerMobil.Util
|
||||
@model BeWoPlanerMobil.Models.MainModel
|
||||
|
||||
@{
|
||||
@@ -26,20 +25,33 @@
|
||||
selectedGroups.push($(this).attr("value"));
|
||||
});
|
||||
|
||||
$("#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);
|
||||
$("#mb-sc-cb-rel-tab-content").load("@Url.Action("AddScCbRelsToMultiBooking")",
|
||||
{
|
||||
relOids: selectedSupportConcepts,
|
||||
groupOids: selectedGroups
|
||||
},
|
||||
function() {
|
||||
updateLocallyStoredMultiBookingCb2ScRelOids();
|
||||
|
||||
$("#tree").load("@Url.Action("LoadUpToDateTextModules")");
|
||||
$("#multibooking-selection-container").load("@Url.Action("ReloadMultiBookingForm")", function () {
|
||||
changeMultiBookingFormEnableState($(".mb-cb2sc-input:checkbox:checked").length > 0 ? false : true);
|
||||
|
||||
$("#tree").load("@Url.Action("LoadUpToDateTextModules")");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function removeSupportConceptCostBearerRel(relOid) {
|
||||
$(`#mb-cb2sc-checkbox-${relOid}`).prop("checked", false);
|
||||
|
||||
$("#multibooking-selection-container").load("@Url.Action("RemoveSupportConceptCostbearerRelFromMultiBooking")", {relOid: relOid}
|
||||
, function () {
|
||||
updateLocallyStoredMultiBookingCb2ScRelOids();
|
||||
|
||||
$("#multibooking-selection-container").load("@Url.Action("RemoveSupportConceptCostbearerRelFromMultiBooking")",
|
||||
{
|
||||
relOid: relOid
|
||||
}
|
||||
,
|
||||
function() {
|
||||
$("#goals-tree").load("@Url.Action("ReloadGoals")"
|
||||
, function () {
|
||||
changeMultiBookingFormEnableState($(".mb-cb2sc-input:checkbox:checked").length > 0 ? false : true);
|
||||
@@ -53,24 +65,12 @@
|
||||
|
||||
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));
|
||||
window.updateCbScRelOids("mb", cb2ScOidString.slice(0, -1));
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
<div class="form-row mt-2">
|
||||
<div class="col-md">
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" class="custom-control-input" name="marker-cb" id="mb-marker-cb" />
|
||||
<input type="checkbox" class="custom-control-input" onchange="window.updateMarker('mb', $(this).prop('checked'));" name="marker-cb" id="mb-marker-cb" />
|
||||
<label class="custom-control-label" for="mb-marker-cb">Marker</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -150,7 +150,7 @@
|
||||
Startdatum
|
||||
</span>
|
||||
</div>
|
||||
<input class="form-control" type="date" name="Datum" id="mb-start-date-input" onchange="calcDuration('mb', false, true, false)" value="@startDate" />
|
||||
<input class="form-control" type="date" name="Datum" id="mb-start-date-input" onchange="calcDuration('mb', false, true, false); window.updateStartDate('mb', $(this).val());" value="@startDate" />
|
||||
</div>
|
||||
</div>
|
||||
@if(Model.IsEndDateVisible)
|
||||
@@ -162,7 +162,7 @@
|
||||
Enddatum
|
||||
</span>
|
||||
</div>
|
||||
<input class="form-control" type="date" name="Enddatum" id="mb-end-date-input" onchange="calcDuration('mb', false, false, true)" value="@endDate" />
|
||||
<input class="form-control" type="date" name="Enddatum" id="mb-end-date-input" onchange="calcDuration('mb', false, false, true); window.updateEndDate('mb', $(this).val());" value="@endDate" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -197,11 +197,11 @@
|
||||
Von
|
||||
</span>
|
||||
</div>
|
||||
<input class="form-control" type="time" name="Start" id="mb-start-time-input" onchange="calcDuration('mb', false, true, false)" value="@startTimeValue" />
|
||||
<input class="form-control" type="time" name="Start" id="mb-start-time-input" onchange="calcDuration('mb', false, true, false); window.updateStartTime('mb', $(this).val());" value="@startTimeValue" />
|
||||
<span class="input-group-text rounded-0 border-left-0 border-right-0">
|
||||
Bis
|
||||
</span>
|
||||
<input class="form-control" type="time" name="Ende" id="mb-end-time-input" onchange="calcDuration('mb', false, false, true)" value="@endTimeValue" />
|
||||
<input class="form-control" type="time" name="Ende" id="mb-end-time-input" onchange="calcDuration('mb', false, false, true); window.updateEndTime('mb', $(this).val());" value="@endTimeValue" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -219,7 +219,7 @@
|
||||
@labelText
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" autocomplete="on" class="form-control" id="mb-duration-input" name="Dauer" onchange="beiDaueraenderung('mb')" value="@durationValue">
|
||||
<input type="text" autocomplete="on" class="form-control" id="mb-duration-input" name="Dauer" onchange="beiDaueraenderung('mb'); window.updateDuration('mb', $(this).val());" value="@durationValue">
|
||||
@if(Model.IsZeiterfassungInStdMin)
|
||||
{
|
||||
<div class="input-group-append">
|
||||
@@ -249,7 +249,7 @@
|
||||
Gefahrene Kilometer
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" autocomplete="on" class="form-control" id="mb-distance-input" name="Distanz" onchange="validateDistanceInput()" value="@distance">
|
||||
<input type="text" autocomplete="on" class="form-control" id="mb-distance-input" name="Distanz" onchange="validateDistanceInput(); window.updateDistance('mb', $(this).val());" value="@distance">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -273,7 +273,7 @@
|
||||
{
|
||||
<div class="form-group mt-2">
|
||||
<label for="mb-doku-textarea">Dokumentation</label>
|
||||
<textarea class="form-control" autocomplete="on" name="Dokumentation6" id="mb-doku-textarea">@notice0</textarea>
|
||||
<textarea class="form-control" autocomplete="on" name="Dokumentation6" id="mb-doku-textarea" onchange="window.updateDokuText('mb', $(this).val(), 6)">@notice0</textarea>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
@@ -296,7 +296,7 @@
|
||||
var textareaName = i + 1 < 1 ? "Dokumentation" : "Dokumentation" + (i + 1);
|
||||
|
||||
<div class="tab-pane show@(i == 0 ? " active" : string.Empty)" id="mb-doku_@i" role="tabpanel">
|
||||
<textarea class="form-control doku-form-control" autocomplete="on" id="mb-doku-textarea-@i" name="@textareaName">@noticeList[i]</textarea>
|
||||
<textarea class="form-control doku-form-control" onchange="window.updateDokuText('mb', $(this).val(), @i)" autocomplete="on" id="mb-doku-textarea-@i" name="@textareaName">@noticeList[i]</textarea>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -315,6 +315,5 @@
|
||||
}
|
||||
|
||||
@Html.Partial("RestoreServiceRecordInputsPartial", Model)
|
||||
|
||||
</div>
|
||||
}
|
||||
@@ -6,103 +6,123 @@
|
||||
{
|
||||
<text>
|
||||
<script type="text/javascript">
|
||||
$("#second-logout-form").submit();
|
||||
$("#second-logout-form").submit();
|
||||
</script>
|
||||
</text>
|
||||
}
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$("#mb-hours-minutes-dropdown-btn").on("click",
|
||||
function() {
|
||||
$("#mb-hours-minutes-dropdown-btn").data("text", $("#mb-hours-minutes-dropdown-btn").text().replaceAll(/\s/g, ""));
|
||||
});
|
||||
window.addEventListener("load", function() {
|
||||
@if(TempData[TempDataConstants.SupportConceptRelSelectedKey] is true)
|
||||
{
|
||||
<text>
|
||||
window.updateCategory("@Model.BookingModePrefix", @Model.SelectedServiceCategoryOid);
|
||||
window.updateServiceDescription("@Model.BookingModePrefix", @Model.SelectedServiceDescriptionOid);
|
||||
window.updateEmployeeOids("@Model.BookingModePrefix", getMultiBookingEmployeeOids());
|
||||
window.updateStartDate("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-start-date-input`).val());
|
||||
window.updateStartTime("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-start-time-input`).val());
|
||||
window.updateEndDate("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-end-date-input`).val());
|
||||
window.updateEndTime("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-end-time-input`).val());
|
||||
</text>
|
||||
}
|
||||
});
|
||||
|
||||
$(".hours-minutes-link").on("click",
|
||||
function() {
|
||||
const previousText = $("#mb-hours-minutes-dropdown-btn").data("text");
|
||||
const currentText = $(this).text().replaceAll(/\s/g, "");
|
||||
$(document).ready(function () {
|
||||
$("#mb-hours-minutes-dropdown-btn").on("click",
|
||||
function() {
|
||||
$("#mb-hours-minutes-dropdown-btn").data("text", $("#mb-hours-minutes-dropdown-btn").text().replaceAll(/\s/g, ""));
|
||||
});
|
||||
|
||||
if(previousText === currentText) {
|
||||
return;
|
||||
}
|
||||
$(".hours-minutes-link").on("click",
|
||||
function() {
|
||||
const previousText = $("#mb-hours-minutes-dropdown-btn").data("text");
|
||||
const currentText = $(this).text().replaceAll(/\s/g, "");
|
||||
|
||||
const buttonText = $(this).text();
|
||||
$("#mb-hours-minutes-dropdown-btn").text(buttonText);
|
||||
if(previousText === currentText) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.setInputFilter('mb-duration-input', 'mb-distance-input', 'mb-hours-minutes-dropdown-btn');
|
||||
const buttonText = $(this).text();
|
||||
$("#mb-hours-minutes-dropdown-btn").text(buttonText);
|
||||
|
||||
$.get('@Url.Action("ToggleDurationUnit")', { isInHoursMode: buttonText === "Stunden" });
|
||||
window.setInputFilter('mb-duration-input', 'mb-distance-input', 'mb-hours-minutes-dropdown-btn');
|
||||
|
||||
calcDuration("mb", true, false, false);
|
||||
});
|
||||
});
|
||||
$.get('@Url.Action("ToggleDurationUnit")', { isInHoursMode: buttonText === "Stunden" });
|
||||
|
||||
function addEmployeeToMultiBooking() {
|
||||
var selectedEmployees = [];
|
||||
calcDuration("mb", true, false, false);
|
||||
});
|
||||
});
|
||||
|
||||
let oidString = "";
|
||||
function addEmployeeToMultiBooking() {
|
||||
const oidString = getMultiBookingEmployeeOids();
|
||||
|
||||
$("#mb-employee-selection-popup input:checked").each(function() {
|
||||
selectedEmployees.push($(this).val());
|
||||
});
|
||||
window.updateEmployeeOids("mb", oidString);
|
||||
|
||||
for(let i = 0; i < selectedEmployees.length; i++) {
|
||||
oidString += selectedEmployees[i];
|
||||
$.get("@Url.Action("AddEmployeesToMultiBooking")", { pEmployeeOids: oidString }).done(function(numberOfSelectedEmployees) {
|
||||
$("#mb-selected-employees-count-badge").text(numberOfSelectedEmployees);
|
||||
|
||||
if(i < selectedEmployees.length - 1) {
|
||||
oidString += ",";
|
||||
}
|
||||
}
|
||||
$("#mb-create-btn").prop("disabled", numberOfSelectedEmployees === "0" ? true : false);
|
||||
});
|
||||
}
|
||||
|
||||
const storage = window.getBeWoStorage();
|
||||
storage.updateMultiBookingSelectedEmployeeOids(oidString);
|
||||
function getMultiBookingEmployeeOids() {
|
||||
var selectedEmployees = [];
|
||||
|
||||
$.get("@Url.Action("AddEmployeesToMultiBooking")", { pEmployeeOids: oidString }).done(function(numberOfSelectedEmployees) {
|
||||
$("#mb-selected-employees-count-badge").text(numberOfSelectedEmployees);
|
||||
let oidString = "";
|
||||
|
||||
$("#mb-create-btn").prop("disabled", numberOfSelectedEmployees === "0" ? true : false);
|
||||
});
|
||||
}
|
||||
$("#mb-employee-selection-popup input:checked").each(function() {
|
||||
selectedEmployees.push($(this).val());
|
||||
});
|
||||
|
||||
function submitMultiBookingForm() {
|
||||
showSpinner();
|
||||
for(let i = 0; i < selectedEmployees.length; i++) {
|
||||
oidString += selectedEmployees[i];
|
||||
|
||||
$.get("@Url.Action("MultiBookingHasSelectedSupportConcepts")").done(function (result1) {
|
||||
if(false === checkJson(result1)) {
|
||||
hideSpinner();
|
||||
return;
|
||||
}
|
||||
if(i < selectedEmployees.length - 1) {
|
||||
oidString += ",";
|
||||
}
|
||||
}
|
||||
|
||||
$.get("@Url.Action("MultiBookingHasSelectedEmployees")").done(function (result2) {
|
||||
if(false === checkJson(result2)) {
|
||||
hideSpinner();
|
||||
return;
|
||||
}
|
||||
return oidString;
|
||||
}
|
||||
|
||||
const hasSupportConcepts = parseJason(result1);
|
||||
const hasEmployees = parseJason(result2);
|
||||
function submitMultiBookingForm() {
|
||||
showSpinner();
|
||||
|
||||
if (hasSupportConcepts && hasEmployees) {
|
||||
validateForm($("#multiBookingForm"), "mb");
|
||||
} else {
|
||||
hideSpinner();
|
||||
let message = "";
|
||||
$.get("@Url.Action("MultiBookingHasSelectedSupportConcepts")").done(function (result1) {
|
||||
if(false === checkJson(result1)) {
|
||||
hideSpinner();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasSupportConcepts && !hasEmployees) {
|
||||
message = "Bitte wählen Sie mindestens einen Hilfeplan und Mitarbeiter aus.";
|
||||
} else if(hasSupportConcepts && !hasEmployees) {
|
||||
message = "Bitte wählen Sie mindestens einen Mitarbeiter aus.";
|
||||
} else {
|
||||
message = "Bitte wählen Sie mindestens einen Hilfeplan aus.";
|
||||
}
|
||||
$.get("@Url.Action("MultiBookingHasSelectedEmployees")").done(function (result2) {
|
||||
if(false === checkJson(result2)) {
|
||||
hideSpinner();
|
||||
return;
|
||||
}
|
||||
|
||||
showAlertMessageBoxWithoutCallback("Speichern nicht möglich", message);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
const hasSupportConcepts = parseJason(result1);
|
||||
const hasEmployees = parseJason(result2);
|
||||
|
||||
if (hasSupportConcepts && hasEmployees) {
|
||||
validateForm($("#multiBookingForm"), "mb");
|
||||
} else {
|
||||
hideSpinner();
|
||||
let message = "";
|
||||
|
||||
if (!hasSupportConcepts && !hasEmployees) {
|
||||
message = "Bitte wählen Sie mindestens einen Hilfeplan und Mitarbeiter aus.";
|
||||
} else if(hasSupportConcepts && !hasEmployees) {
|
||||
message = "Bitte wählen Sie mindestens einen Mitarbeiter aus.";
|
||||
} else {
|
||||
message = "Bitte wählen Sie mindestens einen Hilfeplan aus.";
|
||||
}
|
||||
|
||||
showAlertMessageBoxWithoutCallback("Speichern nicht möglich", message);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="col-md">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@* (Mehrfachbuchung) Ausgewählte Hilfepläne *@
|
||||
<div class="form-row">
|
||||
|
||||
@@ -1,483 +1,266 @@
|
||||
|
||||
@using BeWoPlanerMobil.Service
|
||||
@using BeWoPlanerMobil.Util
|
||||
@using BS.Shared
|
||||
@model BeWoPlanerMobil.Models.MainModel
|
||||
|
||||
@*
|
||||
ToDo: Bei Hilfeplan schauen, ob die Ziele/Maßnahmen, Kategorie/Leistung, Textbausteines korrekt sind.
|
||||
*@
|
||||
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;
|
||||
selectedServiceDescription;
|
||||
selectedServiceCategory;
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
updateServiceDescription(serviceDescriptionOid) {
|
||||
this.selectedServiceDescription = serviceDescriptionOid;
|
||||
logInfo3(`Leistung ${this.selectedServiceDescription} lokal gespeichert`);
|
||||
localStorage.setItem(this.id, JSON.stringify(this));
|
||||
}
|
||||
|
||||
updateServiceCategory(serviceCategoryOid) {
|
||||
this.selectedServiceCategory = serviceCategoryOid;
|
||||
|
||||
localStorage.setItem(this.id, JSON.stringify(this));
|
||||
}
|
||||
|
||||
print() {
|
||||
let gbCb2ScOids = "";
|
||||
for(let i = 0; i < this.groupBookingCb2ScRelOids; i++) {
|
||||
gbCb2ScOids += `${this.groupBookingCb2ScRelOids[i]}, `;
|
||||
}
|
||||
gbCb2ScOids = gbCb2ScOids.trim();
|
||||
|
||||
let gbGroupOids = "";
|
||||
for(let i = 0; i < this.groupBookingGroupOids; i++) {
|
||||
gbGroupOids += `${this.groupBookingGroupOids[i]}, `;
|
||||
}
|
||||
gbGroupOids = gbGroupOids.trim();
|
||||
|
||||
let gbEmployeeOids = "";
|
||||
for(let i = 0; i < this.groupBookingEmployeeOids; i++) {
|
||||
gbEmployeeOids += `${this.groupBookingEmployeeOids[i]}, `;
|
||||
}
|
||||
gbEmployeeOids = gbEmployeeOids.trim();
|
||||
|
||||
let mbCb2ScOids = "";
|
||||
for(let i = 0; i < this.multiBookingCb2ScRelOids; i++) {
|
||||
mbCb2ScOids += `${this.multiBookingCb2ScRelOids[i]}, `;
|
||||
}
|
||||
mbCb2ScOids = mbCb2ScOids.trim();
|
||||
|
||||
let mbGroupOids = "";
|
||||
for(let i = 0; i < this.multiBookingGroupOids; i++) {
|
||||
mbGroupOids += `${this.multiBookingGroupOids[i]}, `;
|
||||
}
|
||||
mbGroupOids = mbGroupOids.trim();
|
||||
|
||||
let mbEmployeeOids = "";
|
||||
for(let i = 0; i < this.multiBookingEmployeeOids; i++) {
|
||||
mbEmployeeOids = `${this.multiBookingEmployeeOids[i]}, `;
|
||||
}
|
||||
mbEmployeeOids = mbEmployeeOids.trim();
|
||||
|
||||
let output =
|
||||
"Lese lokalen BeWo-Speicher aus:\r\n" +
|
||||
"----------------------------------------------\r\n" +
|
||||
`Id: ${this.id}\r\n` +
|
||||
"----------------------------------------------\r\n" +
|
||||
`HPs Gruppenbuchung: ${gbCb2ScOids}\r\n` +
|
||||
`Gruppen Gruppenbuchung: ${gbGroupOids}\r\n` +
|
||||
`MAs Gruppenbuchung: ${gbEmployeeOids}\r\n` +
|
||||
"----------------------------------------------\r\n" +
|
||||
`HPs Mehrfachbuchung: ${mbCb2ScOids}\r\n` +
|
||||
`Gruppen Mehrfachbuchung: ${mbGroupOids}\r\n` +
|
||||
`MAs Mehrfachbuchung: ${mbEmployeeOids}\r\n` +
|
||||
"----------------------------------------------\r\n" +
|
||||
`Leistung: ${this.selectedServiceDescription}\r\n` +
|
||||
"----------------------------------------------\r\n";
|
||||
|
||||
for(let i = 0; i < this.inputList.length; i++) {
|
||||
const input = this.inputList[i];
|
||||
|
||||
output += `${input.inputId}; ${input.inputValue}; ${input.inputType}; ${input.inputName}; ${input.timeStamp}\r\n`;
|
||||
}
|
||||
|
||||
logColorfulMessage(output, "#FF5A00");
|
||||
}
|
||||
@if(TempData[TempDataConstants.AfterRestoreKey] is true)
|
||||
{
|
||||
<text>
|
||||
//clearLocalBeWoStorage();
|
||||
</text>
|
||||
}
|
||||
|
||||
function getLocalStorageKey() {
|
||||
return "@MobileSessionFacade.LocalStorageKey";
|
||||
}
|
||||
|
||||
function getBeWoStorage() {
|
||||
const localStorageKey = getLocalStorageKey();
|
||||
function updateGoals2Ratings(prefix, map) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}`, [...map]);
|
||||
}
|
||||
|
||||
const unparsedLocalStorageJson = localStorage.getItem(localStorageKey);
|
||||
function updateCbScRelOids(prefix, csv) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}Cb2ScRelOid${(prefix === "sb" ? "" : "s")}`, csv);
|
||||
}
|
||||
|
||||
let beWoStorage = new LocalBeWoStorage(localStorageKey, []);
|
||||
function updateEmployeeOids(prefix, csv) {
|
||||
logInfo3(`Speichere die MitarbeiterOids: ${csv}`);
|
||||
|
||||
if(unparsedLocalStorageJson === null || unparsedLocalStorageJson === undefined || unparsedLocalStorageJson.length === 0) {
|
||||
localStorage.setItem(localStorageKey, JSON.stringify(beWoStorage));
|
||||
} else {
|
||||
const parsedJson = JSON.parse(unparsedLocalStorageJson);
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}EmployeeOids`, csv);
|
||||
}
|
||||
|
||||
beWoStorage = new LocalBeWoStorage(localStorageKey, parsedJson.inputList);
|
||||
}
|
||||
function updateCategory(prefix, categoryOid) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}Category`, categoryOid);
|
||||
}
|
||||
|
||||
return beWoStorage;
|
||||
function updateServiceDescription(prefix, serviceDescriptionOid) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}ServiceDescription`, serviceDescriptionOid);
|
||||
}
|
||||
|
||||
function updateStartDate(prefix, startDate) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}StartDate`, startDate);
|
||||
}
|
||||
|
||||
function updateStartTime(prefix, startTime) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}StartTime`, startTime);
|
||||
}
|
||||
|
||||
function updateEndDate(prefix, endDate) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}EndDate`, endDate);
|
||||
}
|
||||
|
||||
function updateEndTime(prefix, endTime) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}EndTime`, endTime);
|
||||
}
|
||||
|
||||
function updateDuration(prefix, duration) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}Duration`, duration);
|
||||
}
|
||||
|
||||
function updateDistance(prefix, distance) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}Distance`, distance);
|
||||
}
|
||||
|
||||
function updateMarker(prefix, marker) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}Marker`, marker);
|
||||
}
|
||||
|
||||
function updateBetrag(prefix, betrag) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}Betrag`, betrag);
|
||||
}
|
||||
|
||||
function updateDokuText(prefix, text, nr) {
|
||||
localStorage.setItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}Doku${(nr + 1)}`, text);
|
||||
}
|
||||
|
||||
function removeGoals2Ratings(prefix) {
|
||||
localStorage.removeItem(`@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}Goals2Ratings`);
|
||||
}
|
||||
|
||||
function clearLocalBeWoStorage() {
|
||||
const beWoStorage = getBeWoStorage();
|
||||
for(let i = 0; i < localStorage.length; i++) {
|
||||
const key = localStorage.key(i);
|
||||
|
||||
beWoStorage.clearInputList();
|
||||
if(!key.startsWith(`@MobileSessionFacade.LocalStorageKey`)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
localStorage.removeItem(key);
|
||||
}
|
||||
}
|
||||
|
||||
function getRestoreButtonState() {
|
||||
const beWoStorage = getBeWoStorage();
|
||||
function updateGoal2Rating(prefix, goalOid, ratingTypeOid) {
|
||||
const localStorageKey = `@MobileSessionFacade.LocalStorageKey-${firstCharToUpperCase(prefix)}Goals2Ratings`;
|
||||
|
||||
return beWoStorage.inputList.length > 0;
|
||||
const stored = localStorage.getItem(localStorageKey);
|
||||
const map = stored ? new Map(JSON.parse(stored)) : new Map();
|
||||
|
||||
map.set(goalOid, ratingTypeOid);
|
||||
|
||||
localStorage.setItem(localStorageKey, JSON.stringify([...map]));
|
||||
}
|
||||
|
||||
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 printLocalStorage() {
|
||||
$("#dev-popup-body").html("");
|
||||
|
||||
function restoreField(id) {
|
||||
const beWoStorage = getBeWoStorage();
|
||||
let output = "";
|
||||
|
||||
const inputObj = beWoStorage.getItemById(id);
|
||||
let singleBookingOutput = "<h2>Einzelbuchung</h2><table class='table table-sm table-striped'>" +
|
||||
"<thead>" +
|
||||
"<tr>" +
|
||||
"<th scope='col'>Id</th>" +
|
||||
"<th scope='col'>Wert</th>" +
|
||||
"</tr>" +
|
||||
"</thead>";
|
||||
|
||||
if(inputObj === undefined || inputObj === null) {
|
||||
return;
|
||||
let groupBookingOutput = "<h2 class='mt-3'>Gruppenbuchung</h2><table class='table table-sm table-striped'>" +
|
||||
"<thead>" +
|
||||
"<tr>" +
|
||||
"<th scope='col'>Id</th>" +
|
||||
"<th scope='col'>Wert</th>" +
|
||||
"</tr>" +
|
||||
"</thead>";
|
||||
|
||||
let multiBookingOutput = "<h2 class='mt-3'>Mehrfachbuchung</h2><table class='table table-sm table-striped'>" +
|
||||
"<thead>" +
|
||||
"<tr>" +
|
||||
"<th scope='col'>Id</th>" +
|
||||
"<th scope='col'>Wert</th>" +
|
||||
"</tr>" +
|
||||
"</thead>";
|
||||
|
||||
for(let i = 0; i < localStorage.length; i++) {
|
||||
const key = localStorage.key(i);
|
||||
|
||||
if(false === key.startsWith(`@MobileSessionFacade.LocalStorageKey-`)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const value = localStorage.getItem(key);
|
||||
|
||||
if(key.startsWith(`@MobileSessionFacade.LocalStorageKey-Sb`)) {
|
||||
singleBookingOutput += `<tr><td>${key}</td><td>${value}</td></tr>`;
|
||||
} else if(key.startsWith(`@MobileSessionFacade.LocalStorageKey-Gb`)) {
|
||||
groupBookingOutput += `<tr><td>${key}</td><td>${value}</td></tr>`;
|
||||
} else if(key.startsWith(`@MobileSessionFacade.LocalStorageKey-Mb`)) {
|
||||
multiBookingOutput += `<tr><td>${key}</td><td>${value}</td></tr>`;
|
||||
}
|
||||
}
|
||||
|
||||
$(`#${id}`).val(inputObj.inputValue);
|
||||
$(`#${id}`).trigger("change");
|
||||
}
|
||||
singleBookingOutput += "</table>";
|
||||
groupBookingOutput += "</table>";
|
||||
multiBookingOutput += "</table>";
|
||||
|
||||
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 saveServiceDescriptionLocally(serviceDescriptionOid) {
|
||||
const beWoStorage = getBeWoStorage();
|
||||
|
||||
beWoStorage.updateServiceDescription(serviceDescriptionOid);
|
||||
|
||||
const storage = getBeWoStorage();
|
||||
logInfo2(`Leistungs-Oid: ${storage.selectedServiceDescription}`);
|
||||
}
|
||||
|
||||
function saveServiceCategoryLocally(serviceCategoryOid) {
|
||||
const beWoStorage = getBeWoStorage();
|
||||
|
||||
beWoStorage.updateServiceCategory(serviceCategoryOid);
|
||||
output += singleBookingOutput + "<hr>" + groupBookingOutput + "<hr>" + multiBookingOutput;
|
||||
$("#dev-local-storage-body").html(`<div class='btn-group my-3' role='group'><button type='button' class='btn btn-outline-danger' onclick=''><span class='fas fa-trash-alt'></span></button></div><hr>${
|
||||
output}`);
|
||||
$("#dev-local-storage").modal("show");
|
||||
}
|
||||
|
||||
function restoreAllFields() {
|
||||
const beWoStorage = getBeWoStorage();
|
||||
const bookingMode = @((int) Model.CurrentBookingMode);
|
||||
|
||||
//$.each(beWoStorage.inputList, (index, item) => {
|
||||
// logInfo3(`Id: ${item.inputId}; Wert: ${item.inputValue};`);
|
||||
//});
|
||||
const prefix = bookingMode === 0 ? "Sb" : bookingMode === 1 ? "Gb" : "Mb";
|
||||
|
||||
$("#srr-gb-cb2sc-oids").val(beWoStorage.groupBookingCb2ScRelOids);
|
||||
$("#srr-gb-group-oids").val(beWoStorage.groupBookingGroupOids);
|
||||
$("#srr-gb-emp-oids").val(beWoStorage.groupBookingEmployeeOids);
|
||||
$("#srr-gb-cb2sc-oids").val(localStorage.getItem(`@MobileSessionFacade.LocalStorageKey-GbCb2ScRelOids`));
|
||||
$("#srr-gb-emp-oids").val(localStorage.getItem(`@MobileSessionFacade.LocalStorageKey-GbEmployeeOids`));
|
||||
|
||||
$("#srr-mb-cb2sc-oids").val(beWoStorage.multiBookingCb2ScRelOids);
|
||||
$("#srr-mb-group-oids").val(beWoStorage.multiBookingGroupOids);
|
||||
$("#srr-mb-emp-oids").val(beWoStorage.multiBookingEmployeeOids);
|
||||
$("#srr-mb-cb2sc-oids").val(localStorage.getItem(`@MobileSessionFacade.LocalStorageKey-MbCb2ScRelOids`));
|
||||
$("#srr-mb-emp-oids").val(localStorage.getItem(`@MobileSessionFacade.LocalStorageKey-MbEmployeeOids`));
|
||||
|
||||
window.saveItemValueLocally(document.getElementById("sb-start-date-input"));
|
||||
window.saveItemValueLocally(document.getElementById("gb-start-date-input"));
|
||||
window.saveItemValueLocally(document.getElementById("mb-start-date-input"));
|
||||
|
||||
window.saveItemValueLocally(document.getElementById("sb-end-date-input"));
|
||||
window.saveItemValueLocally(document.getElementById("gb-end-date-input"));
|
||||
window.saveItemValueLocally(document.getElementById("mb-end-date-input"));
|
||||
|
||||
$.each(beWoStorage.inputList, (index, item) => {
|
||||
if (item.inputType === "checkbox") {
|
||||
$(`#${item.inputId}`).prop("checked", item.inputValue);
|
||||
} else {
|
||||
$(`#${item.inputId}`).val(item.inputValue);
|
||||
}
|
||||
});
|
||||
$("#srr-start-date-input").val(localStorage.getItem(`@MobileSessionFacade.LocalStorageKey-${prefix}StartDate`));
|
||||
$("#srr-start-time-input").val(localStorage.getItem(`@MobileSessionFacade.LocalStorageKey-${prefix}StartTime`));
|
||||
$("#srr-end-date-input").val(localStorage.getItem(`@MobileSessionFacade.LocalStorageKey-${prefix}EndDate`));
|
||||
$("#srr-end-time-input").val(localStorage.getItem(`@MobileSessionFacade.LocalStorageKey-${prefix}EndTime`));
|
||||
|
||||
const gbStartDateInput = $("#gb-start-date-input");
|
||||
const mbStartDateInput = $("#mb-start-date-input");
|
||||
|
||||
let bookingMode = 0;
|
||||
//$("#srr-marker-cb").val();
|
||||
//$("#srr-betrag").val();
|
||||
|
||||
if(gbStartDateInput.length) {
|
||||
bookingMode = 1;
|
||||
} else if(mbStartDateInput.length) {
|
||||
bookingMode = 2;
|
||||
}
|
||||
//$("#srr-duration-input").val();
|
||||
|
||||
beWoStorage.print();
|
||||
//$("#srr-distance-input").val();
|
||||
|
||||
//$("#srr-booking-mode").val(bookingMode);
|
||||
//$("#srr-doku-textarea-1").val(beWoStorage.getItemValueById(`${prefix}doku-textarea-0`));
|
||||
//$("#srr-doku-textarea-2").val(beWoStorage.getItemValueById(`${prefix}doku-textarea-1`));
|
||||
//$("#srr-doku-textarea-3").val(beWoStorage.getItemValueById(`${prefix}doku-textarea-2`));
|
||||
//$("#srr-doku-textarea-4").val(beWoStorage.getItemValueById(`${prefix}doku-textarea-3`));
|
||||
//$("#srr-doku-textarea-5").val(beWoStorage.getItemValueById(`${prefix}doku-textarea-4`));
|
||||
//$("#srr-doku-textarea-6").val(beWoStorage.getItemValueById(`${prefix}doku-textarea`));
|
||||
|
||||
$("#srr-booking-mode").val(bookingMode);
|
||||
|
||||
//$("#restore-service-record-form").submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
@using(Html.BeginForm("RestoreServiceRecordForm", "Main", FormMethod.Post, new {id="restore-service-record-form"}))
|
||||
@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-leistung-select" name="@FormCollectionConstants.ServiceDescriptionKey" />
|
||||
|
||||
<input type="hidden" id="srr-start-date-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-start-time-input" name="@FormCollectionConstants.StartKey" />
|
||||
<input type="hidden" id="srr-end-date-input" name="@FormCollectionConstants.EndDateKey" />
|
||||
|
||||
<input type="hidden" id="srr-marker-cb" name="@FormCollectionConstants.MarkerKey" />
|
||||
|
||||
<input type="hidden" id="srr-betrag" name="@FormCollectionConstants.BetragKey" />
|
||||
|
||||
<input type="hidden" id="srr-duration-input" name="@FormCollectionConstants.DurationKey" />
|
||||
|
||||
<input type="hidden" id="srr-distance-input" name="@FormCollectionConstants.DistanceKey" />
|
||||
|
||||
<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-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" />
|
||||
|
||||
<input type="hidden" id="srr-booking-mode" name="@FormCollectionConstants.BookingModeKey"/>
|
||||
<input type="hidden" id="srr-booking-mode" name="@FormCollectionConstants.BookingModeKey" />
|
||||
|
||||
<button type="button" class="btn btn-bewo-dev bewo-restore-btn" onclick="window.restoreAllFields()">
|
||||
<i class="fas fa-recycle"></i>
|
||||
</button>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@if(Html.IsInDebugMode())
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="local-storage-popup">
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title font-weight-bold">Lokaler Speicher</h5>
|
||||
<button class="close" type="button" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="local-storage-popup-body">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" type="button" data-dismiss="modal">Schließen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -5,147 +5,167 @@
|
||||
@model MainModel
|
||||
|
||||
@{
|
||||
if(TempData[TempDataConstants.DoLogoutKey] is bool and true)
|
||||
if(TempData[TempDataConstants.DoLogoutKey] is true)
|
||||
{
|
||||
<text>
|
||||
<script type="text/javascript">
|
||||
$("#second-logout-form").submit();
|
||||
$("#second-logout-form").submit();
|
||||
</script>
|
||||
</text>
|
||||
}
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
const dropdownBtn = $("#sb-hours-minutes-dropdown-btn");
|
||||
window.addEventListener("load", function() {
|
||||
@if(TempData[TempDataConstants.SupportConceptRelSelectedKey] is true)
|
||||
{
|
||||
<text>
|
||||
window.updateCategory("@Model.BookingModePrefix", @Model.SelectedServiceCategoryOid);
|
||||
window.updateServiceDescription("@Model.BookingModePrefix", @Model.SelectedServiceDescriptionOid);
|
||||
// ToDo: 08.09.2025: $("#sb-employee-input") ist bei der HP-Auswahl nicht gesetzt!
|
||||
const employeeOid = $("#sb-employee-input").val();
|
||||
|
||||
dropdownBtn.on("click", function() {
|
||||
dropdownBtn.data("text", dropdownBtn.text().replaceAll(/\s/g, ""));
|
||||
});
|
||||
window.updateEmployeeOids("@Model.BookingModePrefix", $("#sb-employee-input").val());
|
||||
window.updateStartDate("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-start-date-input`).val());
|
||||
window.updateStartTime("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-start-time-input`).val());
|
||||
window.updateEndDate("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-end-date-input`).val());
|
||||
window.updateEndTime("@Model.BookingModePrefix", $(`#@Model.BookingModePrefix-end-time-input`).val());
|
||||
</text>
|
||||
}
|
||||
});
|
||||
|
||||
$(".hours-minutes-link").on("click", function () {
|
||||
const previousText = dropdownBtn.data("text");
|
||||
const currentText = $(this).text().replaceAll(/\s/g, "");
|
||||
$(document).ready(function() {
|
||||
const dropdownBtn = $("#sb-hours-minutes-dropdown-btn");
|
||||
|
||||
if(previousText === currentText) {
|
||||
return;
|
||||
}
|
||||
dropdownBtn.on("click", function() {
|
||||
dropdownBtn.data("text", dropdownBtn.text().replaceAll(/\s/g, ""));
|
||||
});
|
||||
|
||||
const buttonText = $(this).text();
|
||||
dropdownBtn.text(buttonText);
|
||||
$(".hours-minutes-link").on("click", function () {
|
||||
const previousText = dropdownBtn.data("text");
|
||||
const currentText = $(this).text().replaceAll(/\s/g, "");
|
||||
|
||||
window.setInputFilter();
|
||||
if(previousText === currentText) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.get('@Url.Action("ToggleDurationUnit")', { isInHoursMode: buttonText === "Stunden" });
|
||||
const buttonText = $(this).text();
|
||||
dropdownBtn.text(buttonText);
|
||||
|
||||
calcDuration("sb", true, false, false);
|
||||
});
|
||||
window.setInputFilter();
|
||||
|
||||
@{
|
||||
if(Model.SelectedSupportConcept != null || Model.SelectedCostBearerSupportConceptOid == -2)
|
||||
{
|
||||
<text>
|
||||
initializeIntervalSelection();
|
||||
</text>
|
||||
}
|
||||
}
|
||||
$.get('@Url.Action("ToggleDurationUnit")', { isInHoursMode: buttonText === "Stunden" });
|
||||
|
||||
window.calcPrependWidth();
|
||||
});
|
||||
calcDuration("sb", true, false, false);
|
||||
});
|
||||
|
||||
function deleteSigntarue(signatureOid, serviceRecordOid, customerName, dateOfRecord) {
|
||||
showMessagePopupWithCallback("Unterschrift löschen",
|
||||
`Sind Sie sicher, dass Sie die Unterschrift von ${customerName} vom ${dateOfRecord} löschen möchten?`,
|
||||
function () {
|
||||
$("#sr-signature-to-del-oid-input").val(signatureOid);
|
||||
$("#sr-sig-to-del-record-oid-input").val(serviceRecordOid);
|
||||
showSpinner();
|
||||
$("#delete-signature-form").submit();
|
||||
},
|
||||
false);
|
||||
}
|
||||
@{
|
||||
if(Model.SelectedSupportConcept != null || Model.SelectedCostBearerSupportConceptOid == -2)
|
||||
{
|
||||
<text>
|
||||
initializeIntervalSelection();
|
||||
</text>
|
||||
}
|
||||
}
|
||||
|
||||
function resetSingleBookingForm() {
|
||||
showSpinner();
|
||||
$("#singleBookingForm").trigger("reset");
|
||||
window.calcPrependWidth();
|
||||
});
|
||||
|
||||
if($("#has-any-rating-types").val().toLowerCase() === "true") {
|
||||
$(".goal-rating-badge").text("Bewerten");
|
||||
} else {
|
||||
$(".goal-rating-badge").text("");
|
||||
}
|
||||
function deleteSigntarue(signatureOid, serviceRecordOid, customerName, dateOfRecord) {
|
||||
showMessagePopupWithCallback("Unterschrift löschen",
|
||||
`Sind Sie sicher, dass Sie die Unterschrift von ${customerName} vom ${dateOfRecord} löschen möchten?`,
|
||||
function () {
|
||||
$("#sr-signature-to-del-oid-input").val(signatureOid);
|
||||
$("#sr-sig-to-del-record-oid-input").val(serviceRecordOid);
|
||||
showSpinner();
|
||||
$("#delete-signature-form").submit();
|
||||
},
|
||||
false);
|
||||
}
|
||||
|
||||
$("#reset-single-booking-form-form").submit();
|
||||
}
|
||||
function resetSingleBookingForm() {
|
||||
showSpinner();
|
||||
$("#singleBookingForm").trigger("reset");
|
||||
|
||||
function setSelectedEmployeeForSingleBooking(selectedListElement, employeeOid) {
|
||||
if(employeeOid !== null && employeeOid !== undefined && $.isNumeric(employeeOid) === true && employeeOid > 0) {
|
||||
$.get("@Url.Action("SetServiceRecordEmployee")", {employeeOid: parseFloat(employeeOid)}, function (employeeName) {
|
||||
$("#single-booking-employee-modal-popup").parent().find(".dropdown-toggle").text(employeeName);
|
||||
$("#single-booking-employee-modal-popup").modal("hide");
|
||||
if($("#has-any-rating-types").val().toLowerCase() === "true") {
|
||||
$(".goal-rating-badge").text("Bewerten");
|
||||
} else {
|
||||
$(".goal-rating-badge").text("");
|
||||
}
|
||||
|
||||
window.loadServiceRecords();
|
||||
});
|
||||
}
|
||||
}
|
||||
$("#reset-single-booking-form-form").submit();
|
||||
}
|
||||
|
||||
function initializeIntervalSelection() {
|
||||
const selectedOption = $("#timeFrameSelect option:selected").val();
|
||||
function setSelectedEmployeeForSingleBooking(selectedListElement, employeeOid) {
|
||||
if(employeeOid !== null && employeeOid !== undefined && $.isNumeric(employeeOid) === true && employeeOid > 0) {
|
||||
window.updateEmployeeOids('sb', employeeOid);
|
||||
|
||||
switch (selectedOption) {
|
||||
case "0":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "1":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "2":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "3":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "4":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "5":
|
||||
$("#last-x-interval-container").show();
|
||||
$("#custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "6":
|
||||
$("#custom-interval-container").show();
|
||||
$("#last-x-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "7":
|
||||
$("#month-interval-container").show();
|
||||
$("#last-x-interval-container, #custom-interval-container").hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
$.get("@Url.Action("SetServiceRecordEmployee")", {employeeOid: parseFloat(employeeOid)}, function (employeeName) {
|
||||
$("#single-booking-employee-modal-popup").parent().find(".dropdown-toggle").text(employeeName);
|
||||
$("#single-booking-employee-modal-popup").modal("hide");
|
||||
|
||||
function changeServiceRecordIntervalSelection(select) {
|
||||
const selectedOption = $(select).val();
|
||||
window.loadServiceRecords();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
showSpinner();
|
||||
function initializeIntervalSelection() {
|
||||
const selectedOption = $("#timeFrameSelect option:selected").val();
|
||||
|
||||
if(["0", "1", "2", "3", "4"].includes(selectedOption)) {
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
}
|
||||
else if(selectedOption === "5") {
|
||||
$("#last-x-interval-container").show();
|
||||
$("#custom-interval-container, #month-interval-container").hide();
|
||||
}
|
||||
else if(selectedOption === "6") {
|
||||
$("#custom-interval-container").show();
|
||||
$("#last-x-interval-container, #month-interval-container").hide();
|
||||
}
|
||||
else if(selectedOption === "7") {
|
||||
$("#month-interval-container").show();
|
||||
$("#last-x-interval-container, #custom-interval-container").hide();
|
||||
}
|
||||
switch (selectedOption) {
|
||||
case "0":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "1":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "2":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "3":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "4":
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "5":
|
||||
$("#last-x-interval-container").show();
|
||||
$("#custom-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "6":
|
||||
$("#custom-interval-container").show();
|
||||
$("#last-x-interval-container, #month-interval-container").hide();
|
||||
break;
|
||||
case "7":
|
||||
$("#month-interval-container").show();
|
||||
$("#last-x-interval-container, #custom-interval-container").hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
window.loadServiceRecords();
|
||||
}
|
||||
function changeServiceRecordIntervalSelection(select) {
|
||||
const selectedOption = $(select).val();
|
||||
|
||||
showSpinner();
|
||||
|
||||
if(["0", "1", "2", "3", "4"].includes(selectedOption)) {
|
||||
$("#last-x-interval-container, #custom-interval-container, #month-interval-container").hide();
|
||||
}
|
||||
else if(selectedOption === "5") {
|
||||
$("#last-x-interval-container").show();
|
||||
$("#custom-interval-container, #month-interval-container").hide();
|
||||
}
|
||||
else if(selectedOption === "6") {
|
||||
$("#custom-interval-container").show();
|
||||
$("#last-x-interval-container, #month-interval-container").hide();
|
||||
}
|
||||
else if(selectedOption === "7") {
|
||||
$("#month-interval-container").show();
|
||||
$("#last-x-interval-container, #custom-interval-container").hide();
|
||||
}
|
||||
|
||||
window.loadServiceRecords();
|
||||
}
|
||||
</script>
|
||||
|
||||
@using(Html.BeginForm("ResetSingleBookingForm", "Main", FormMethod.Post, new { Id = "reset-single-booking-form-form" })) { }
|
||||
@@ -274,7 +294,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
<input type="hidden" id="sb-employee-input" @sbEmployeeInputValue />
|
||||
<input type="hidden" id="sb-employee-input" onchange="window.updateEmployeeOids('sb', $(this).val())" @sbEmployeeInputValue />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -309,7 +329,7 @@
|
||||
<div class="form-row">
|
||||
<div class="col-md mt-1">
|
||||
<div class=" custom-control custom-checkbox custom-control-inline my-0">
|
||||
<input type="checkbox" class="custom-control-input" name="@FormCollectionConstants.MarkerKey" id="sb-marker-cb" @markerCheckedValue />
|
||||
<input type="checkbox" class="custom-control-input" onchange="window.updateMarker('sb', $(this).prop('checked'));" name="@FormCollectionConstants.MarkerKey" id="sb-marker-cb" @markerCheckedValue />
|
||||
<label class="custom-control-label" for="sb-marker-cb">Marker</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -334,7 +354,7 @@
|
||||
Betrag
|
||||
</div>
|
||||
</div>
|
||||
<input class="form-control" autocomplete="on" type="text" id="sb-betrag" name="betrag" value="@betrag" />
|
||||
<input class="form-control" autocomplete="on" onchange="window.updateBetrag('sb', $(this).val())" type="text" id="sb-betrag" name="betrag" value="@betrag" />
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">€</div>
|
||||
</div>
|
||||
@@ -373,7 +393,7 @@
|
||||
Startdatum
|
||||
</span>
|
||||
</div>
|
||||
<input class="form-control" type="date" name="Datum" id="sb-start-date-input" onchange="calcDuration('sb', false, true, false)" value="@Model.StartDateToEditJSFormat" />
|
||||
<input class="form-control" type="date" name="Datum" id="sb-start-date-input" onchange="calcDuration('sb', false, true, false); window.updateStartDate('sb', $(this).val());" value="@Model.StartDateToEditJSFormat" />
|
||||
</div>
|
||||
</div>
|
||||
@if(Model.IsEndDateVisible)
|
||||
@@ -385,7 +405,7 @@
|
||||
Enddatum
|
||||
</span>
|
||||
</div>
|
||||
<input class="form-control" type="date" name="Enddatum" id="sb-end-date-input" onchange="calcDuration('sb', false, false, true)" value="@Model.EndDateToEditJSFormat" />
|
||||
<input class="form-control" type="date" name="Enddatum" id="sb-end-date-input" onchange="calcDuration('sb', false, false, true); window.updateEndDate('sb', $(this).val());" value="@Model.EndDateToEditJSFormat" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -398,11 +418,11 @@
|
||||
Von
|
||||
</span>
|
||||
</div>
|
||||
<input class="form-control" type="time" name="Start" id="sb-start-time-input" onchange="calcDuration('sb', false, true, false)" value="@Model.StartTimeToEdit" />
|
||||
<input class="form-control" type="time" name="Start" id="sb-start-time-input" onchange="calcDuration('sb', false, true, false); window.updateStartTime('sb', $(this).val());" value="@Model.StartTimeToEdit" />
|
||||
<span class="input-group-text rounded-0 border-left-0 border-right-0">
|
||||
Bis
|
||||
</span>
|
||||
<input class="form-control" type="time" name="Ende" id="sb-end-time-input" onchange="calcDuration('sb', false, false, true)" value="@Model.EndTimeToEdit" />
|
||||
<input class="form-control" type="time" name="Ende" id="sb-end-time-input" onchange="calcDuration('sb', false, false, true); window.updateEndTime('sb', $(this).val());" value="@Model.EndTimeToEdit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -420,7 +440,7 @@
|
||||
@labelText
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="sb-duration-input" name="Dauer" onchange="beiDaueraenderung('sb')" value="@durationValue">
|
||||
<input type="text" class="form-control" id="sb-duration-input" name="Dauer" onchange="beiDaueraenderung('sb'); window.updateDuration('sb', $(this).val());" value="@durationValue">
|
||||
@if(Model.IsZeiterfassungInStdMin)
|
||||
{
|
||||
<div class="input-group-append">
|
||||
@@ -450,7 +470,7 @@
|
||||
Gefahrene Kilometer
|
||||
</div>
|
||||
</div>
|
||||
<input class="form-control" autocomplete="on" id="sb-distance-input" name="Distanz" onchange="validateDistanceInput()" value="@Model.DistanceToEdit">
|
||||
<input class="form-control" autocomplete="on" id="sb-distance-input" name="Distanz" onchange="validateDistanceInput(); window.updateDistance('sb', $(this).val());" value="@Model.DistanceToEdit">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -461,10 +481,10 @@
|
||||
@if(Model.HasRightToSeeTextModules)
|
||||
{
|
||||
<script type="text/javascript">
|
||||
function textModuleButtonOnClick() {
|
||||
$('#tree').load('@Url.Action("LoadUpToDateTextModules")');
|
||||
}
|
||||
</script>
|
||||
function textModuleButtonOnClick() {
|
||||
$('#tree').load('@Url.Action("LoadUpToDateTextModules")');
|
||||
}
|
||||
</script>
|
||||
<div class="form-row mt-2" id="textmodule-container">
|
||||
<div class="col-md">
|
||||
<button type="button" class="btn btn-primary form-control" data-toggle="modal" data-target="#textbausteine-popup" id="sb-textbausteine-btn" onclick="textModuleButtonOnClick()">Textbausteine</button>
|
||||
@@ -479,7 +499,7 @@
|
||||
{
|
||||
<div class="form-group my-0">
|
||||
<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>
|
||||
<textarea class="form-control" autocomplete="on" style="overflow: scroll;" onchange="window.updateDokuText('sb', $(this).text(), 6)" name="Dokumentation6" id="sb-doku-textarea">@Model.NoticeToEdit</textarea>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
@@ -490,7 +510,7 @@
|
||||
var currentDokuType = Model.Dokutypes[i];
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#sb-doku_@i" id="sb-doku_@i-tab" data-toggle="tab" role="tab" class="nav-link@(i == 0 ? " active" : string.Empty)">
|
||||
<a href="#sb-doku_@i" id="sb-doku_@i-tab" onchange="window.updateDokuText('sb', $(this).val(), @i)" data-toggle="tab" role="tab" class="nav-link@(i == 0 ? " active" : string.Empty)">
|
||||
@currentDokuType.DisplayName
|
||||
</a>
|
||||
</li>
|
||||
@@ -502,7 +522,7 @@
|
||||
var textareaName = i + 1 < 1 ? "Dokumentation" : "Dokumentation" + (i + 1);
|
||||
|
||||
<div class="tab-pane show@(i == 0 ? " active" : string.Empty)" id="sb-doku_@i" role="tabpanel">
|
||||
<textarea class="form-control doku-form-control" autocomplete="on" style="overflow: scroll;" id="sb-doku-textarea-@i" name="@textareaName">@Model.NoticeListToEdit[i]</textarea>
|
||||
<textarea class="form-control doku-form-control" onchange="window.updateDokuText('sb', $(this).val(), @i)" autocomplete="on" style="overflow: scroll;" id="sb-doku-textarea-@i" name="@textareaName">@Model.NoticeListToEdit[i]</textarea>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
prefix = "mb";
|
||||
}
|
||||
|
||||
const dokufeldId = `#${prefix}-dokufeld-textarea`;
|
||||
const dokufeldId = `#${prefix}-doku-textarea`;
|
||||
const dokuTextareaId = `#${prefix}-doku-textarea-`;
|
||||
const textareaContainerId = `#${prefix}-doku_`;
|
||||
|
||||
@@ -51,10 +51,10 @@
|
||||
const numberOfDokutypes = getNumberOfDokutypes();
|
||||
|
||||
for(let i = 0; i < numberOfDokutypes; i++) {
|
||||
const currentElement = $(`#${prefix}-doku_${i}`);
|
||||
const currentElement = $(`${textareaContainerId}${i}`);
|
||||
|
||||
if(currentElement.css("display") !== "none") {
|
||||
focusedDokuFeld = $(dokuTextareaId + i);
|
||||
focusedDokuFeld = $(`${dokuTextareaId}${i}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
@using BeWoPlanerMobil.Models
|
||||
@using BeWoPlanerMobil.Service
|
||||
@using BeWoPlanerMobil.Util
|
||||
@using DevExpress.XtraReports.Web
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
|
||||
<meta content="utf-8" http-equiv="encoding">
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
<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/ownSoft-Scripts/mobileUtils.js?v=1.4")"></script>
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/mobileUtils.js?v=1.5")"></script>
|
||||
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/view-scripts/main.js?v=1.9")"></script>
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/signature.js?v=1.5")"></script>
|
||||
@@ -254,7 +254,7 @@
|
||||
});
|
||||
|
||||
function toggleRestoreButton() {
|
||||
const state = !window.getRestoreButtonState();
|
||||
const state = false;
|
||||
|
||||
if($(".bewo-restore-btn").length > 0) {
|
||||
$(".bewo-restore-btn").each(function(index, item) {
|
||||
@@ -396,12 +396,16 @@
|
||||
</button>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
|
||||
@if(Html.IsInDebugMode())
|
||||
{
|
||||
<li class="nav-item">
|
||||
<button class="btn btn-link text-light no-underline" type="button" onclick="printLocalStorage()">
|
||||
<i class="fas fa-eye text-bewo-dev"></i>
|
||||
Speicher auslesen
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<button class="btn btn-link text-light no-underline" type="button" onclick="localStorage.clear(); logInfo2(`Der lokale Speicher wurde geleert`);">
|
||||
<button class="btn btn-link text-light no-underline" type="button" onclick="clearLocalBeWoStorage(); logInfo2(`Der lokale Speicher wurde geleert`);">
|
||||
<i class="fas fa-trash text-danger"></i>
|
||||
Speicher leeren
|
||||
</button>
|
||||
@@ -597,6 +601,28 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(Html.IsInDebugMode())
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="dev-popup">
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title font-weight-bold">Dev-Infos</h5>
|
||||
<button class="close" type="button" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="dev-popup-body">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" type="button" data-dismiss="modal">Schließen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(TempData[TempDataConstants.ErrorMessageKey] is string errorMessage)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Globalization;
|
||||
using BS.Shared.Core;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using DevExpress.XtraScheduler;
|
||||
|
||||
namespace BS.Shared.Extensions
|
||||
@@ -28,6 +29,8 @@ namespace BS.Shared.Extensions
|
||||
|
||||
public static class DateTimeExtensions
|
||||
{
|
||||
private static string _TimePattern = @"^(?:[01]\d|2[0-3]):[0-5]\d$";
|
||||
|
||||
public static DateTimeUnit GetDateTimeUnit(this DateTime Date1, DateTime Date2, TimeUnit unit)
|
||||
{
|
||||
List<DateTime> period = new List<DateTime>() { Date1, Date2 };
|
||||
@@ -720,5 +723,32 @@ namespace BS.Shared.Extensions
|
||||
{
|
||||
return date.Hour == date2.Hour && date.Minute == date2.Minute && date.Second == date2.Second;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fügt einem Datumsobjekt die Uhrzeit aus einem Uhrzeitenstring im Format HH:mm hinzu. Ist der Uhrzeitenstring ungültig, wird 00:00:00 Uhr genommen.
|
||||
/// Ist aber useSecond1IfNoValidTimeString true, wird 00:00:01 Uhr für ServiceRecords genommen, die ohne Uhrzeit gespeichert werden.
|
||||
/// </summary>
|
||||
/// <param name="date">Datum, dem der Uhrzeitteil hinzugefügt werden soll</param>
|
||||
/// <param name="timeString">Die Zeichenkette mit dem Uhrzeitteil im Format HH:mm</param>
|
||||
/// <param name="useSecond1IfNoValidTimeString">Flag, das bestimmt, ob die Sekunde bei fehlendem/ungültigem Uhrzeitteil auf 1 gesetzt werden soll.</param>
|
||||
/// <returns>Das Datumsobjekt mit Uhrzeitteil.</returns>
|
||||
public static DateTime MergeDateAndTimeString(this DateTime date, string timeString, bool useSecond1IfNoValidTimeString = false)
|
||||
{
|
||||
if(Regex.IsMatch(timeString, _TimePattern))
|
||||
{
|
||||
var hour2Minute = timeString.Split(':');
|
||||
|
||||
var hour = int.Parse(hour2Minute[0]);
|
||||
var minute = int.Parse(hour2Minute[1]);
|
||||
|
||||
date.MergeDateWithHoursMinutesSeconds(hour, minute, 0);
|
||||
}
|
||||
else if(useSecond1IfNoValidTimeString)
|
||||
{
|
||||
date.MergeDateWithHoursMinutesSeconds(0, 0, 1);
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,11 @@ namespace BS.Shared.Extensions
|
||||
throw new ArgumentException("Not found.", "description");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ersetzt das große ẞ durch ein kleines, da das große ẞ nicht von latin01 inder Datenbank unterstützt wird.
|
||||
/// </summary>
|
||||
/// <param name="pString">String, der möglicherweise ein großes ẞ enthält.</param>
|
||||
/// <returns>pString, mit ersetzten, großen ẞ, falls vorher vorhanden.</returns>
|
||||
public static string RemoveUppercaseEsszett(this string pString)
|
||||
{
|
||||
return pString?.Replace("ẞ", "ß");
|
||||
|
||||
@@ -110,9 +110,11 @@
|
||||
<Compile Include="Extensions\EnumerableTExtensions.cs" />
|
||||
<Compile Include="Extensions\ListTExtensions.cs" />
|
||||
<Compile Include="Extensions\TimeSpanExtensions.cs" />
|
||||
<Compile Include="MySqlBeWoHelper.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Utils.cs" />
|
||||
<Compile Include="Utils\FilePath2MySqlCommands.cs" />
|
||||
<Compile Include="Utils\Utils.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
@@ -130,5 +132,6 @@
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -8,7 +7,7 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using BeWoDatabaseUpdater.Extensions;
|
||||
using MySql.Data.MySqlClient;
|
||||
using BeWoDatabaseUpdater.Utils;
|
||||
|
||||
namespace BeWoDatabaseUpdater
|
||||
{
|
||||
@@ -29,6 +28,8 @@ namespace BeWoDatabaseUpdater
|
||||
private static readonly List<DateTime> _LastAccessTimes = [];
|
||||
private static readonly Stopwatch _Stopwatch = new();
|
||||
|
||||
private static int _OpenDbConnections = 0;
|
||||
|
||||
private static async Task Main(string[] args)
|
||||
{
|
||||
var settingsFilePath = Path.Combine(AppContext.BaseDirectory, UpdaterSettingsFilePath);
|
||||
@@ -51,7 +52,7 @@ namespace BeWoDatabaseUpdater
|
||||
if(string.IsNullOrWhiteSpace(_ConnectionString))
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.Write("Connection String: ");
|
||||
Console.Write("Connection String (Server, User Id, Passwort): ");
|
||||
_ConnectionString = Console.ReadLine();
|
||||
}
|
||||
|
||||
@@ -64,9 +65,7 @@ namespace BeWoDatabaseUpdater
|
||||
|
||||
Console.WriteLine($"{DateTime.Now:dd.MM.yyyy HH:mm:ss.fff}: Führe Updates durch ...{Environment.NewLine}");
|
||||
|
||||
var helper = new MySqlHelper(_ConnectionString);
|
||||
|
||||
_BeWoSchemaNames = await helper.LoadBeWoDatabaseNames() ?? [];
|
||||
_BeWoSchemaNames = await MySqlBeWoHelper.LoadBeWoDatabaseNames(_ConnectionString) ?? [];
|
||||
|
||||
LoadSqlScriptsFromFilesToMemory(() =>
|
||||
{
|
||||
@@ -79,7 +78,7 @@ namespace BeWoDatabaseUpdater
|
||||
fileCount++;
|
||||
});
|
||||
|
||||
var message = $"{DateTime.Now:dd.MM.yyyy HH:mm:ss.fff}: {commandCount} MySQL-Abfragen in {fileCount} Dateien und {_BeWoSchemaNames.Count} BeWoPlaner-Datenbanken ({_BeWoSchemaNames.Count * commandCount} Transaktionen gesamt):{Environment.NewLine}";
|
||||
var message = $"{DateTime.Now:dd.MM.yyyy HH:mm:ss.fff}: {commandCount} MySQL-Abfrag{(commandCount != 1 ? "en" : string.Empty)} in {fileCount} Datei{(fileCount != 1 ? "en" : string.Empty)} und {_BeWoSchemaNames.Count} BeWoPlaner-Datenbanken ({_BeWoSchemaNames.Count * commandCount} Transaktionen gesamt):{Environment.NewLine}";
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -96,9 +95,8 @@ namespace BeWoDatabaseUpdater
|
||||
return;
|
||||
}
|
||||
|
||||
helper.OpenSession();
|
||||
|
||||
// Ein Thread pro Sql-Kommando
|
||||
// ToDo: Threads beachten!
|
||||
var threads = new List<Thread>();
|
||||
|
||||
foreach(var schemaName in _BeWoSchemaNames)
|
||||
@@ -109,11 +107,11 @@ namespace BeWoDatabaseUpdater
|
||||
|
||||
foreach(var command in path2Commands.Commands)
|
||||
{
|
||||
var thread = new Thread(async () =>
|
||||
var thread = new Thread(() =>
|
||||
{
|
||||
var sql = $"USE `{schemaName}`; {command}";
|
||||
|
||||
await helper.ExecuteUpdateOrCreate(sql, path2Commands.FilePath);
|
||||
MySqlBeWoHelper.ExecuteUpdateOrCreateAsync(sql, path2Commands.FilePath, _ConnectionString);
|
||||
});
|
||||
|
||||
thread.Start();
|
||||
@@ -127,7 +125,6 @@ namespace BeWoDatabaseUpdater
|
||||
{
|
||||
thread.Join();
|
||||
|
||||
helper.CloseSession();
|
||||
OnAllThreadsCompleted();
|
||||
});
|
||||
});
|
||||
@@ -136,7 +133,7 @@ namespace BeWoDatabaseUpdater
|
||||
Console.Read();
|
||||
#endif
|
||||
|
||||
if(MySqlHelper.DistinctErrors.Any())
|
||||
if(MySqlBeWoHelper.DistinctErrors.Any())
|
||||
{
|
||||
Console.Read();
|
||||
}
|
||||
@@ -158,9 +155,11 @@ namespace BeWoDatabaseUpdater
|
||||
|
||||
Console.WriteLine($"{DateTime.Now:dd.MM.yyyy HH:mm:ss.fff}: Dauer: {timeSpan.ToShortString()}{Environment.NewLine}");
|
||||
|
||||
Console.WriteLine($"{MySqlHelper.DistinctErrors.Count} Fehler{(MySqlHelper.DistinctErrors.Any() ? ":" : "")}");
|
||||
Console.WriteLine($"{MySqlBeWoHelper.DistinctErrors.Count} Fehler{(MySqlBeWoHelper.DistinctErrors.Any() ? ":" : "")}");
|
||||
|
||||
MySqlHelper.DistinctErrors.DoForEach(number2Message => Console.WriteLine($"{number2Message.Key}: {number2Message.Value}"));
|
||||
//MySqlBeWoHelper.WriteSqlErrorsToFile();
|
||||
|
||||
MySqlBeWoHelper.DistinctErrors.DoForEach(number2Message => Console.WriteLine($"{number2Message.Key}: {number2Message.Value}"));
|
||||
}
|
||||
|
||||
private static void GetTextAndSqlFiles()
|
||||
@@ -273,95 +272,4 @@ namespace BeWoDatabaseUpdater
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class FilePath2MySqlCommands(string filePath, List<string> commands)
|
||||
{
|
||||
public string FilePath { get; set; } = filePath;
|
||||
public List<string> Commands { get; set; } = commands ?? [];
|
||||
}
|
||||
|
||||
public class MySqlHelper
|
||||
{
|
||||
public string ConnectionString { get; set; }
|
||||
|
||||
private readonly MySqlConnection _Connection;
|
||||
|
||||
public async Task<List<string>> LoadBeWoDatabaseNames()
|
||||
{
|
||||
var connection = new MySqlConnection(ConnectionString);
|
||||
|
||||
var result = new List<string>();
|
||||
|
||||
try
|
||||
{
|
||||
await connection.OpenAsync();
|
||||
|
||||
var command = new MySqlCommand("SELECT TABLE_SCHEMA FROM INFORMATION_SCHEMA.TABLES tables WHERE tables.TABLE_NAME = 'bewofile';") {Connection = connection};
|
||||
|
||||
await using var dataReader = command.ExecuteReader();
|
||||
|
||||
while(await dataReader.ReadAsync())
|
||||
{
|
||||
var schemaName = dataReader["TABLE_SCHEMA"]?.ToString();
|
||||
|
||||
if(schemaName is not null)
|
||||
{
|
||||
result.AddIfNotIn(schemaName);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception exception)
|
||||
{
|
||||
Console.WriteLine(exception);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(connection.State is ConnectionState.Open or ConnectionState.Executing)
|
||||
{
|
||||
await connection.CloseAsync();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public MySqlHelper(string connectionString)
|
||||
{
|
||||
ConnectionString = connectionString;
|
||||
|
||||
_Connection = new MySqlConnection(ConnectionString);
|
||||
}
|
||||
|
||||
public static Dictionary<int, string> DistinctErrors = [];
|
||||
|
||||
public void OpenSession()
|
||||
{
|
||||
_Connection.Open();
|
||||
}
|
||||
|
||||
public void CloseSession()
|
||||
{
|
||||
_Connection.Close();
|
||||
WriteSqlErrorsToFile();
|
||||
}
|
||||
|
||||
public void WriteSqlErrorsToFile()
|
||||
{
|
||||
File.WriteAllLines(Program.FailedSqlCommandsFilePath, DistinctErrors.Values);
|
||||
}
|
||||
|
||||
public async Task ExecuteUpdateOrCreate(string sql, string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
await new MySqlCommand(sql) { Connection = _Connection }.ExecuteNonQueryAsync();
|
||||
}
|
||||
catch(MySqlException exception)
|
||||
{
|
||||
var errorMessage = $"{exception.Number} {new FileInfo(filePath).Name}: {exception.Message}";
|
||||
|
||||
DistinctErrors.AddAndIgnoreDuplicates(exception.Number, errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace BeWoDatabaseUpdater
|
||||
{
|
||||
public static class Utils
|
||||
{
|
||||
public static void ConsoleWriteException(Exception exception)
|
||||
{
|
||||
ConsoleWriteError(exception.ToString());
|
||||
}
|
||||
|
||||
public static void ConsoleWriteError(string errorMessage)
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
Console.WriteLine(errorMessage);
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user