' +
@@ -674,4 +671,39 @@ function textModuleOnClick(textModuleOid) {
$("#textbausteine-popup").modal("hide");
});
+}
+
+function supportConceptSearchOnChange() {
+ try {
+ var text = $("#support-concept-search-input").val().toLowerCase();
+
+ var links = $(".blubb-test");
+
+ if (text.length === 0) {
+ links.show();
+ }
+
+ $.each(links,
+ function(index, item) {
+ var supportConcept = $(item);
+
+ if(supportConcept.find(".supportconcept-name-header").text().toLowerCase().includes(text)) {
+ supportConcept.show();
+ } else {
+ supportConcept.hide();
+ }
+ });
+
+ } catch (error) {
+ logError(error.message);
+ }
+}
+
+function resetSupportConceptSearch() {
+ try {
+ $("#support-concept-search-input").val("");
+ $(".blubb-test").show();
+ } catch (error) {
+ logError(error.message);
+ }
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Scripts/view-scripts/report.js b/BeWoPlanerMobil/Scripts/view-scripts/report.js
index 2b83c3bc1..c1cd7d48e 100644
--- a/BeWoPlanerMobil/Scripts/view-scripts/report.js
+++ b/BeWoPlanerMobil/Scripts/view-scripts/report.js
@@ -45,79 +45,18 @@ function calculateDays() {
$.get(changeDateSelectionUrl, { startDayString: startDay, endDayString: endDay, monthString: month, yearString: year});
}
-function initializeReportSignature(overwrite) {
- $("#report-form-container").hide();
- $("#report-signature-container").addClass("d-block");
-
- if(overwrite) {
- $("#overwriting-employee-signature-alert").addClass("d-block");
+function hideSigningParts(canSign) {
+ try {
+ if(!isUndefinedOrNull(canSign)) {
+ if(canSign === false) {
+ $(".signingContent").hide();
+ } else {
+ $(".signingContent").show();
+ }
+ }
+ } catch (error) {
+ logError("Fehler hideSigningParts: " + error.message);
}
-
- var text = $("#signature-canvas-information").val();
-
- var serviceRecordCount = $("#service-record-count").val();
-
- $("#report-info-column").html("Unterschrift für " + serviceRecordCount + " erbrachte Leistungen von " + text);
-
- resizeCanvas("#report-sketch-pad", "#report-canvas-row");
-
- var canvas = document.getElementById("report-sketch-pad");
-
- var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
-
- var saveButton = document.getElementById("save-report-signature-btn");
- var clearButton = document.getElementById("clear-report-canvas-btn");
- var cancelButton = document.getElementById("cancel-report-signature-btn");
-
- saveButton.addEventListener("click", function() {
- var clonedCanvas = trimCanvas(cloneCanvas(document.getElementById("report-sketch-pad")));
-
- var context = clonedCanvas.getContext("2d");
- context.globalCompositeOperation = "destination-over";
- context.fillStyle = "white";
- context.fillRect(0, 0, clonedCanvas.width, clonedCanvas.height);
-
- var dataUrl = clonedCanvas.toDataURL("image/png");
-
- showMessagePopupWithCallback("Unterschrift speichern", "Mit dem Speichern der Unterschrift ist es nicht mehr möglich, die betroffenen Einträge der Zeiterfassung zu ändern.", function() {
- showSpinner();
-
- var signatureCreationUrl = getCreateSignatureForServiceOverviewUrl();
-
- showSpinner();
-
- $.post(signatureCreationUrl, { base64SignatureString: dataUrl, customerOidString: null, isCustomerSignature: false, overwrite: overwrite }).done(function(json) {
- hideSpinner();
-
- if(isEmptyOrSpaces(json)) {
- // Ist umbenannt in report-signature-container
- $("#signature-container").removeClass("d-block");
- $("#main-container, #checkbox-container").show();
- showMessagePopupWithCallback("Unterschrift", "Die Unterschrift wurde erfolgreich gespeichert.", function() {
- showSpinner();
- location.reload();
- }, true);
- } else {
- showMessagePopup("Fehler", json);
- signaturePad.clear();
- }
- });
- }, false);
- });
-
- clearButton.addEventListener("click", function() {
- signaturePad.clear();
- });
-
- cancelButton.addEventListener("click", function() {
- showMessagePopupWithCallback("Unterschrift", "Sind Sie sicher, dass Sie die Unterschrift nicht speichern möchten?",
- function() {
- $("#report-signature-container").removeClass("d-block");
- $("#report-form-container").show();
-
- signaturePad.clear();
- }, false);
- });
}
function confirmReportSignatureCancellation() {
@@ -226,30 +165,132 @@ function onCustomerSelectionChange() {
});
}
-function openCustomerSignaturePopup(numberOfEntries, customerName, timeSpan, customerOid, overwrite) {
- // Popup anzeigen
- $("#report-form-container").hide();
-
- $("#report-customer-signature-container").addClass("d-block");
-
- $("#report-customer-info-column").html("Unterschrift für " + numberOfEntries + " erbrachte Leistungen von " + customerName + " (" + timeSpan + ")");
+// Lädt die bisher geleisteten Unterschriften
+function getSignatures(signatureOidStrings, containerId) {
+ try {
+ showSpinner();
- if (overwrite) {
- $("#overwriting-customer-signature-alert").addClass("d-block");
+ var container = $(containerId);
+ container.html("");
+
+ $.get(getLoadConfirmationReceiptSignaturesUrl(), { oidsAsString: signatureOidStrings }).done(function(json) {
+ if(isUndefinedOrNull(json) || !checkJson(json)) {
+ if(!checkJson(json)) {
+ hideSpinner();
+ logError("Fehler loadConfirmationReceiptSignatures: " + json);
+ }
+ }
+
+ if(isEmptyOrSpaces(json)) {
+ hideSpinner();
+ return;
+ }
+
+ var signatureList = $.parseJSON(json);
+
+ var newHtml = "";
+
+ $.each(signatureList, function(index, signature) {
+ newHtml += '
' +
+ '
' +
+ '

' +
+ "
" +
+ "
";
+ });
+
+ container.append(newHtml);
+ hideSpinner();
+ });
+ } catch(error) {
+ logError("Fehler getSignatures: " + error.message);
+ hideSpinner();
}
+}
- resizeCanvas("#report-customer-sketch-pad", "#report-customer-canvas-row");
+function cancelSignature(canSign, signaturePad) {
+ try {
+ if (canSign === false) {
+ hideSignatureContainer(canSign, signaturePad);
- var canvas = document.getElementById("report-customer-sketch-pad");
+ signaturePad.clear();
- var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
+ return;
+ }
- var saveButton = document.getElementById("save-report-customer-signature-btn");
- var clearButton = document.getElementById("clear-report-customer-canvas-btn");
- var cancelButton = document.getElementById("cancel-report-customer-signature-btn");
+ showMessagePopupWithCallback("Unterschrift",
+ "Sind Sie sicher, dass Sie die Unterschrift nicht speichern möchten?",
+ function() {
+ hideSignatureContainer(canSign, signaturePad);
- saveButton.addEventListener("click", function() {
- var clonedCanvas = trimCanvas(cloneCanvas(document.getElementById("report-customer-sketch-pad")));
+ signaturePad.clear();
+ },
+ false);
+ } catch (ex) {
+ logError("Fehler getSignatures: " + ex);
+ }
+}
+
+function hideSignatureContainer() {
+ $("#report-signature-container-div").removeClass("d-block");
+ $("#overwriting-signature-alert").removeClass("d-block");
+ $("#report-form-container").show();
+}
+
+function showSignaturePad(overwrite, signatureOidsString, canSign, cardBodyId, customerOid, numberOfEntries, customerName, timeSpan, isEmployeeSignature) {
+ try {
+ cardHeaderButtonClick(cardBodyId);
+
+ $("#report-form-container").hide();
+ $("#report-signature-container-div").addClass("d-block");
+
+ var plural = "";
+ if(!isEmptyOrSpaces(signatureOidsString) && signatureOidsString.includes(",")) {
+ plural = "en";
+ }
+
+ var entryCount = parseInt(numberOfEntries, 10);
+
+ var leistungPlural = entryCount > 1 ? "en" : "";
+
+ $("#report-info-column-h4").html("Unterschrift" + plural + " für " + numberOfEntries + " erbrachte Leistung" + leistungPlural + " von " + customerName + " (" + timeSpan + ")");
+
+ if(overwrite) {
+ $("#overwriting-signature-alert").addClass("d-block");
+ }
+
+ getSignatures(signatureOidsString, "#signature-container-div");
+
+ hideSigningParts(canSign);
+
+ resizeCanvas("#report-sketch-pad-canvas", "#report-canvas-row-div");
+
+ var canvas = document.getElementById("report-sketch-pad-canvas");
+
+ var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
+
+ var cancelButton = document.getElementById("cancel-report-signature-button");
+ var saveButton = document.getElementById("save-report-signature-button");
+ var clearButton = document.getElementById("clear-report-canvas-button");
+
+ cancelButton.addEventListener("click", function() {
+ cancelSignature(canSign, signaturePad);
+ });
+
+ saveButton.addEventListener("click", function() {
+ saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad);
+ });
+
+ clearButton.addEventListener("click", function() {
+ signaturePad.clear();
+ });
+ } catch (ex) {
+ logError("Fehler showSignaturePad: " + ex);
+ }
+}
+
+function saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad) {
+ try {
+ var clonedCanvas = trimCanvas(cloneCanvas(document.getElementById("report-sketch-pad-canvas")));
var context = clonedCanvas.getContext("2d");
context.globalCompositeOperation = "destination-over";
@@ -258,67 +299,38 @@ function openCustomerSignaturePopup(numberOfEntries, customerName, timeSpan, cus
var dataUrl = clonedCanvas.toDataURL("image/png");
- showMessagePopupWithCallback("Unterschrift speichern", "Mit dem Speichern der Unterschrift ist es nicht mehr möglich, die betroffenen Einträge der Zeiterfassung zu ändern.",
+ showMessagePopupWithCallback(
+ "Unterschrift speichern",
+ "Mit dem Speichern der Unterschrift ist es nicht mehr möglich, die betroffenen Einträge der Zeiterfassung zu ändern.",
function() {
- var url = getCreateSignatureForServiceOverviewUrl();
+ try {
+ showSpinner();
- $.post(url, { base64SignatureString: dataUrl, customerOidString: customerOid, isCustomerSignature: true, overwrite: overwrite }).done(function(json) {
- hideSpinner();
+ var url = getCreateSignatureForServiceOverviewUrl();
- if(isEmptyOrSpaces(json)) {
- showMessagePopupWithCallback("Unterschrift",
- "Die Unterschrift wurde erfolgreich gespeichert.",
- function() {
- showSpinner();
- location.reload();
- },
- true);
- } else {
- showMessagePopup("Fehler", json);
- signaturePad.clear();
- }
- });
+ $.post(url, { base64SignatureString: dataUrl, customerOidString: customerOid, isCustomerSignature: !isEmployeeSignature, overwrite: overwrite }).done(function(json) {
+ hideSpinner();
+
+ if(isEmptyOrSpaces(json)) {
+ showMessagePopupWithCallback("Unterschrift",
+ "Die Unterschrift wurde erfolgreich gespeichert.",
+ function() {
+ showSpinner();
+ location.reload();
+ },
+ true);
+ } else {
+ showMessagePopup("Fehler", json);
+ signaturePad.clear();
+ }
+ });
+ } catch (innerEx) {
+ logError("Popup callback: " + innerEx);
+ }
},
false);
- });
- clearButton.addEventListener("click", function() {
- signaturePad.clear();
- });
-
- cancelButton.addEventListener("click", function() {
- showMessagePopupWithCallback("Unterschrift", "Sind Sie sicher, dass Sie die Unterschrift nicht speichern möchten?",
- function() {
- $("#report-customer-signature-container").removeClass("d-block");
- $("#overwriting-customer-signature-alert").removeClass("d-block");
- $("#report-form-container").show();
-
- signaturePad.clear();
- }, false);
- });
-}
-
-function showCustomerSignature(signatureOid) {
- loadConfirmationReceiptSignature(signatureOid);
-}
-
-function loadConfirmationReceiptSignature(signatureOid) {
- var url = getLoadConfirmationReceiptSignatureUrl();
-
- $.get(url, { signatureOidString: signatureOid }).done(function(json) {
- $("#signature-img-popup").addClass("d-block");
-
- $("#signature-holder-img").prop("src", json);
- });
-}
-
-function hideConfirmationReceiptSignature() {
- $("#signature-img-popup").removeClass("d-block");
- $(".modal-backdrop").hide();
-}
-
-function showEmployeeSignature(signatureOid) {
- $("#employee-signature-list").hide();
-
- loadConfirmationReceiptSignature(signatureOid);
+ } catch (ex) {
+ logError("saveSignature: " + ex);
+ }
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs b/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs
index 89dca3c82..d3e1f853b 100644
--- a/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs
+++ b/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs
@@ -128,6 +128,7 @@ namespace BeWoPlanerMobil.Service
if (string.IsNullOrEmpty(tenant))
{
+ //TODO: ist bei showPin=1 null!
tenant = HttpContext.Current.Request.Params["tb_tenant"];
MobileSessionFacade.Tenant = tenant;
}
@@ -150,22 +151,32 @@ namespace BeWoPlanerMobil.Service
private static bool TryAuthenticateWithLoginForm(HttpApplication context)
{
- var name = context.Request.Params["tb_login"];
+ var name = context.Request.Params["tb_login"];
var password = context.Request.Params["tb_password"];
- var tenant = context.Request.Params["tb_tenant"];
+ var tenant = context.Request.Params["tb_tenant"];
+ var pin = context.Request.Params["tb_pin"];
if (Utils.IsAnyNullOrEmpty(name, password, tenant))
{
return false;
}
+ if(pin != null)
+ {
+ var browserType = context.Request.Browser.Type;
+ var browserPlatform = context.Request.Browser.Platform;
+
+
+
+ pin += "_" + browserType + "_" + browserPlatform;
+ }
+
MobileSessionFacade.Tenant = tenant;
- var s = new UserServiceImp();
+ var userService = new UserServiceImp();
- //log.Info(String.Format("TryAuthenticateWithLoginForm with username: '{0}', Password: '{1}', Tenant: {2}", name, password, MobileSessionFacade.Tenant));
- log.Info($"TryAuthenticateWithLoginForm with username: '{name}', Tenant: {MobileSessionFacade.Tenant}");
+ log.Info($"TryAuthenticateWithLoginForm with username: '{name}', Tenant: {MobileSessionFacade.Tenant}, PIN: {pin}");
- if (s.IsUserValid(name, password, null, "MobilClient", false) == UserValidationResult.UserValid)
+ if (userService.IsUserValid(name, password, pin, "MobilClient", false) == UserValidationResult.UserValid)
{
var user = DAOFactory.UserDAO.FindUserByLoginName(name);
diff --git a/BeWoPlanerMobil/Service/MobileSessionFacade.cs b/BeWoPlanerMobil/Service/MobileSessionFacade.cs
index 267348fe9..6a5ddf07f 100644
--- a/BeWoPlanerMobil/Service/MobileSessionFacade.cs
+++ b/BeWoPlanerMobil/Service/MobileSessionFacade.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Collections.Generic;
+using System.Linq;
using System.Web;
using BeWo.Data.Entities;
@@ -46,6 +47,10 @@ namespace BeWoPlanerMobil.Service
public static CompactEmployeeDC LoggedInCompactEmployee => LoggedInUser == null ? null : MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(LoggedInUser.Employee);
+ public static UserDC LoggedInUserDC => LoggedInUser == null ? null : MapperFactory.UserDC_User.MapToNewDC(LoggedInUser);
+
+ public static List
UserSettings => LoggedInUserDC.Settings;
+
public static string Tenant
{
get => HttpContext.Current.Session["tenant"] as string;
@@ -68,5 +73,7 @@ namespace BeWoPlanerMobil.Service
{
return LoggedInUser != null && LoggedInUser.UserGroups.Any(ug => ug.Rights.Any(rr => rr.RightType.Equals(userRightType)));
}
- }
+
+ public static string CookieName => "tenantKeks";
+ }
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Util/QuittierungsbelegItem.cs b/BeWoPlanerMobil/Util/QuittierungsbelegItem.cs
index 1d607d4cd..89c8d95aa 100644
--- a/BeWoPlanerMobil/Util/QuittierungsbelegItem.cs
+++ b/BeWoPlanerMobil/Util/QuittierungsbelegItem.cs
@@ -1,5 +1,6 @@
using System;
using BeWo.Report.ReportObjects;
+using BS.Shared.DataContracts.Compact;
namespace BeWoPlanerMobil.Util
{
@@ -18,7 +19,11 @@ namespace BeWoPlanerMobil.Util
public string Employees { get; set; }
public long ServiceRecordOid { get; set; }
-
+
+ public bool HasCustomerSignature { get; set; }
+
+ public bool HasEmployeeSignature { get; set; }
+
public QuittierungsbelegItem(ServicesOverviewRO.ServiceDetail serviceDetail)
{
Kontaktart = serviceDetail.IsGroup ? "GR" : "E";
diff --git a/BeWoPlanerMobil/Util/QuittierungsbelegResult.cs b/BeWoPlanerMobil/Util/QuittierungsbelegResult.cs
index 040872012..ac6ac27fd 100644
--- a/BeWoPlanerMobil/Util/QuittierungsbelegResult.cs
+++ b/BeWoPlanerMobil/Util/QuittierungsbelegResult.cs
@@ -1,5 +1,8 @@
using System;
using System.Collections.Generic;
+using System.Linq;
+using BeWoPlanerMobil.Util.ReportUtils;
+using BS.Shared.Extensions;
namespace BeWoPlanerMobil.Util
{
@@ -17,14 +20,26 @@ namespace BeWoPlanerMobil.Util
public long? CustomerSignatureOid { get; }
- public QuittierungsbelegResult(string customerName, List items, long customerOid, bool hasCustomerSignature, long? customerSignatureOid)
+ public SignatureState CustomerSignatureState { get; }
+
+ public SignatureState EmployeeSignatureState { get; }
+
+ public List CustomerSignatureOids { get; }
+
+ public List EmployeeSignatureOids { get; }
+
+ public QuittierungsbelegResult(string customerName, List items, long customerOid, bool hasCustomerSignature, long? customerSignatureOid, SignatureState customerSignatureStatus, List customerSignatureOids, SignatureState employeeSignatureState, List employeeSignatureOids)
{
- CustomerName = customerName;
- Items = items;
- Identifier = Guid.NewGuid();
- CustomerOid = customerOid;
- HasCustomerSignature = hasCustomerSignature;
- CustomerSignatureOid = customerSignatureOid;
+ CustomerName = customerName;
+ Items = items;
+ Identifier = Guid.NewGuid();
+ CustomerOid = customerOid;
+ HasCustomerSignature = hasCustomerSignature;
+ CustomerSignatureOid = customerSignatureOid;
+ CustomerSignatureState = customerSignatureStatus;
+ CustomerSignatureOids = customerSignatureOids;
+ EmployeeSignatureState = employeeSignatureState;
+ EmployeeSignatureOids = employeeSignatureOids;
}
}
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Util/ReportUtils/ConfirmationReceiptObject.cs b/BeWoPlanerMobil/Util/ReportUtils/ConfirmationReceiptObject.cs
index 027d43449..52d265b37 100644
--- a/BeWoPlanerMobil/Util/ReportUtils/ConfirmationReceiptObject.cs
+++ b/BeWoPlanerMobil/Util/ReportUtils/ConfirmationReceiptObject.cs
@@ -28,16 +28,26 @@ namespace BeWoPlanerMobil.Util.ReportUtils
public bool HasEmployeeSignature { get; }
+ public SignatureState EmployeeSignatureState { get; }
+
public List EmployeeSignatures { get; }
- public ConfirmationReceiptObject(string information, List confirmationReceiptResultList, string signatureCanvasInformation, string timeSpanString, bool hasEmployeeSignature, List employeeSignatures)
+ public ConfirmationReceiptObject(string information, List confirmationReceiptResultList, string signatureCanvasInformation, string timeSpanString, bool hasEmployeeSignature, List employeeSignatures, SignatureState employeeSignatureState)
{
- Information = information;
+ Information = information;
ConfirmationReceiptResultList = confirmationReceiptResultList;
- SignatureCanvasInformation = signatureCanvasInformation;
- TimeSpanString = timeSpanString;
- HasEmployeeSignature = hasEmployeeSignature;
- EmployeeSignatures = employeeSignatures;
+ SignatureCanvasInformation = signatureCanvasInformation;
+ TimeSpanString = timeSpanString;
+ HasEmployeeSignature = hasEmployeeSignature;
+ EmployeeSignatures = employeeSignatures;
+ EmployeeSignatureState = employeeSignatureState;
}
}
+
+ public enum SignatureState
+ {
+ None,
+ Some,
+ All
+ }
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Views/Customer/Customer.cshtml b/BeWoPlanerMobil/Views/Customer/Customer.cshtml
index 059200bc3..87e86d5f3 100644
--- a/BeWoPlanerMobil/Views/Customer/Customer.cshtml
+++ b/BeWoPlanerMobil/Views/Customer/Customer.cshtml
@@ -13,7 +13,7 @@
@Html.LabelFor(m => m.SelectedCustomerOid)
- @Html.DropDownListFor(m => m.SelectedCustomerOid, Model.CustomerListItems, new { onchange = "submitCustomerSelectionForm();", @class = "form-control" })
+ @Html.DropDownListFor(m => m.SelectedCustomerOid, Model.CustomerListItems, new { onchange = "submitCustomerSelectionForm();", @class = "custom-select" })
}
@@ -257,14 +257,15 @@
@foreach(var umfeldPerson in Model.SelectedJsonCustomer.Umfeldpersonen)
{
- Hilfeplanauswahl bzw. CostbearerRelations
- Zeitraum
- Anzahl Stunden pro Woche (fest, keine andere Auswahl zunächst)
-
-
+
+ Hilfeplanauswahl bzw. CostbearerRelations
+ Zeitraum
+ Anzahl Stunden pro Woche (fest, keine andere Auswahl zunächst)
+
diff --git a/BeWoPlanerMobil/Views/Login/Index.cshtml b/BeWoPlanerMobil/Views/Login/Index.cshtml
index 4aab6a35f..b5a2290ec 100644
--- a/BeWoPlanerMobil/Views/Login/Index.cshtml
+++ b/BeWoPlanerMobil/Views/Login/Index.cshtml
@@ -47,6 +47,16 @@