diff --git a/BeWoPlanerMobil/Content/BeWoMobileStyle.css b/BeWoPlanerMobil/Content/BeWoMobileStyle.css index e24369bdf..2fb24df29 100644 --- a/BeWoPlanerMobil/Content/BeWoMobileStyle.css +++ b/BeWoPlanerMobil/Content/BeWoMobileStyle.css @@ -33,6 +33,7 @@ hr { .recordHeader { color: darkgray; + vertical-align: top; } body { @@ -90,20 +91,24 @@ label { } input, textarea { - box-shadow:none; - background: #fff; - font-size: 13px; - color: #555; - outline: none; - border: 1px solid #bbb; - padding: 10px 20px; - -webkit-border-radius: 0; - border-radius: 0; - position: relative; - width: 100%; - box-sizing: border-box; - -webkit-box-sizing:border-box; - -moz-box-sizing: border-box; + box-shadow: none; + background: #fff; + font-size: 13px; + color: #555; + outline: none; + border: 1px solid #bbb; + padding: 10px 20px; + -webkit-border-radius: 0; + border-radius: 0; + position: relative; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +textarea { + resize: none; } input[type=text], input[type=number], input[type=button], input[type=password], input[type=submit], textarea { @@ -638,51 +643,43 @@ article.infobox section { top:30px; } -article.infobox section h2{ +article.infobox section h2 { position: absolute; left: 0; top: -30px; - width: 15.5%; + width: 19.6%; height: 29px; - font-family: Verdana; - font-size: 15px; + font-size: 10px; + font-weight: normal; + text-transform: uppercase; margin: 0; background-color: rgba(0, 0, 0, 0.1); - border-radius: 0 0 0 0; - border: double #ffffff; + border-radius: 0 0 0 0; + border: double #ffffff; border-width: 1px 1px 0 1px; - z-index:0; + z-index: 0; word-wrap: break-word; border-color: rgba(0, 0, 0, 0.1); } article.infobox section:nth-child(2) h2{ - left: 15.5%; + left: 20%; z-index: 1; - border-width: 1.5px 1.5px 0 1px; - border-color: rgba(0, 0, 0, 0.1); - } article.infobox section:nth-child(3) h2{ - left: 31%;/*410 || 32% */ + left: 40%; z-index:2; - border-width: 1.5px 1.5px 0 1px; - border-color: rgba(0, 0, 0, 0.1); } article.infobox section:nth-child(4) h2{ - left: 46.5%; /*615 || 48%*/ + left: 60%; z-index: 3; - border-width: 1.5px 1.5px 0 1px; - border-color: rgba(0, 0, 0, 0.1); } article.infobox section:nth-child(5) h2{ - left: 62%; /*820 || 64% */ + left: 80%; z-index: 4; - border-width: 1.5px 1.5px 0 1px; - border-color: rgba(0, 0, 0, 0.1); } article.infobox section h2 a { @@ -698,7 +695,6 @@ article.infobox section:target, article.infobox section:target h2 { z-index: 1; background-color: #FFFFFF; border-color:#FF5A00; - } article.infobox section:target h2 a { diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index a5f2b1996..4c853181e 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -573,16 +573,18 @@ namespace BeWoPlanerMobil.Controllers return null; } - var textbausteine = OperationsService.GetTextModulesByServiceCategory(pServiceCategoryOid); + var textbausteine = OperationsService.GetAllTextModules(); if(MobileSessionFacade.CheckForUserRight(UserRightType.TextbausteineNurEigeneAnsehen)) { textbausteine = textbausteine.Where(w => w.Employee.EmployeeOid == Model.Employee.EmployeeOid).ToList(); } - Model.Textbausteine = textbausteine.ToList(); + Model.Textbausteine = textbausteine.Where(w => w.ServiceCategory != null && w.ServiceCategory.ServiceCategoryOid == pServiceCategoryOid).ToList(); - var displayItems = textbausteine.Select(s => new TextbausteinDisplayItem(s.TextModuleOid.Value, s.Name, s.Parent?.TextModuleOid, s.IsParent)).ToList(); + Model.Textbausteine.AddRangeIfElementsNotIn(Utils.GetParentTextModules(Model.Textbausteine)); + + var displayItems = Model.Textbausteine.Select(s => new TextbausteinDisplayItem(s.TextModuleOid.Value, s.Name, s.Parent?.TextModuleOid, s.IsParent, s.Text)).ToList(); foreach(var item in displayItems) { @@ -671,18 +673,15 @@ namespace BeWoPlanerMobil.Controllers enddatum = datum; } - if (!string.IsNullOrEmpty(collection["Dauer"])) { int.TryParse(collection["Dauer"], out dauer); } - var doku2 = collection["Dokumentation2"]; var doku3 = collection["Dokumentation3"]; var doku4 = collection["Dokumentation4"]; var doku5 = collection["Dokumentation5"]; - var zeitenFeld = new DateTime[2]; @@ -1297,46 +1296,6 @@ namespace BeWoPlanerMobil.Controllers return result; } - private static DateTime CreateDateFromString(DateTime datum, string dateString) - { - var h = 0; - var m = 0; - - if (!string.IsNullOrEmpty(dateString)) - { - if (dateString.Contains(":") || dateString.Contains(".") || dateString.Contains(",")) - { - var seperator = ':'; - - if (dateString.Contains(".")) - seperator = '.'; - else if (dateString.Contains(",")) - seperator = ','; - - var hm = dateString.Split(seperator); - - h = Convert.ToInt32(hm[0]); - m = Convert.ToInt32(hm[1]); - } - else - { - if (dateString.Length <= 2) - { - m = 0; - h = Convert.ToInt32(dateString); - } - else - { - m = Convert.ToInt32(dateString.Substring(dateString.Length - 2, 2)); - h = Convert.ToInt32(dateString.Substring(0, dateString.Length - 2)); - } - - } - } - - return datum.AddHours(h).AddMinutes(m); - } - private static DateTime[] ConvertRecordTimesWithEndDate(string start, string ende, DateTime datum, DateTime enddatum, int dauer) { var result = new DateTime[2]; @@ -1871,14 +1830,16 @@ namespace BeWoPlanerMobil.Controllers public long Oid { get; set; } public long? ParentOid { get; set; } public bool IsParent { get; set; } + public string Text { get; set; } public List Children { get; set; } - public TextbausteinDisplayItem(long pOid, string pName, long? pParentOid, bool pIsParent) + public TextbausteinDisplayItem(long pOid, string pName, long? pParentOid, bool pIsParent, string pText) { Oid = pOid; Name = pName; ParentOid = pParentOid; IsParent = pIsParent; + Text = pText; Children = new List(); } diff --git a/BeWoPlanerMobil/Scripts/initialization.js b/BeWoPlanerMobil/Scripts/initialization.js index d5449d7ff..bdc709b11 100644 --- a/BeWoPlanerMobil/Scripts/initialization.js +++ b/BeWoPlanerMobil/Scripts/initialization.js @@ -67,12 +67,12 @@ function initBeWoMobile(actionPath) { toggleSelectClassesForElement("#recordLoader_select", "#record-loader-select-container"); toggleSelectClassesForElement("#textbausteine_select", "#textbausteine-select-container"); - var selectedSC = $($("#scDropDown")).find(":selected").val(); + const selectedServiceCategory = $($("#scDropDown")).find(":selected").val(); - if (selectedSC !== "-1") { + if (selectedServiceCategory !== "-1") { $("#recordLoader_select").prop("disabled", false); - if ($("#anlegenEditierenBtn").val() == "Anlegen") { + if ($("#anlegenEditierenBtn").val() === "Anlegen") { activateForm(actionPath); } @@ -80,41 +80,40 @@ function initBeWoMobile(actionPath) { } $(".not-required-input").on("click blur change focus", - function () { - var v = $(this).attr("id"); - setTimeout(function () { toggleLabel(v); }, 1); + function() { + const v = $(this).attr("id"); + setTimeout(function() { toggleLabel(v); }, 1); } ); $("#start_textbox").on("blur", function () { - var startHasValue = $("#start_textbox").val() != ""; - var endHasValue = $("#ende_textbox").val() != ""; - var durationHasValue = $("#duration_textbox").val() != ""; + const startHasValue = $("#start_textbox").val() !== ""; + const endHasValue = $("#ende_textbox").val() !== ""; + const durationHasValue = $("#duration_textbox").val() !== ""; - if (startHasValue && endHasValue) { + if(startHasValue && endHasValue) { calcDurationByStartEnd(); - } else if (startHasValue && durationHasValue) { + } else if(startHasValue && durationHasValue) { calcEndByStartDuration(); } }); $("#ende_textbox").on("blur", function () { - var startHasValue = $("#start_textbox").val() != ""; - var endHasValue = $("#ende_textbox").val() != ""; - var durationHasValue = $("#duration_textbox").val() != ""; + const startHasValue = $("#start_textbox").val() !== ""; + const endHasValue = $("#ende_textbox").val() !== ""; + const durationHasValue = $("#duration_textbox").val() !== ""; if (endHasValue && startHasValue) { calcDurationByStartEnd(); } else if (endHasValue && durationHasValue) { calcStartByEndDuration(); } - }); $("#duration_textbox").on("blur", function () { - var startHasValue = $("#start_textbox").val() != ""; - var endHasValue = $("#ende_textbox").val() != ""; - var durationHasValue = $("#duration_textbox").val() != ""; + const startHasValue = $("#start_textbox").val() !== ""; + const endHasValue = $("#ende_textbox").val() !== ""; + const durationHasValue = $("#duration_textbox").val() !== ""; clearZED(); @@ -123,16 +122,15 @@ function initBeWoMobile(actionPath) { } else if (durationHasValue && endHasValue) { calcStartByEndDuration(); } - }); } catch (err) { - console.log("Fehler: " + err.message); + console.log(`Fehler: ${err.message}`); } } function toggleSelectClassesForElement(elementIdentifier, parentElement) { - var enabled = $(elementIdentifier).prop("disabled") === false; - + const enabled = $(elementIdentifier).prop("disabled") === "false"; + if (enabled) { $(parentElement).removeClass("disabled-select-container"); $(parentElement).addClass("styled-select-div"); @@ -143,8 +141,8 @@ function toggleSelectClassesForElement(elementIdentifier, parentElement) { } function toggleErrorPopup2(errorMessage) { - var isDisplayNone = $("#errorPopupDiv2").css("display") == "none"; - var displayValue = isDisplayNone ? "block" : "none"; + const isDisplayNone = $("#errorPopupDiv2").css("display") == "none"; + const displayValue = isDisplayNone ? "block" : "none"; $("#errorPopupDiv2").css("display", displayValue); $(".modalWrapper").css("display", displayValue); @@ -153,11 +151,11 @@ function toggleErrorPopup2(errorMessage) { if (isDisplayNone) { $("#errorPopupText2").text(errorMessage); - var h = 0; - var t = $("#errorPopupTitle2").outerHeight(); - var u = $("#errorPopupText2").outerHeight(); - var v = $("#errorPopupBtnDiv2").outerHeight(); - var w = $("#errorPopupOkBtn2").outerHeight(); + let h = 0; + const t = $("#errorPopupTitle2").outerHeight(); + const u = $("#errorPopupText2").outerHeight(); + const v = $("#errorPopupBtnDiv2").outerHeight(); + const w = $("#errorPopupOkBtn2").outerHeight(); h += t + u + v + w + w; @@ -199,8 +197,9 @@ function loadSettingsAccordingToBWP() { type: "GET", url: LoadSessionSettingsFromBWPUrl, success: function (json) { - var s = $.parseJSON(json); - timeoutSetting = parseInt(s); + const timeOutSettingsString = $.parseJSON(json); + + timeoutSetting = parseInt(timeOutSettingsString); logoutSettingsAccordingToBWP(timeoutSetting); } }); @@ -211,16 +210,15 @@ function checkEndDate() { type: "GET", url: CheckEndDateUrl, success: function (json) { + const endDateSettingsString = $.parseJSON(json); + const endDateSetting = parseInt(endDateSettingsString); - var s = $.parseJSON(json); - var EndDateSetting = parseInt(s); - - if (EndDateSetting == 1) { - document.getElementById('EndDate_div').style.display = 'block'; + if (endDateSetting === 1) { + $("#EndDate_div").css("display", "block"); $("#enddatum_textbox").val($("#datum_textbox").val()); } else { - document.getElementById('EndDate_div').style.display = 'none'; + $("#EndDate_div").css("display", "none"); } } }); @@ -231,71 +229,33 @@ function initializeDocumentationTextareas() { type: "GET", url: CheckDokuReiterUrl, success: function (json) { + const documentationTypes = $.parseJSON(json); + const numberOfDocumentationTypes = documentationTypes.length; - var s = $.parseJSON(json); - - var x = s.length; - - if (x == 0) { + if(numberOfDocumentationTypes === 0) { $("#tddokureiter").css("display", "none"); $("#trnormalDoku").css("display", "table-row"); - $("#notiz_textbox").css("width", "100%"); - focusedDokuTextarea = $("#notiz_textbox"); + window.focusedDokuTextarea = $("#notiz_textbox"); } else { - focusedDokuTextarea = $("#notiz_textbox1"); + window.focusedDokuTextarea = $("#notiz_textbox1"); } - if (x == 1) { + if(numberOfDocumentationTypes === 1) { $("#tddokureiter").css("display", "none"); $("#trnormalDoku").css("display", "table-row"); - $("#notiz_textbox").css("width", "100%"); - $("#trnormalDokuLabel").text(s[0].TypeDescription); + $("#trnormalDokuLabel").text(documentationTypes[0].TypeDescription); } - if (x == 2) { - $("#DokName1").text(s[0].TypeDescription); - $("#DokName2").text(s[1].TypeDescription); + if (numberOfDocumentationTypes > 2) { + for(let i = 0; i < numberOfDocumentationTypes; i++) { + const idNumber = i + 1; - $("#notiz_textbox1, #notiz_textbox2").css("width", "40%"); - - $("#Dokumentation1, #Dokumentation2").css("display", "block"); - $("#Dokumentation1, #Dokumentation2").css("width","250%"); - } - if (x == 3) { - $("#DokName1").text(s[0].TypeDescription); - $("#DokName2").text(s[1].TypeDescription); - $("#DokName3").text(s[2].TypeDescription); - - $("#notiz_textbox1, #notiz_textbox2, #notiz_textbox3").css("width", "50%"); - - $("#Dokumentation1, #Dokumentation2, #Dokumentation3").css("display", "block"); - $("#Dokumentation1, #Dokumentation2, #Dokumentation3").css("width", "250%"); - } - if (x == 4) { - $("#DokName1").text(s[0].TypeDescription); - $("#DokName2").text(s[1].TypeDescription); - $("#DokName3").text(s[2].TypeDescription); - $("#DokName4").text(s[3].TypeDescription); - - $("#notiz_textbox1, #notiz_textbox2, #notiz_textbox3, #notiz_textbox4").css("width", "76.9%"); - - $("#Dokumentation1, #Dokumentation2, #Dokumentation3, #Dokumentation4, #Dokumentation5").css("display", "block"); - $("#Dokumentation1, #Dokumentation2, #Dokumentation3, #Dokumentation4, #Dokumentation5").css("width", "130%"); - } - if (x == 5) { - $("#DokName1").text(s[0].TypeDescription); - $("#DokName2").text(s[1].TypeDescription); - $("#DokName3").text(s[2].TypeDescription); - $("#DokName4").text(s[3].TypeDescription); - $("#DokName5").text(s[4].TypeDescription); - - $("#notiz_textbox1, #notiz_textbox2, #notiz_textbox3, #notiz_textbox4, #notiz_textbox5").css("width", "101%"); - - $("#Dokumentation1, #Dokumentation2, #Dokumentation3, #Dokumentation4, #Dokumentation5").css("display", "block"); - $("#Dokumentation1, #Dokumentation2, #Dokumentation3, #Dokumentation4, #Dokumentation5").css("width", "99%"); + $(`#DokName${idNumber}`).text(documentationTypes[i].TypeDescription); + $(`#Dokumentation${idNumber}`).css("display", "block"); + } } - if (x > 0) { + if (numberOfDocumentationTypes > 0) { $("#DokName1").click(); } } diff --git a/BeWoPlanerMobil/Scripts/mainView.js b/BeWoPlanerMobil/Scripts/mainView.js index 54c3a0b82..7b7c0dd25 100644 --- a/BeWoPlanerMobil/Scripts/mainView.js +++ b/BeWoPlanerMobil/Scripts/mainView.js @@ -54,7 +54,7 @@ function buildGoalTreeItem(goalItem) { var goalOid = goalItem.Children[index].ValueListEntryOid; var goalHeader = goalItem.Children[index].Header; - collapsibleHtml += '
'; + collapsibleHtml += '
' + goalHeader + "
"; } }); } catch (exception) { @@ -194,9 +194,9 @@ function getDateObj(isFromStart) { } function loadGoals(actionPath) { - var selectedSC = $($("#scDropDown")).find(":selected").val(); + const selectedServiceRecord = $($("#scDropDown")).find(":selected").val(); - makeAjaxCall("GET", actionPath, loadGoalsOnSuccess, { pCostbearer2SupportConceptOid: selectedSC }, null); + makeAjaxCall("GET", actionPath, loadGoalsOnSuccess, { pCostbearer2SupportConceptOid: selectedServiceRecord }, null); } function toggleMenu() { @@ -213,7 +213,7 @@ function loadServiceDescriptions() { } function loadTextbausteineForServiceCategory(serviceCategoryOid) { - //makeAjaxCall("GET", loadTextbausteineForCategoryUrl, loadTextbausteineForCategoryOnSuccess, { pServiceCategoryOid: serviceCategoryOid }, null); + makeAjaxCall("GET", loadTextbausteineForCategoryUrl, loadTextbausteineForCategoryOnSuccess, { pServiceCategoryOid: serviceCategoryOid }, null); } function loadTextbausteineForCategoryOnSuccess(json) { @@ -221,35 +221,13 @@ function loadTextbausteineForCategoryOnSuccess(json) { return; } - buildCollapsableSet2(json); + buildTextModuleTree(json); } -var textModules; var collapsibleHtml2; -function buildTextModuleTreeItem(moduleItem) { - // TODO: Nur, wenn es sich um eine Textbausteinkategorie handelt! - if (moduleItem.IsParent) { - collapsibleHtml2 += ''; - collapsibleHtml2 += ''; - } -} - -function buildCollapsableSet2(jsonString) { +var textModules = new Array(); +var allTextModules = new Array(); +function buildTextModuleTree(jsonString) { try { if (jsonString.length === 0) { return; @@ -257,28 +235,52 @@ function buildCollapsableSet2(jsonString) { textModules = $.parseJSON(jsonString); - console.log(textModules); + $("#kollabierbar2").empty(); + collapsibleHtml2 = ""; - actuallyBuildCollapsibleSet2(textModules); + $.each(textModules, function(index) { + buildTreeRecursively(textModules[index]); + }); + + $("#kollabierbar2").append(collapsibleHtml2); } catch (exception) { console.log("Fehler(BuildCollapsibleSet2): " + exception.message); } } -function actuallyBuildCollapsibleSet2(tmodules) { - $("#kollabierbar2").empty(); +function buildTreeRecursively(textmodule) { + allTextModules[textmodule.Oid] = textmodule; - collapsibleHtml2 = ""; + if (textmodule.IsParent) { + collapsibleHtml2 += ''; + collapsibleHtml2 += '"; + } } function setTextModule(moduleOid) { - // TODO: ausgewähltes Dokufeld ermitteln und den entsprechenden Text hinzufügen + if(focusedDokuTextarea == null) { + if($("#trnormalDoku").css("display") !== "none") { + focusedDokuTextarea = $("#notiz_textbox"); + } else { + focusedDokuTextarea = $("#notiz_textbox1"); + } + } + + console.log("Id der fokussierten DokuTextarea: " + focusedDokuTextarea.attr("id")); + + focusedDokuTextarea.val(focusedDokuTextarea.val() + allTextModules[moduleOid].Text); } function setTextbaustein() { @@ -291,10 +293,10 @@ function setTextbaustein() { function loadTextbausteinContentOnSuccess(textbausteintext) { if (focusedDokuTextarea != null) { - var cursorPosition = focusedDokuTextarea.prop("selectionStart"); - var v = focusedDokuTextarea.val(); - var textBefore = v.substring(0, cursorPosition); - var textAfter = v.substring(cursorPosition, v.length); + const cursorPosition = focusedDokuTextarea.prop("selectionStart"); + const v = focusedDokuTextarea.val(); + const textBefore = v.substring(0, cursorPosition); + const textAfter = v.substring(cursorPosition, v.length); focusedDokuTextarea.val(textBefore + textbausteintext + textAfter); } else { @@ -325,19 +327,19 @@ function selectServiceRecord(oid) { url: getSelectedRecordInformationUrl, success: function (jsonServiceRecord) { try { - if (jsonServiceRecord == "SessionTimeout") { + if (jsonServiceRecord === "SessionTimeout") { window.location.href = redirectLink; return; } var record = $.parseJSON(jsonServiceRecord); - var goals = record.Goals; + const goals = record.Goals; var idArray = new Array(); var meinGoalsArray = new Array(); - for (var i = 0; i < goals.length; i++) { + for (let i = 0; i < goals.length; i++) { idArray[goals[i].ValueListEntryOid] = goals[i].ValueListEntryOid; } @@ -346,7 +348,7 @@ function selectServiceRecord(oid) { url: loadGoalsUrl, data: { pCostbearer2SupportConceptOid: $($("#scDropDown")).find(":selected").val() }, success: function (goalsJson) { - if (goalsJson == "SessionTimeout") { + if (goalsJson === "SessionTimeout") { window.location.href = redirectLink; return; } @@ -354,27 +356,27 @@ function selectServiceRecord(oid) { try { meinGoalsArray = goalsJson !== "" ? $.parseJSON(goalsJson) : ""; } catch (exception) { - console.log("Fehler beim JSON Parsing von selectServiceRecord(" + oid + "): " + exception.message); + console.log(`Fehler beim JSON Parsing von selectServiceRecord(${oid}): ${exception.message}`); } - var s = record.Start[18] == "1" ? "" : record.Start.slice(11, 16); - var e = record.End[18] == "1" ? "" : record.End.slice(11, 16); - var jahr = record.Start.slice(0, 4); - var monat = record.Start.slice(5, 7); - var tag = record.Start.slice(8, 10); - var datum = tag + "." + monat + "." + jahr; + var rawStartDateStr = record.Start[18] === "1" ? "" : record.Start.slice(11, 16); + var rawEndDateStr = record.End[18] === "1" ? "" : record.End.slice(11, 16); + var startDateYearStr = record.Start.slice(0, 4); + var startDateMonthStr = record.Start.slice(5, 7); + var startDateDayStr = record.Start.slice(8, 10); + var dateStr = startDateDayStr + "." + startDateMonthStr + "." + startDateYearStr; - var ENDjahr = record.End.slice(0, 4); - var ENDmonat = record.End.slice(5, 7); - var ENDtag = record.End.slice(8, 10); - var ENDdatum = ENDtag + "." + ENDmonat + "." + ENDjahr; + var endDateYearStr = record.End.slice(0, 4); + var endDateMonthStr = record.End.slice(5, 7); + var endDateDayStr = record.End.slice(8, 10); + var endDateDateStr = endDateDayStr + "." + endDateMonthStr + "." + endDateYearStr; - $("#start_textbox").val(s); - $("#ende_textbox").val(e); - $("#datum_textbox").val(datum); + $("#start_textbox").val(rawStartDateStr); + $("#ende_textbox").val(rawEndDateStr); + $("#datum_textbox").val(dateStr); $("#notiz_textbox").val(record.Notice); - $("#enddatum_textbox").val(ENDdatum) + $("#enddatum_textbox").val(endDateDateStr); $("#notiz_textbox1").val(record.Notice); $("#notiz_textbox2").val(record.Notice2); $("#notiz_textbox3").val(record.Notice3); @@ -394,16 +396,17 @@ function selectServiceRecord(oid) { type: "GET", url: loadServiceCategoriesUrl, success: function (result) { - if (result == "SessionTimeout") { + if (result === "SessionTimeout") { window.location.href = redirectLink; return; } $("#kategorien_select").val(record.ServiceDescription.Category.ServiceCategoryOid); - var liste = $.parseJSON(result); + const liste = $.parseJSON(result); $("#leistungen_select").empty(); - $("#leistungen_select").val(""); + $("#leistungen_select").val(""); + $.each(liste, function (index, leistung) { $("#leistungen_select").append(''); }); @@ -418,6 +421,7 @@ function selectServiceRecord(oid) { $("input").prop("disabled", false); $("#abbrechenBtn").prop("disabled", true); $("select").prop("disabled", false); + toggleSelectClassesForElement("#kategorien_select", "#kategorien-select-container"); toggleSelectClassesForElement("#leistungen_select", "#leistungen-select-container"); toggleSelectClassesForElement("#recordLoader_select", "#record-loader-select-container"); @@ -513,11 +517,11 @@ function toggleOnclick(element) { $(collapsedDiv).fadeToggle("fast"); } -$(document).mouseup(function (e) { - var menu = $("#menu-div"); - var menuBtn = $("#menu-btn"); +$(document).mouseup(function(e) { + const menu = $("#menu-div"); + const menuBtn = $("#menu-btn"); - if (!menu.is(e.target) && !menuBtn.is(e.target) && menu.has(e.target).length === 0) { + if(!menu.is(e.target) && !menuBtn.is(e.target) && menu.has(e.target).length === 0) { menu.fadeOut("fast"); } }); diff --git a/BeWoPlanerMobil/Scripts/utils.js b/BeWoPlanerMobil/Scripts/utils.js index ea1b05b5f..627e557de 100644 --- a/BeWoPlanerMobil/Scripts/utils.js +++ b/BeWoPlanerMobil/Scripts/utils.js @@ -10,27 +10,27 @@ } function getDateTimeStringWithLeadingZeros(pDate) { - var dateStr = getDateStringWithLeadingZeros(pDate); + const dateStr = getDateStringWithLeadingZeros(pDate); - var hh = (pDate.getHours() < 10 ? "0" : "") + pDate.getHours(); - var m = (pDate.getMinutes() < 10 ? "0" : "") + pDate.getMinutes(); - var ss = (pDate.getSeconds() < 10 ? "0" : "") + pDate.getSeconds(); + const hh = (pDate.getHours() < 10 ? "0" : "") + pDate.getHours(); + const m = (pDate.getMinutes() < 10 ? "0" : "") + pDate.getMinutes(); + const ss = (pDate.getSeconds() < 10 ? "0" : "") + pDate.getSeconds(); return dateStr + " " + hh + ":" + m + ":" + ss; } function getDateStringWithLeadingZeros(pDate) { - var dd = (pDate.getDate() < 10 ? "0" : "") + pDate.getDate().toString(); - var mm = ((pDate.getMonth() + 1) < 10 ? "0" : "") + (pDate.getMonth() + 1); - var yyyy = pDate.getFullYear(); + const dd = (pDate.getDate() < 10 ? "0" : "") + pDate.getDate().toString(); + const mm = ((pDate.getMonth() + 1) < 10 ? "0" : "") + (pDate.getMonth() + 1); + const yyyy = pDate.getFullYear(); return dd + "." + mm + "." + yyyy; } function subtractDates(date1, date2) { - var t1 = date1.getTime(); - var t2 = date2.getTime(); - var diff = (t2 - t1) / 60000; + const t1 = date1.getTime(); + const t2 = date2.getTime(); + const diff = (t2 - t1) / 60000; return Math.abs(diff); } @@ -40,8 +40,7 @@ function addMinutes(date, minutes) { } function stringToTime(str) { - var defaultResult = [-1, -1]; - var minutes = 0; + const defaultResult = [-1, -1]; str = str.replace(":", ""); str = str.replace(".", ""); @@ -49,19 +48,19 @@ function stringToTime(str) { if (str.length < 3) { if (str.length < 2) { - str = "0" + str; + str = `0${str}`; } while (str.length < 4) { str = str + "0"; } } else { while (str.length < 4) { - str = "0" + str; + str = `0${str}`; } } - minutes = str.slice(2, 4); - var hours = str.slice(0, 2); + const minutes = str.slice(2, 4); + const hours = str.slice(0, 2); defaultResult[0] = parseInt(hours); defaultResult[1] = parseInt(minutes); @@ -70,22 +69,22 @@ function stringToTime(str) { } function getHoursAndMinutesWithLeadingZeros(pDate) { - var hours = pDate.getHours(); - var minutes = pDate.getMinutes(); + const hours = pDate.getHours(); + const minutes = pDate.getMinutes(); - var hoursString = hours < 10 ? "0" + hours.toString() : hours.toString(); - var minutesString = minutes < 10 ? "0" + minutes.toString() : minutes.toString(); + const hoursString = hours < 10 ? `0${hours.toString()}` : hours.toString(); + const minutesString = minutes < 10 ? `0${minutes.toString()}` : minutes.toString(); return hoursString + ":" + minutesString; } function toShortDateString(dateString, trennzeichen) { - var geteilt = dateString.split(trennzeichen); + const geteilt = dateString.split(trennzeichen); var yyyy = ""; - var mm = geteilt[1]; - var dd = geteilt[0]; + const mm = geteilt[1]; + const dd = geteilt[0]; - for (var i = 0; i < 4 - geteilt[2].split(" ")[0].length; i++) { + for (let i = 0; i < 4 - geteilt[2].split(" ")[0].length; i++) { yyyy += "0"; } @@ -95,12 +94,12 @@ function toShortDateString(dateString, trennzeichen) { } function toDateStringYearMonthDay(pDate) { - var dd2 = pDate.getDate(); - var mm2 = pDate.getMonth() + 1; - var yyyy2 = pDate.getFullYear(); + const dd2 = pDate.getDate(); + const mm2 = pDate.getMonth() + 1; + const yyyy2 = pDate.getFullYear(); - var ddStr2 = dd2 < 10 ? "0" + dd2 : dd2; - var mmStr2 = mm2 < 10 ? "0" + mm2 : mm2; + const ddStr2 = dd2 < 10 ? "0" + dd2 : dd2; + const mmStr2 = mm2 < 10 ? "0" + mm2 : mm2; return yyyy2 + "-" + mmStr2 + "-" + ddStr2; } \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index d1ec0948d..3d48ada9a 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -153,7 +153,7 @@ - +
@@ -256,9 +256,9 @@ if (record.Start.Value.Second == 0) { if(record.Start.Value.Date != record.End.Value.Date){ - @(record.Start.Value.ToString("dd.MM.yyyy") + " "+ record.Start.Value.ToString(" HH:mm") + " - " + record.End.Value.ToString("dd.MM.yyyy") + " " + @record.End.Value.ToString("HH:mm")) + @(record.Start.Value.ToString("dd.MM.yyyy") + " "+ record.Start.Value.ToString(" HH:mm") + " - " + record.End.Value.ToString("dd.MM.yyyy") + " " + record.End.Value.ToString("HH:mm")) }else{ - @(record.Start.Value.ToString("dd.MM.yyyy") + " " + record.Start.Value.ToString(" HH:mm") + " - " + @record.End.Value.ToString("HH:mm")) + @(record.Start.Value.ToString("dd.MM.yyyy") + " " + record.Start.Value.ToString(" HH:mm") + " - " + record.End.Value.ToString("HH:mm")) } } else @@ -292,17 +292,17 @@ Ziele: @{ - if (record.Goals != null) - { - foreach (var goal in record.Goals) - { - @(goal.TypeDescription) - if (record.Goals.IndexOf(goal) < record.Goals.Count - 1) - { - @(", ") - } - } - } + if (record.Goals != null) + { + foreach (var goal in record.Goals) + { + @(goal.TypeDescription) + if (record.Goals.IndexOf(goal) < record.Goals.Count - 1) + { + @(", ") + } + } + } } @@ -323,36 +323,36 @@ @record.InsertedOn - @{if ( Model.Dokutypes.Length >= 1) - { - - @Model.Dokutypes[0].TypeDescription.ToString(): - @record.Notice - - } - else if (record.Notice2 == null && record.Notice3 == null && record.Notice4 == null && record.Notice5 == null && Model.Dokutypes.Length == 0) - { + @{ + if(Model.Dokutypes.Length >= 1) + { + + @Model.Dokutypes[0].TypeDescription: + @record.Notice + + } + else if (record.Notice2 == null && record.Notice3 == null && record.Notice4 == null && record.Notice5 == null && Model.Dokutypes.Length == 0) + { Dokumentation: @record.Notice - } - else if (record.Notice2 != null || record.Notice3 != null || record.Notice4 != null || record.Notice5 != null) - { + } + else if (record.Notice2 != null || record.Notice3 != null || record.Notice4 != null || record.Notice5 != null) + { Dokumentation: - @record.Notice + @record.Notice - } } - + } @{if(record.Notice2 != null){ if (Model.Dokutypes.Length >= 2) { if (!record.Notice2.Equals("") && Model.Dokutypes[1] != null) { - @Model.Dokutypes[1].TypeDescription.ToString(): + @Model.Dokutypes[1].TypeDescription: @record.Notice2 } @@ -370,7 +370,7 @@ if (Model.Dokutypes.Length >= 3){ if(!record.Notice3.Equals("") && Model.Dokutypes[2] != null){ - @Model.Dokutypes[2].TypeDescription.ToString(): + @Model.Dokutypes[2].TypeDescription: @record.Notice3 } @@ -387,7 +387,7 @@ if (Model.Dokutypes.Length >= 4){ if(!record.Notice4.Equals("") && Model.Dokutypes[3] != null){ - @Model.Dokutypes[3].TypeDescription.ToString(): + @Model.Dokutypes[3].TypeDescription: @record.Notice4 } @@ -406,7 +406,7 @@ if (!record.Notice5.Equals("") && Model.Dokutypes[4] != null) { - @Model.Dokutypes[4].TypeDescription.ToString(): + @Model.Dokutypes[4].TypeDescription: @record.Notice5 } diff --git a/BeWoPlanerMobil/Web.config b/BeWoPlanerMobil/Web.config index 3a1d4aa68..cc5c86999 100644 --- a/BeWoPlanerMobil/Web.config +++ b/BeWoPlanerMobil/Web.config @@ -119,7 +119,8 @@ - + + diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs index 2a087ed68..afc0aeb6b 100644 --- a/Data/Access/SearchDAO.cs +++ b/Data/Access/SearchDAO.cs @@ -1435,20 +1435,11 @@ namespace BeWo.Data.Access { var c = CreateCriteriaIsActive(); - c.Add(Restrictions.Or(Restrictions.Eq(TextModule.PropertyName_ServiceCategory + ".Oid", pServiceCategoryOid), Restrictions.IsNull(TextModule.PropertyName_ServiceCategory))); + c.Add(Restrictions.Eq(TextModule.PropertyName_ServiceCategory + ".Oid", pServiceCategoryOid)); return c.List(); } - public IEnumerable GetActiveTextbausteineByServiceCategory(long pServiceCategoryOid) - { - var c = CreateCriteriaIsActive(); - - c.Add(Restrictions.Or(Restrictions.Eq(Textbaustein.PropertyName_ServiceCategory + ".Oid", pServiceCategoryOid), Restrictions.IsNull(Textbaustein.PropertyName_ServiceCategory))); - - return c.List(); - } - public IEnumerable GetAllActiveAppointmentsForEmployeeInInterval2(DateTime start, DateTime end, List pEmployeeOids) { var detachedCriteria = DetachedCriteria.For() diff --git a/Service/ServiceContracts/IOperationsService.cs b/Service/ServiceContracts/IOperationsService.cs index d0569956e..c6236fc86 100644 --- a/Service/ServiceContracts/IOperationsService.cs +++ b/Service/ServiceContracts/IOperationsService.cs @@ -723,9 +723,5 @@ namespace BeWo.Service.ServiceContracts [FaultContract(typeof(BeWoFault))] [OperationContract] void DeleteTextbausteine(Dictionary pOid2Version); - - [FaultContract(typeof(BeWoFault))] - [OperationContract] - IList GetTextbausteineByServiceCategory(long pServiceCategoryOid); } } \ No newline at end of file diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs index 7ca2969d6..13f20c99b 100644 --- a/Service/ServiceImplementations/OperationsServiceImp.cs +++ b/Service/ServiceImplementations/OperationsServiceImp.cs @@ -4948,18 +4948,6 @@ namespace BeWo.Service.ServiceImplementations } } - public IList GetTextbausteineByServiceCategory(long pServiceCategoryOid) - { - try - { - return MapperFactory.TextbausteinDC_Textbaustein.MapToNewDCs(DAOFactory.SearchDAO.GetActiveTextbausteineByServiceCategory(pServiceCategoryOid)); - } - catch (Exception e) - { - throw Utils.CreateBeWoFaultException(e); - } - } - public IList InsertNewTextbausteine(IEnumerable pTextbausteine) { try