Unterschriftenpopup vergrößert und scrollbar gemacht.

This commit is contained in:
2025-12-03 10:57:54 +01:00
parent f050756a31
commit abbfb80406
8 changed files with 33 additions and 47 deletions

View File

@@ -308,6 +308,7 @@
<Compile Include="Controllers\DevToolsController.cs" />
<Compile Include="Controllers\DevExpressSchedulerController.cs" />
<Compile Include="Controllers\ExternalSignatureController.cs" />
<Compile Include="Controllers\SignableController.cs" />
<Compile Include="Controllers\ReportBaseController.cs" />
<Compile Include="Controllers\ReportController.cs" />
<Compile Include="Controllers\ReportViewerController.cs" />

View File

@@ -39,7 +39,7 @@ using ServiceRecordDC = BS.Shared.DataContracts.ServiceRecordDC;
namespace BeWoPlanerMobil.Controllers
{
public class MainController : AbstractBaseController
public class MainController : SignableController
{
public MainController()
{
@@ -1132,33 +1132,29 @@ namespace BeWoPlanerMobil.Controllers
}
[Authorize]
public ActionResult SaveSignature(FormCollection formCollection)
[HttpPost]
public override ActionResult SaveSignature(FormCollection formCollection)
{
try
{
var blob = formCollection[FormCollectionConstants.ServiceRecordSignatureBlobKey];
var date = DateTime.Parse(formCollection[FormCollectionConstants.ServiceRecordSignatureDateKey]);
long.TryParse(formCollection[FormCollectionConstants.ServiceRecordSignatureRecordOidKey], out var serviceRecordOid);
var serviceRecord = GetServiceRecordDC(serviceRecordOid, false);
long.TryParse(formCollection[FormCollectionConstants.ServiceRecordSignatureObjOidKey], out var objectOid);
if(serviceRecordOid < 1 || serviceRecord is null)
if(objectOid <= 0)
{
var message2Log = string.Empty;
return RedirectToAction("Main", "Main", Model);
}
if(serviceRecordOid < 1)
{
message2Log = $"Einzelunterschrift konnte nicht gespeichert werden, da die ServiceRecordOid {serviceRecordOid} ungültig ist.";
}
else if(serviceRecord is null)
{
message2Log = "Einzelunterschrift konnte nicht gespeichert werden, da der Zeiterfassungseintrag im Model nicht gefunden werden konnte.";
}
var serviceRecord = GetServiceRecordDC(objectOid, false);
Log.Error(message2Log);
if(serviceRecord is null)
{
Log.Error("Einzelunterschrift konnte nicht gespeichert werden, da der Zeiterfassungseintrag im Model nicht gefunden werden konnte.");
TempData[TempDataConstants.ErrorMessageKey] = "Beim Speichern der Unterschrift ist ein Fehler aufgetreten. Bitte wenden Sie sich an Ihren Administrator.";
return RedirectToActionPermanent("Main", "Main");
return RedirectToAction("Main", "Main", Model);
}
long? oid;
@@ -1170,14 +1166,14 @@ namespace BeWoPlanerMobil.Controllers
if(!isValid)
{
TempData[TempDataConstants.ErrorMessageKey] = "Das Unterschriftenfeld darf nicht leer sein.";
return RedirectToActionPermanent("Main", "Main");
return RedirectToAction("Main", "Main", Model);
}
oid = OperationsService.InsertSignature(new SignatureDC
{
DataBild = blob,
Zeitstempel = date,
ServiceRecordOid = serviceRecordOid
ServiceRecordOid = objectOid
}).SignatureOid;
}
@@ -1194,8 +1190,8 @@ namespace BeWoPlanerMobil.Controllers
{
Log.Error("Fehler beim Speichern der Einzelunterschrift: " + ex.Message, ex);
}
return RedirectToActionPermanent("Main", "Main");
return RedirectToAction("Main", "Main", Model);
}
[Authorize]

View File

@@ -0,0 +1,9 @@
using System.Web.Mvc;
namespace BeWoPlanerMobil.Controllers
{
public abstract class SignableController : AbstractBaseController
{
public abstract ActionResult SaveSignature(FormCollection formCollection);
}
}

View File

@@ -31,6 +31,7 @@
public static string BetragKey => "betrag";
public static string ServiceRecordSignatureBlobKey => "service-record-signature-blob";
public static string ServiceRecordSignatureDateKey => "service-record-signature-date";
public static string ServiceRecordSignatureObjOidKey => "signature-obj-oid";
public static string ServiceRecordSignatureRecordOidKey => "service-record-signature-record-oid";
public static string GroupBookingSelectedCb2ScOidsKey => "service-record-group-booking-cb2sc-oids";
public static string GroupBookingSelectedEmployeeOidsKey => "service-record-group-booking-employee-oids";

View File

@@ -1,5 +1,6 @@
@using BeWoPlanerMobil.Views.DevExpressScheduler
@using BS.Shared.DataContracts
@using DevExpress.Data.Helpers
@using DevExpress.XtraScheduler
@model BeWoPlanerMobil.Models.DevExpressSchedulerModel
@@ -25,14 +26,6 @@
settings.Views.MonthView.AppointmentDisplayOptions.ShowRecurrence = true;
settings.Views.MonthView.MonthViewStyles.DateCellBody.Height = Unit.Pixel(170);
settings.Views.FullWeekView.Enabled = true;
settings.Views.WeekView.Enabled = false;
settings.Views.MonthView.ResourcesPerPage = 1;
settings.Views.MonthView.AppointmentDisplayOptions.StartTimeVisibility = AppointmentTimeVisibility.Never;
settings.Views.MonthView.AppointmentDisplayOptions.EndTimeVisibility = AppointmentTimeVisibility.Never;
settings.Views.MonthView.AppointmentDisplayOptions.StatusDisplayType = AppointmentStatusDisplayType.Bounds;
settings.Views.MonthView.AppointmentDisplayOptions.ShowRecurrence = true;
settings.Views.MonthView.MonthViewStyles.DateCellBody.Height = Unit.Pixel(170);
TimeScale[] timeScales =
{
@@ -51,10 +44,6 @@
settings.Storage.Resources.Assign(SchedulerHelper.DefaultResourceStorage);
settings.Storage.Appointments.Assign(SchedulerHelper.DefaultAppointmentStorage);
/*
*
*/
settings.Storage.Appointments.Assign(SchedulerHelper.DefaultAppointmentStorage);
settings.Storage.Resources.Assign(SchedulerHelper.DefaultResourceStorage);
settings.Storage.Appointments.Mappings.Start = nameof(SchedulerAppointmentDC.StartDate);

View File

@@ -291,16 +291,6 @@
}
}
@if(Model.ShowSignature && !serviceRecord.SignatureOid.HasValue && serviceRecord.Customer != null)
{
using(Html.BeginForm("SaveSignature", "Main", FormMethod.Post, new { id = $"save-signature-form-{serviceRecord.ServiceRecordOid.Value}" }))
{
<input type="hidden" name="@FormCollectionConstants.ServiceRecordSignatureBlobKey" id="sr-sig-blob-@serviceRecord.ServiceRecordOid.Value" />
<input type="hidden" name="@FormCollectionConstants.ServiceRecordSignatureDateKey" id="sr-sig-date-@serviceRecord.ServiceRecordOid.Value" />
<input type="hidden" name="@FormCollectionConstants.ServiceRecordSignatureRecordOidKey" id="sr-sig-sr-oid-@serviceRecord.ServiceRecordOid.Value" value="@serviceRecord.ServiceRecordOid.Value" />
}
}
@* Button-Leiste (bearbeiten, löschen, unterschreiben/Unterschrift, externe Unterschrift *@
<div class="btn-group" role="group">
@* Edit-Button *@

View File

@@ -69,7 +69,7 @@
}
@*
Benötigt: ServiceRecord-Oid, Modal-Id, SketchPad-Container-Id, Ok-Button-Id, Neu-Button-Id, Abbrechen-Button-Id
Benötigt: ServiceRecord-Oid, Modal-Id, SketchPad-Container-Id, Ok-Button-Id, Neu-Button-Id, Abbrechen-Button-Id, SketchPad-Id
*@
function initializeSignatureCanvas(serviceRecordOid) {
hideSpinner();
@@ -154,7 +154,7 @@
form.append($("<input>",
{
type: "hidden",
name: "@FormCollectionConstants.ServiceRecordSignatureRecordOidKey",
name: "@FormCollectionConstants.ServiceRecordSignatureObjOidKey",
value: selectedServiceRecordOid
}));
@@ -209,7 +209,7 @@ else
<div id="sr-sg-container"></div>
<div id="single-signature-modal" class="modal" tabindex="-1" role="dialog" data-backdrop="static">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-dialog modal-xl modal-dialog-scrollable" style="max-width: 98% !important;" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Unterschrift</h5>

View File

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