UserOids { get; set; }
+
+ public MandatorSettings MandatorSettings { get; set; }
+
+ public bool HideServiceRecordInsertedByAndInsertedOn { get; set; }
+ public bool IsEndDateVisible { get; set; }
+ public bool IsServiceRecordNoticeMandatory { get; set; }
+ public bool IsZeiterfassDateNormal { get; set; }
+ public bool SetStartTimeToEndTimeAfterSave { get; set; }
+ public bool ShowAdditionalService { get; set; }
+ public bool ShowAnnualReport { get; set; }
+ public bool ShowArbeitszeiten { get; set; }
+ public bool ShowBetrag { get; set; }
+ public bool ShowChat { get; set; }
+
+ public bool ShowCustomerDistanceFields { get; set; }
+
+ public bool ShowDatevFields { get; set; }
+ public bool ShowDienstplanung { get; set; }
+ public bool ShowDistanceFields { get; set; }
+ public bool ShowEmployeeSignature { get; set; }
+ public bool ShowHilfeplanBezeichnung { get; set; }
+ public bool ShowHilfeplanStatistikReport { get; set; }
+ public bool ShowInfoButtonInCalender { get; set; }
+ public bool ShowKlientenBetreuungszeiten { get; set; }
+ public bool ShowMarker { get; set; }
+ public bool ShowMedication { get; set; }
+ public bool ShowMultipleResourceColors { get; set; }
+ public bool ShowOnlyMySupportConcepts { get; set; }
+ public bool ShowOwnChatSettings { get; set; }
+ public bool ShowPivotGrid { get; set; }
+ public bool ShowRoundedDurationInEmployeeAnalysis { get; set; }
+ public bool ShowRtfTextfield { get; set; }
+ public bool ShowScheduler { get; set; }
+ public bool ShowServicesOverviewHalfOrWholeMonth { get; set; }
+ public bool ShowSignature { get; set; }
+ public bool ShowTeamNews { get; set; }
+ public bool ShowUrlaubsplanung { get; set; }
+ public bool ShowWohnheime { get; set; }
+ public bool AllowStorno { get; set; }
+ public bool DontShowSpitzabrechnung { get; set; }
+ public bool IsOnlyYearMonthVisible { get; set; }
+ public bool IsPasswordSecurityActiv { get; set; }
+ public bool PrinterSettingsUseLandscape { get; set; }
+ public bool PrinterSettingsUseMargins { get; set; }
+ public bool PrinterSettingsUsePaperKind { get; set; }
+ public bool ShowResources { get; set; }
+ public int MaxDaysEditServiceRecordsAllowed { get; set; }
+ public int ZeiterfassungsSchwellwert { get; set; }
+ public int AnzTageZeiterfassErfolgt { get; set; }
+ public int DienstplanungStandardZeilenAnzahl { get; set; }
+ public int HilfeplanAuslaufAuswahl { get; set; }
+ public int TimeUntilUILock { get; set; }
+ public int EinheitZeiterfassung { get; set; }
+
+ public override void ResetValues()
+ {
+ base.ResetValues();
+
+ HideServiceRecordInsertedByAndInsertedOn = false;
+ IsEndDateVisible = false;
+ IsServiceRecordNoticeMandatory = false;
+ IsZeiterfassDateNormal = false;
+ SetStartTimeToEndTimeAfterSave = false;
+ ShowAdditionalService = false;
+ ShowAnnualReport = false;
+ ShowArbeitszeiten = false;
+ ShowBetrag = false;
+ ShowChat = false;
+ ShowCustomerDistanceFields = false;
+ ShowDatevFields = false;
+ ShowDienstplanung = false;
+ ShowDistanceFields = false;
+ ShowEmployeeSignature = false;
+ ShowHilfeplanBezeichnung = false;
+ ShowHilfeplanStatistikReport = false;
+ ShowInfoButtonInCalender = false;
+ ShowKlientenBetreuungszeiten = false;
+ ShowMarker = false;
+ ShowMedication = false;
+ ShowMultipleResourceColors = false;
+ ShowOnlyMySupportConcepts = false;
+ ShowOwnChatSettings = false;
+ ShowPivotGrid = false;
+ ShowRoundedDurationInEmployeeAnalysis = false;
+ ShowRtfTextfield = false;
+ ShowScheduler = false;
+ ShowServicesOverviewHalfOrWholeMonth = false;
+ ShowSignature = false;
+ ShowTeamNews = false;
+ ShowUrlaubsplanung = false;
+ ShowWohnheime = false;
+ AllowStorno = false;
+ DontShowSpitzabrechnung = false;
+ IsOnlyYearMonthVisible = false;
+ IsPasswordSecurityActiv = false;
+ PrinterSettingsUseLandscape = false;
+ PrinterSettingsUseMargins = false;
+ PrinterSettingsUsePaperKind = false;
+ ShowResources = false;
+ MaxDaysEditServiceRecordsAllowed = 0;
+ ZeiterfassungsSchwellwert = 0;
+ AnzTageZeiterfassErfolgt = 0;
+ DienstplanungStandardZeilenAnzahl = 0;
+ HilfeplanAuslaufAuswahl = 0;
+ TimeUntilUILock = 0;
+ EinheitZeiterfassung = 0;
+ }
+ }
+}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs b/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs
index 8f06b5a6b..02b32e3d1 100644
--- a/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs
+++ b/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs
@@ -9,8 +9,6 @@ using System.Threading;
using System.Web;
using BeWo.Data.Access;
-using BeWo.Data.Entities;
-using BeWo.Service.DCEntityMapper;
using BeWo.Service.ServiceImplementations;
using BeWoPlanerMobil.Util;
using BS.Shared;
@@ -222,6 +220,7 @@ namespace BeWoPlanerMobil.Service
MobileSessionFacade.LoggedInUserOid = user.Oid;
MobileSessionFacade.EmployeeFullname = user.Employee.Person.FirstNameLastName;
+ MobileSessionFacade.LoggedInEmployeeOid = user.Employee.Oid;
//MobileSessionFacade.LoggedInEmployee = MapperFactory.EmployeeDC_Employee.MapToNewDC(user.Employee);
}
diff --git a/BeWoPlanerMobil/Service/MobileSessionFacade.cs b/BeWoPlanerMobil/Service/MobileSessionFacade.cs
index cd27e8d2a..8de2f0db9 100644
--- a/BeWoPlanerMobil/Service/MobileSessionFacade.cs
+++ b/BeWoPlanerMobil/Service/MobileSessionFacade.cs
@@ -45,6 +45,12 @@ namespace BeWoPlanerMobil.Service
set => HttpContext.Current.Session["LoggedInUserOid"] = value;
}
+ public static long? LoggedInEmployeeOid
+ {
+ get => HttpContext.Current.Session["LoggedInEmployeeOid"] as long?;
+ set => HttpContext.Current.Session["LoggedInEmployeeOid"] = value;
+ }
+
//public static UserDC LoggedInUser
//{
// get => HttpContext.Current.Session["apuser"] as UserDC;
diff --git a/BeWoPlanerMobil/Util/MobileUtils.cs b/BeWoPlanerMobil/Util/MobileUtils.cs
index 7f4c98796..d13893736 100644
--- a/BeWoPlanerMobil/Util/MobileUtils.cs
+++ b/BeWoPlanerMobil/Util/MobileUtils.cs
@@ -16,6 +16,8 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
+using BeWo.Service.Plugins;
+using BeWoPlanerMobil.Service;
using static System.Int32;
using static System.String;
@@ -622,6 +624,13 @@ namespace BeWoPlanerMobil.Util
public static string GetLeftAppointmentBorder(DevExpress.XtraScheduler.Appointment appointment)
{
+ var showEmployeeColors = appointment.CustomFields["ShowEmployeeColors"] is true;
+
+ if(false == showEmployeeColors)
+ {
+ return "5px solid #C0FFD0";
+ }
+
if(appointment.CustomFields[nameof(SchedulerAppointmentDC.Originator)] is CompactEmployeeDC originator && originator.FilterableBrush?.Color != null)
{
var color = originator.FilterableBrush.Color;
diff --git a/BeWoPlanerMobil/Views/DevExpressScheduler/CustomAppointmentDragToolTip.cshtml b/BeWoPlanerMobil/Views/DevExpressScheduler/CustomAppointmentDragToolTip.cshtml
new file mode 100644
index 000000000..5baea0937
--- /dev/null
+++ b/BeWoPlanerMobil/Views/DevExpressScheduler/CustomAppointmentDragToolTip.cshtml
@@ -0,0 +1,18 @@
+@using BeWoPlanerMobil.Util
+
+
+
+
+
+ AppointmentDrag
+
+
+
+ Press ESC to cancel operation
+
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Views/DevExpressScheduler/CustomAppointmentFormPartial.cshtml b/BeWoPlanerMobil/Views/DevExpressScheduler/CustomAppointmentFormPartial.cshtml
index 6e39461a1..6e582814a 100644
--- a/BeWoPlanerMobil/Views/DevExpressScheduler/CustomAppointmentFormPartial.cshtml
+++ b/BeWoPlanerMobil/Views/DevExpressScheduler/CustomAppointmentFormPartial.cshtml
@@ -4,9 +4,86 @@
@using DevExpress.Web.Mvc.UI
@{
- Html.EnableClientValidation();
- Html.EnableUnobtrusiveJavaScript();
+ Html.EnableClientValidation();
+ Html.EnableUnobtrusiveJavaScript();
+ var isNew = Model.Oid is null;
+
+ var cancelButtonText = "Abbrechen";
+
+ var isOriginator = Model.OriginatorOid?.Equals(Model.LoggedInCompactEmployee.EmployeeOid) ?? false;
+ var isInEmployeeList = Model.SelectedEmployee2SchedulerAppointments.Any(employee2Appointment => employee2Appointment.Employee.Equals(Model.LoggedInCompactEmployee));
+
+ var hasCustomers = Model.SelectedCustomers.Any();
+ var hasEmployees = Model.SelectedEmployee2SchedulerAppointments.Any();
+ var hasResources = Model.SelectedResources.Any();
+
+ var canEditCustomerApt = Model.HasRightKalenderKlientenTermineAendern;
+
+ var canEditEmployeeApt = Model.HasRightKalenderMitarbeiterTermineAendern;
+
+ var canEditResourceApt = Model.HasRightKalenderRessourcenTermineAendern;
+ var canEditOthersResourceApt = Model.HasRightKalenderRessourcenTermineAndererAendern;
+
+ var areButtonsVisible = true;
+
+ if(isOriginator is false || isNew is false)
+ {
+ if(canEditCustomerApt is false && hasCustomers)
+ {
+ areButtonsVisible = false;
+ }
+
+ if(canEditEmployeeApt is false && hasEmployees && isInEmployeeList is false)
+ {
+ areButtonsVisible = false;
+ }
+ }
+
+ // Es ist eigentlich unmöglich als jemand anderes einen Termin anzulegen, denn der angemeldete Mitarbeiter ist ja immer der InsUser.
+ if(isOriginator is false && isNew is false)
+ {
+ if(canEditOthersResourceApt is false && hasResources)
+ {
+ areButtonsVisible = false;
+ }
+ }
+ else if(isNew is false)
+ {
+ // Falls man beim Anlegen mehr Rechte hatte als beim Bearbeiten:
+ if(canEditResourceApt is false && hasResources)
+ {
+ areButtonsVisible = false;
+ }
+ }
+
+ var disabled = string.Empty;
+
+ if(areButtonsVisible is false)
+ {
+ cancelButtonText = "Schließen";
+ disabled = "disabled";
+ }
+
+ var isDeleteButtonVisible = areButtonsVisible && isNew is false;
+
+ var dateInputType = isNew is false && Model.AllDay ? "date" : "datetime-local";
+
+ var start = Model.StartTime.HasValue ? Model.AllDay ? $"{Model.StartTime:yyyy-MM-dd}" : $"{Model.StartTime:yyyy-MM-ddTHH:mm}" : string.Empty;
+ var end = Model.EndTime.HasValue ? Model.AllDay ? $"{Model.EndTime:yyyy-MM-dd}" : $"{Model.EndTime:yyyy-MM-ddTHH:mm}" : string.Empty;
+
+
+ var showEmployeeButton = (Model.HasRightKalenderMitarbeitertermineAnsehen && Model.Oid.HasValue) ||
+ (Model.Oid.HasValue && Model.HasRightKalenderMitarbeiterTermineAendern) ||
+ (Model.Oid is null && Model.HasRightKalenderMitarbeiterTermineAnlegen);
+
+ var showCustomerButton = (Model.HasRightKalenderKliententermineAnsehen && Model.Oid.HasValue) ||
+ (Model.Oid.HasValue && Model.HasRightKalenderKlientenTermineAendern) ||
+ (Model.Oid is null && Model.HasRightKalenderKlientenTermineAnlegen);
+
+ var showResourceButton = (Model.HasRightKalenderRessourcentermineAnsehen && Model.Oid.HasValue) ||
+ (Model.Oid.HasValue && (Model.HasRightKalenderRessourcenTermineAendern && isOriginator || isOriginator is false && Model.HasRightKalenderRessourcenTermineAndererAendern)) ||
+ (Model.Oid is null && Model.HasRightKalenderRessourcenTermineAnlegen);
}
@Html.DevExpress().GetStyleSheets(
ASPxWebClientUIControl.ColorSchemeLight,
diff --git a/Data/SessionFacade.cs b/Data/SessionFacade.cs
index 7db40cc7b..d1eb47d5f 100644
--- a/Data/SessionFacade.cs
+++ b/Data/SessionFacade.cs
@@ -42,7 +42,7 @@ namespace BeWo.Data
{
get
{
- return HttpContext.Current.Session["tenant"] as string;
+ return HttpContext.Current?.Session["tenant"] as string;
}
set
diff --git a/Shared/Core/SchedulerUtils.cs b/Shared/Core/SchedulerUtils.cs
index a293f26bb..b7618fa36 100644
--- a/Shared/Core/SchedulerUtils.cs
+++ b/Shared/Core/SchedulerUtils.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
diff --git a/Shared/DataContracts/SchedulerAppointmentDC.cs b/Shared/DataContracts/SchedulerAppointmentDC.cs
index 0bbcfc22d..8f7c672ad 100644
--- a/Shared/DataContracts/SchedulerAppointmentDC.cs
+++ b/Shared/DataContracts/SchedulerAppointmentDC.cs
@@ -162,6 +162,10 @@ namespace BS.Shared.DataContracts
[DataMember]
public List ServiceRecordList { get; set; }
+ // Nur im DC, damit man im MoK-Scheduler als CustomField darauf zugreifen kann.
+ public bool ShowEmployeeColors { get; set; }
+ public bool CanBeViewed { get; set; } = true;
+ public bool CanBeDeleted { get; set; } = true;
public long? FormerAbsenceTimeOid { get; set; }
public DateTime? Krankheitsmeldung { get; set; }
public AbsenceReasonDC AbsenceReason { get; set; }
diff --git a/Shared/Extensions/DateTimeExtensions.cs b/Shared/Extensions/DateTimeExtensions.cs
index 5fe3a3853..120ab3aa2 100644
--- a/Shared/Extensions/DateTimeExtensions.cs
+++ b/Shared/Extensions/DateTimeExtensions.cs
@@ -614,7 +614,7 @@ namespace BS.Shared.Extensions
$"{start.ToShortDateString()} {start.ToShortTimeString()} - {end.ToShortTimeString()}";
}
- public static DateTime MergeDateWithHoursMinutesSeconds(this DateTime date, int hours, int minutes, int seconds = 0)
+ public static DateTime MergeDateWithHoursMinutesSeconds(this DateTime date, int hours, int minutes = 0, int seconds = 0)
{
var h = hours >= 0 && hours < 24 ? hours : 0;
var m = minutes >= 0 && minutes < 60 ? minutes : 0;