diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs index 8461b3c4a..b04310a29 100644 --- a/BeWo/BeWoApp.xaml.cs +++ b/BeWo/BeWoApp.xaml.cs @@ -538,7 +538,7 @@ namespace BeWo showBetrag = true; showPivotGrid = true; showArbeitszeiten = true; - showMarker = true; + //showMarker = true; showUrlaubsplanung = true; showDienstplanung = true; showHilfeplanBezeichnung = true; diff --git a/BeWo/MainControl.xaml.cs b/BeWo/MainControl.xaml.cs index 20ee35e70..bc8748827 100644 --- a/BeWo/MainControl.xaml.cs +++ b/BeWo/MainControl.xaml.cs @@ -696,7 +696,7 @@ namespace BeWo public bool DoSaveCheck() { - return _CurrentDetailView == null || _CurrentDetailView.DoSaveCheck(); + return _CurrentDetailView is null || _CurrentDetailView.DoSaveCheck(); } private void InitCommandBindings() @@ -706,7 +706,7 @@ namespace BeWo ApplicationCommands.Save, (s, e) => { - if (_CurrentModalPopup == null) + if (_CurrentModalPopup is null) { _CurrentDetailView.SaveData(); } @@ -717,13 +717,13 @@ namespace BeWo }, (s, e) => { - if (_CurrentModalPopup == null) + if (_CurrentModalPopup is null) { - e.CanExecute = _CurrentDetailView != null ? _CurrentDetailView.IsDirty : false; + e.CanExecute = _CurrentDetailView?.IsDirty ?? false; } else { - e.CanExecute = _CurrentDetailView != null && (_CurrentModalPopup is BeWoView && ((BeWoView) _CurrentModalPopup).IsDirty); + e.CanExecute = _CurrentDetailView != null && (_CurrentModalPopup is BeWoView view && view.IsDirty); } })); diff --git a/BeWo/View/Master/ReportView.xaml.cs b/BeWo/View/Master/ReportView.xaml.cs index 5f48560ee..8250930e0 100644 --- a/BeWo/View/Master/ReportView.xaml.cs +++ b/BeWo/View/Master/ReportView.xaml.cs @@ -141,7 +141,7 @@ namespace BeWo.View.Master } // Mitarbeiterstundenkonto - if (BeWoApp.Tenant == "3010479871" || (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewSelf) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewTeams))) + if(BeWoApp.Tenant == "3010479871" || (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewSelf) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewTeams))) { //Aachener Verein tabitem_makonto.Visibility = Visibility.Collapsed; diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index d8589edca..74a4bfb77 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -126,6 +126,8 @@ namespace BeWoPlanerMobil.Controllers TempData["show_pw_change_popup"] = tempDataValue; } } + + Model.ShowMarker = UserSettingsUtils.GetSettingValueAsBool(Model.Mandator.Settings, SettingsKeys.ShowMarker); } var mandatorSettings = Model.Mandator.Settings; @@ -270,7 +272,6 @@ namespace BeWoPlanerMobil.Controllers Log.Info($"Model.SupportConceptListObjects Oids = {sb}"); } - //Log.Info(String.Format("Main() Set CostBearer2SupportConceptOid = -1: Model.SelectedSupportConceptListObject is null {0}, isInList {1}", Model.SelectedSupportConceptListObject is null, isInList)); Model.SelectedSupportConceptListObject = Model.SupportConceptListObjects.FirstOrDefault(f => f.CostBearer2SupportConceptOid == "-1") ?? Model.SupportConceptListObjects.First(); Model.CostBearer2SupportConceptOid = -1; @@ -926,6 +927,7 @@ namespace BeWoPlanerMobil.Controllers appointmentListItemPrototype = appointmentListItem; } + var marker = "on" == collection[FormCollectionConstants.MarkerKey]; string doku1; if(Model.Dokutypes != null && Model.Dokutypes.Length > 0) @@ -1035,7 +1037,10 @@ namespace BeWoPlanerMobil.Controllers Model.NewServiceRecord.Goals = Model.SelectedGoals; Model.NewServiceRecord.Start = zeitenFeld[0]; Model.NewServiceRecord.End = zeitenFeld[1]; - + if(marker) + { + Model.NewServiceRecord.ServiceRecordType = ServiceRecordTypeId.Content; + } Model.NewServiceRecord.DistanceInMeterDecimal = distanceInMeters; if(Model.Employee.EmployeeOid.HasValue) @@ -2287,9 +2292,6 @@ namespace BeWoPlanerMobil.Controllers var newResult = new ValidationResult(); var exitLoop = false; - // ToDo: Prüfen, ob eine Monatsunterschrift mit dem ServiceRecord verbunden ist und, ob die Zeiten geändert wurden. - // ToDo: Ist dem so, dann eine Warnung anzeigen, dass die damit verknpüpfte Unterschrift ungültig oder gelöscht wird, und so nicht mehr auf dem QB angezeigt wird. - if(Model.SelectedSupportConcept != null && Model.SelectedSupportConcept.Goals.Any() && Model.SelectedGoals.Count == 0) { newResult.Message += "Es wurden keine Ziele zugeordnet.

"; @@ -3037,6 +3039,8 @@ namespace BeWoPlanerMobil.Controllers return View("Main", Model); } + var marker = "on" == formCollection[FormCollectionConstants.MarkerKey]; + var distanz = formCollection[FormCollectionConstants.DistanceKey]; decimal? distanceInMeters = null; @@ -3126,6 +3130,11 @@ namespace BeWoPlanerMobil.Controllers Model.NewServiceRecord.Start = zeitenFeld[0]; Model.NewServiceRecord.End = zeitenFeld[1]; + if(marker) + { + Model.NewServiceRecord.ServiceRecordType = ServiceRecordTypeId.Content; + } + Model.NewServiceRecord.DistanceInMeterDecimal = distanceInMeters; if(Model.Employee.EmployeeOid.HasValue) @@ -3545,6 +3554,8 @@ namespace BeWoPlanerMobil.Controllers return View("Main", Model); } + var marker = "on" == formCollection[FormCollectionConstants.MarkerKey]; + var distanz = formCollection[FormCollectionConstants.DistanceKey]; decimal? distanceInMeters = null; @@ -3664,6 +3675,11 @@ namespace BeWoPlanerMobil.Controllers ServiceDescription = OperationsService.GetServiceDescription(Model.SelectedServiceDescriptionOid.Value) }; + if(marker) + { + newServiceRecord.ServiceRecordType = ServiceRecordTypeId.Content; + } + if(Model.IsEndDateVisible) { newServiceRecord.ServiceRecordFormat = ServiceRecordFormate.ZeiterfassungMitEndDatum; diff --git a/BeWoPlanerMobil/Controllers/SchedulerController.cs b/BeWoPlanerMobil/Controllers/SchedulerController.cs index 970e45194..0c174b053 100644 --- a/BeWoPlanerMobil/Controllers/SchedulerController.cs +++ b/BeWoPlanerMobil/Controllers/SchedulerController.cs @@ -56,23 +56,23 @@ namespace BeWoPlanerMobil.Controllers if(AbstractModel.HasRightToInsertRessourceAppointments) { - var allResources = KalenderService.GetAllResources().ToList(); + var allResources = KalenderService.GetAllResources().OrderBy(r => r.Name).ToList(); var categories2Resources = new Dictionary>(); foreach(var category in allResources.Select(resource => resource.ResourceCategory)) { - categories2Resources.AddOrUpdateValueInDictionary(category, allResources.Where(resource => resource.ResourceCategory.Equals(category)).ToList()); + categories2Resources.AddOrUpdateValueInDictionary(category, allResources.Where(resource => resource.ResourceCategory.Equals(category)).OrderBy(r => r.Name).ToList()); } - Model.ResourceCategories2Resources = categories2Resources; + Model.ResourceCategories2Resources = categories2Resources.OrderBy(kvp => kvp.Key.DisplayName).ToDictionary(kvp => kvp.Key, kvp => kvp.Value); } if(Model?.Employee?.EmployeeOid.HasValue ?? false) { var compactEmployee = EmployeeService.GetActiveCompactEmployeeWithOid(Model.Employee.EmployeeOid.Value); - Model.MyTeamEmployees = EmployeeService.GetAllTeamMember(compactEmployee); + Model.MyTeamEmployees = EmployeeService.GetAllTeamMember(compactEmployee).OrderBy(employee => employee.LastName).ToList(); } else if(!(Model is null)) { @@ -81,7 +81,7 @@ namespace BeWoPlanerMobil.Controllers if(AbstractModel.HasRightToViewTeams && (Model?.Employee?.EmployeeOid.HasValue ?? false)) { - Model.MyTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(Model.Employee.EmployeeOid.Value); + Model.MyTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(Model.Employee.EmployeeOid.Value).OrderBy(team => team.Name).ToList(); } if(!(Model is null)) @@ -175,13 +175,13 @@ namespace BeWoPlanerMobil.Controllers if(AbstractModel.HasRightToViewCustomerSelectionInScheduler) { //Model.AllCustomers = EmployeeService.GetActiveCompactCustomersForEmployee(Model.Employee.EmployeeOid).OrderBy(o => o.DetailDescription).ToList(); - Model.AllCustomers = CustomerService.GetAllActiveCompactCustomers(); + Model.AllCustomers = CustomerService.GetAllActiveCompactCustomers().OrderBy(customer => customer.LastName).ToList(); } if(AbstractModel.HasRightToViewEmployeeAppointments) { //Model.AllEmployees = EmployeeService.GetActiveCompactEmployeesForEmployee(Model.Employee.EmployeeOid.Value).OrderBy(o => o.DetailDescription).ToList(); - Model.AllEmployees = EmployeeService.GetAllActiveEmployeesCompact(); + Model.AllEmployees = EmployeeService.GetAllActiveEmployeesCompact().OrderBy(employee => employee.LastName).ToList(); } } @@ -610,59 +610,61 @@ namespace BeWoPlanerMobil.Controllers return LeerzeichenFuerGetMethoden; } - var oidList = ConvertOidStringToList(resourceOids); - - foreach(var oid in oidList) - { - if(!Model.ResourceCategories2Resources.Any(a => a.Value.All(b => b.ResourceOid != oid))) - { - return JsonConvert.SerializeObject(new List()); - } - } - - var dateTimes = ConvertStringDatesToDateTimes(start, end); - - var unavailableResources = KalenderService.CheckResourceAvailability(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointment?.SchedulerAppointmentOid); - - return JsonConvert.SerializeObject(unavailableResources); - - // ToDo: Wieder einchecken + // ALT! //var oidList = ConvertOidStringToList(resourceOids); //foreach(var oid in oidList) //{ // if(!Model.ResourceCategories2Resources.Any(a => a.Value.All(b => b.ResourceOid != oid))) // { - // return LeerzeichenFuerGetMethoden; + // return JsonConvert.SerializeObject(new List()); // } //} //var dateTimes = ConvertStringDatesToDateTimes(start, end); - //if(allDay) - //{ - // dateTimes.EndDate = dateTimes.EndDate.AddDays(1); - //} + //var unavailableResources = KalenderService.CheckResourceAvailability(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointment?.SchedulerAppointmentOid); - //var info = KalenderService.CheckResourceAvailabilityWithEmployeeInformation(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointment?.SchedulerAppointmentOid); + //return JsonConvert.SerializeObject(unavailableResources); - //var result = string.Empty; - - //foreach(var kvp in info) - //{ - // result += $"Die Ressource \"{kvp.Key}\" ist im ausgewählten Zeitraum {start} bis {end} bereits gebucht"; - // if(!kvp.Value.All(string.IsNullOrWhiteSpace)) - // { - // result += ":

"; - // } + var oidList = ConvertOidStringToList(resourceOids); - // foreach(var interval in kvp.Value) - // { - // result += $"{interval}
"; - // } - //} + foreach(var oid in oidList) + { + if(!Model.ResourceCategories2Resources.Any(a => a.Value.All(b => b.ResourceOid != oid))) + { + return LeerzeichenFuerGetMethoden; + } + } - //return result; + var dateTimes = ConvertStringDatesToDateTimes(start, end); + + if(allDay) + { + dateTimes.EndDate = dateTimes.EndDate.AddDays(1); + } + + var recurrenceId = Model.SelectedAppointment.RecurrenceId; + var recurrenceIndex = Model.SelectedAppointment.RecurrenceIndex; + var info = KalenderService.CheckResourceAvailabilityWithEmployeeInformation(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointment?.SchedulerAppointmentOid, null); + + var result = string.Empty; + + foreach(var kvp in info) + { + result += $"Die Ressource \"{kvp.Key}\" ist im ausgewählten Zeitraum {start} bis {end} bereits gebucht"; + if(!kvp.Value.All(string.IsNullOrWhiteSpace)) + { + result += ":

"; + } + + foreach(var interval in kvp.Value) + { + result += $"{interval}
"; + } + } + + return result; } [Authorize] diff --git a/BeWoPlanerMobil/Models/AbstractModel.cs b/BeWoPlanerMobil/Models/AbstractModel.cs index 9b3553221..9461febe1 100644 --- a/BeWoPlanerMobil/Models/AbstractModel.cs +++ b/BeWoPlanerMobil/Models/AbstractModel.cs @@ -155,7 +155,28 @@ namespace BeWoPlanerMobil.Models public static bool HasRightMitarbeiterstundenkontoViewTeams => CheckRight(UserRightType.Mitarbeiterstundenkonto_ViewTeams); public static bool HasRightMitarbeiterstundenkontoViewSelf => CheckRight(UserRightType.Mitarbeiterstundenkonto_ViewSelf); - public static bool HasRightToViewReports => CheckRight(UserRightType.QueryView_View); + public static bool HasRightToViewReports => CheckForAtLeastOneRight(new UserRightType[] + { + UserRightType.ViewAll, + UserRightType.QueryView_View, + UserRightType.Analysis_ServiceOverview_View, + UserRightType.Analysis_Auslastung_View, + UserRightType.Analysis_AuslastungAllEmployee_View, + UserRightType.Analysis_AuslastungTeam_View, + UserRightType.Kilometerauswertung_View, + UserRightType.KilometerauswertungEigene_View, + UserRightType.BewertungAuswertung_View, + UserRightType.PivotTabelleAnsehen, + UserRightType.DienstplanungAnsehen, + UserRightType.AbwesenheitsPlanungAnsehen, + UserRightType.Mitarbeiterstundenkonto_ViewAll, + UserRightType.Mitarbeiterstundenkonto_ViewSelf, + UserRightType.Mitarbeiterstundenkonto_ViewTeams, + UserRightType.Jahresbericht, + UserRightType.Auswertungen_BerichteAnsehen, + UserRightType.Auswertungen_StundenuebersichtAnsehen, + UserRightType.Auswertungen_HilfeplanuebersichtAnsehen + }); public static bool HasRightToViewMitarbeiterstundenkonto { diff --git a/BeWoPlanerMobil/Models/MainModel.cs b/BeWoPlanerMobil/Models/MainModel.cs index 163746097..457950a8c 100644 --- a/BeWoPlanerMobil/Models/MainModel.cs +++ b/BeWoPlanerMobil/Models/MainModel.cs @@ -729,6 +729,8 @@ namespace BeWoPlanerMobil.Models public MandatorDC Mandator { get; set; } public bool IsPasswordSecurityEnabled { get; set; } + + public bool ShowMarker { get; set; } } public class CustomSelectListItem diff --git a/BeWoPlanerMobil/Models/SchedulerModel.cs b/BeWoPlanerMobil/Models/SchedulerModel.cs index 99a835ddf..2423a56d4 100644 --- a/BeWoPlanerMobil/Models/SchedulerModel.cs +++ b/BeWoPlanerMobil/Models/SchedulerModel.cs @@ -85,7 +85,7 @@ namespace BeWoPlanerMobil.Models allResources.AddRangeIfElementsNotIn(cat2res.Value); } - return allResources; + return allResources.OrderBy(resource => resource.Name).ToList(); } } diff --git a/BeWoPlanerMobil/Scripts/view-scripts/main.js b/BeWoPlanerMobil/Scripts/view-scripts/main.js index 76f402731..f24506a2c 100644 --- a/BeWoPlanerMobil/Scripts/view-scripts/main.js +++ b/BeWoPlanerMobil/Scripts/view-scripts/main.js @@ -100,11 +100,11 @@ function submitGroupBookingForm() { } function deactivateGroupBookingForm() { - $("#employees-button, #category-select, #leistung-select, #start-date, #end-date, #start-time, #end-time, #duration, #distance, textarea, #reset-button, #create-button, #textbausteine-button, #hours-minutes-dropdown-btn").prop("disabled", true); + $("#employees-button, #category-select, #leistung-select, #start-date, #end-date, #start-time, #end-time, #duration, #distance, textarea, #reset-button, #create-button, #textbausteine-button, #hours-minutes-dropdown-btn, #gb-marker-cb").prop("disabled", true); } function activateGroupBookingForm() { - $("#employees-button, #category-select, #leistung-select, #start-date, #end-date, #start-time, #end-time, #duration, #distance, textarea, #reset-button, #create-button, #textbausteine-button, #hours-minutes-dropdown-btn").prop("disabled", false); + $("#employees-button, #category-select, #leistung-select, #start-date, #end-date, #start-time, #end-time, #duration, #distance, textarea, #reset-button, #create-button, #textbausteine-button, #hours-minutes-dropdown-btn, #gb-marker-cb").prop("disabled", false); } function deleteServiceRecord(serviceRecordOid) { diff --git a/BeWoPlanerMobil/Scripts/view-scripts/scheduler.js b/BeWoPlanerMobil/Scripts/view-scripts/scheduler.js index b6066c782..865eb94c8 100644 --- a/BeWoPlanerMobil/Scripts/view-scripts/scheduler.js +++ b/BeWoPlanerMobil/Scripts/view-scripts/scheduler.js @@ -121,57 +121,56 @@ function validateAppointmentForm() { $.get(getCheckResourcesAvailabilityUrl(), { start: startDate.format("DD.MM.YYYY HH:mm"), end: endDate.format("DD.MM.YYYY HH:mm"), resourceOids: oidString, allDay: isAllDay }).done(function(result) { if (result.length > 1) { try { - // ToDo: Wieder einchecken! (24.07.2023) - //hideSpinner(); - - //if (result.includes("Fehler!")) { - // showErrorMessagePopup(result.substring(7)); - // return; - //} else { - // showMessagePopupWithHtml("Überschneidung", - // result, - // function() { - // $("#messagePopup .modal-body").html(); - // showSpinner(); - // insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm")); - // }, - // false); - //} - - - var unavailableResources = $.parseJSON(result); - var resourceCount = 0; - var names = ""; - - $.each(unavailableResources, function(index, resource) { - if (names.length > 1) { - names += ", "; - } - - resourceCount++; - - names += resource.Name; - }); - - var unavailableResourcesMessage; - - if(resourceCount > 0) { - if(resourceCount > 1) { - unavailableResourcesMessage = "Einige der ausgewählten Ressourcen (" + names + ") sind zum gewählten Zeitpunkt nicht verfügbar."; - } else { - unavailableResourcesMessage = "Eine der ausgewählten Ressourcen (" + names + ") ist zum gewählten Zeitpunkt nicht verfügbar."; - } - - hideSpinner(); - - showWarningMessageBox("Überschneidung", unavailableResourcesMessage, function() { - $("#messagePopup .modal-body").html(); - showSpinner(); - insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm")); - }, false); + hideSpinner(); + if (result.includes("Fehler!")) { + showErrorMessagePopup(result.substring(7)); return; + } else { + showMessagePopupWithHtml("Überschneidung", + result, + function() { + $("#messagePopup .modal-body").html(); + showSpinner(); + insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm")); + }, + false); } + + // ALT! + //var unavailableResources = $.parseJSON(result); + //var resourceCount = 0; + //var names = ""; + + //$.each(unavailableResources, function(index, resource) { + // if (names.length > 1) { + // names += ", "; + // } + + // resourceCount++; + + // names += resource.Name; + //}); + + //var unavailableResourcesMessage; + + //if(resourceCount > 0) { + // if(resourceCount > 1) { + // unavailableResourcesMessage = "Einige der ausgewählten Ressourcen (" + names + ") sind zum gewählten Zeitpunkt nicht verfügbar."; + // } else { + // unavailableResourcesMessage = "Eine der ausgewählten Ressourcen (" + names + ") ist zum gewählten Zeitpunkt nicht verfügbar."; + // } + + // hideSpinner(); + + // showWarningMessageBox("Überschneidung", unavailableResourcesMessage, function() { + // $("#messagePopup .modal-body").html(); + // showSpinner(); + // insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm")); + // }, false); + + // return; + //} } catch (error) { showErrorPopup(error); return; diff --git a/BeWoPlanerMobil/Util/FormCollectionConstants.cs b/BeWoPlanerMobil/Util/FormCollectionConstants.cs index 16cae73e4..e46514fbf 100644 --- a/BeWoPlanerMobil/Util/FormCollectionConstants.cs +++ b/BeWoPlanerMobil/Util/FormCollectionConstants.cs @@ -24,10 +24,9 @@ public static string RecordsKey => "Records"; public static string ServiceRecordOidHolder2Key => "service-record-oid-holder"; public static string IsInGroupBookingModeKey => "IsInGroupBookingMode"; - public static string IsInMultiBookingModeKey => "IsInMultiBookingMode"; - public static string DurationInMinutesKey => "DurationInMinutes"; + public static string MarkerKey => "marker-cb"; // Kalender public static string AppointmentStartDateKey => "StartDate"; diff --git a/BeWoPlanerMobil/Views/Main/GroupBookingPartial.cshtml b/BeWoPlanerMobil/Views/Main/GroupBookingPartial.cshtml index 1bd927b22..41c49ed01 100644 --- a/BeWoPlanerMobil/Views/Main/GroupBookingPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/GroupBookingPartial.cshtml @@ -146,6 +146,25 @@ + + + @if(Model.ShowMarker) + { +
+
+
+ + +
+
+
+ } + +
+
+
+
+
diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index 2ec1291a5..3494dfe72 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -235,14 +235,14 @@ $("#employeesDropDown, #category-select, #leistung-select, " + "#start-date, #end-date, #start-time, #end-time, #duration, " + "#distance, #textbausteine-button, #goals-button, textarea, #reset-button, " + - "#create-button, #statistics-button, #timeFrameSelect, #hours-minutes-dropdown-btn").prop("disabled", (isSupportConceptSelected ? false : true)); + "#create-button, #statistics-button, #timeFrameSelect, #hours-minutes-dropdown-btn, #marker-cb").prop("disabled", (isSupportConceptSelected ? false : true)); if("@Model.IsInGroupBookingMode".toLowerCase() === "true") { var hasSelectedSupportConcepts = "@Model.SelectedConceptCostBearerRelations.Any()".toLowerCase() === "true"; $("#employees-button, #category-select, #leistung-select, " + "#start-date, #end-date, #start-time, #end-time, #duration, " + - "#distance, textarea, #reset-button, #create-button, #textbausteine-button, #hours-minutes-dropdown-btn").prop("disabled", (hasSelectedSupportConcepts ? false : true)); + "#distance, textarea, #reset-button, #create-button, #textbausteine-button, #hours-minutes-dropdown-btn, #gb-marker-cb").prop("disabled", (hasSelectedSupportConcepts ? false : true)); } $("#fehlerdetail-textarea").prop("disabled", false); diff --git a/BeWoPlanerMobil/Views/Main/MultiBookingPartial.cshtml b/BeWoPlanerMobil/Views/Main/MultiBookingPartial.cshtml index 9fac99543..a419dca9d 100644 --- a/BeWoPlanerMobil/Views/Main/MultiBookingPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/MultiBookingPartial.cshtml @@ -204,7 +204,7 @@ function deactivateMultiBookingForm() { try { - $("#multi-booking-employees-button, #mb-category-select, #mb-leistung-select, #mb-start-date, #mb-end-date, #mb-start-time, #mb-end-time, #mb-duration, #mb-distance, textarea, #mb-reset-button, #mb-create-button, #mb-textbausteine-button, #mb-hours-minutes-dropdown-btn").prop("disabled", true); + $("#multi-booking-employees-button, #mb-category-select, #mb-leistung-select, #mb-start-date, #mb-end-date, #mb-start-time, #mb-end-time, #mb-duration, #mb-distance, textarea, #mb-reset-button, #mb-create-button, #mb-textbausteine-button, #mb-hours-minutes-dropdown-btn, #mb-marker-cb").prop("disabled", true); } catch (error) { showErrorPopup(error); } @@ -212,7 +212,7 @@ function activateMultiBookingForm() { try { - $("#multi-booking-employees-button, #mb-category-select, #mb-leistung-select, #mb-start-date, #mb-end-date, #mb-start-time, #mb-end-time, #mb-duration, #mb-distance, textarea, #mb-reset-button, #mb-create-button, #mb-textbausteine-button, #mb-hours-minutes-dropdown-btn").prop("disabled", false); + $("#multi-booking-employees-button, #mb-category-select, #mb-leistung-select, #mb-start-date, #mb-end-date, #mb-start-time, #mb-end-time, #mb-duration, #mb-distance, textarea, #mb-reset-button, #mb-create-button, #mb-textbausteine-button, #mb-hours-minutes-dropdown-btn, #mb-marker-cb").prop("disabled", false); } catch (error) { showErrorPopup(error); } @@ -339,6 +339,25 @@
+ + + @if(Model.ShowMarker) + { +
+
+
+ + +
+
+
+ } + +
+
+
+
+
diff --git a/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml b/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml index 5b7aa7788..115bcd0a1 100644 --- a/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml @@ -133,81 +133,121 @@ using(Html.BeginForm("CreateOrUpdateServiceRecord", "Main", FormMethod.Post, new { onreset = "serviceDescriptionSelectOnReset('category-select', 'leistung-select', 'textmodule-container', 'tree')", id = "singleBookingForm" })) { -
- +
+ +
+
+
+
+
+
Mitarbeiter
+
+ @Html.DropDownListFor(m => m.SelectedEmployeeOid, Model.EmployeeListItems, new { id = "employeesDropDown", @class = "custom-select", onchange = "setSelectedEmployee()" }) +
+
+
+
+ @if(Model.SelectedSupportConcept != null && Model.SelectedSupportConcept.Goals.Any()) + { +
-
-
-
-
Mitarbeiter
+ +
+
+
+
+
+
+
+ + } + + +
+
+
+
+
+
+ Kategorie +
+
+ @Html.DropDownListFor(m => m.SelectedServiceCategoryOid, Model.ServiceCategoryListItems, new { onchange = "loadServiceDescriptions('category-select', 'leistung-select', 'textmodule-container', 'tree')", @class = "custom-select", Id = "category-select" }) +
+ +
+
+
+ + +
+
+
+
+
+
+ Leistung +
+
+ +
+
+
+
+ + + @if(Model.ShowMarker) + { +
+
+
+ + +
+
+
+ } + +
+
+
+
+
+ + +
+
+
+
+
+
+ Startdatum +
+
+ +
+
+
- @Html.DropDownListFor(m => m.SelectedEmployeeOid, Model.EmployeeListItems, new { id = "employeesDropDown", @class = "custom-select", onchange = "setSelectedEmployee()" })
- @if(Model.SelectedSupportConcept != null && Model.SelectedSupportConcept.Goals.Any()) + + @if(Model.IsEndDateVisible) { - -
-
- -
-
-
-
-
-
-
- - } - - -
-
+
- Kategorie + Enddatum
- @Html.DropDownListFor(m => m.SelectedServiceCategoryOid, Model.ServiceCategoryListItems, new { onchange = "loadServiceDescriptions('category-select', 'leistung-select', 'textmodule-container', 'tree')", @class = "custom-select", Id = "category-select" }) -
- -
-
-
- - -
-
-
-
-
-
- Leistung -
-
- -
-
-
-
- -
-
-
-
-
-
- Startdatum -
-
- -
+ +
@@ -215,182 +255,162 @@
- - @if(Model.IsEndDateVisible) - { -
-
-
-
-
- Enddatum -
-
- -
-
- -
-
-
-
-
- } -
- -
- @{ - var startTimeValue = Model.StartTimeToEdit; - var endTimeValue = Model.EndTimeToEdit; - var divisor = Model.SelectedDurationUnit == "Stunden" ? 60 : 1; - var durationValue = Model.DurationToEdit; + } +
+ +
+ @{ + var startTimeValue = Model.StartTimeToEdit; + var endTimeValue = Model.EndTimeToEdit; + var divisor = Model.SelectedDurationUnit == "Stunden" ? 60 : 1; + var durationValue = Model.DurationToEdit; - if(Model.SetStartTimeToEndTimeAfterSave && !Model.IsInEditingMode) + if(Model.SetStartTimeToEndTimeAfterSave && !Model.IsInEditingMode) + { + startTimeValue = Model.NewStartTime; + endTimeValue = Model.NewEndTime; + durationValue = Model.NewDuration?.ToString(); + if(Model.NewDuration.HasValue) { - startTimeValue = Model.NewStartTime; - endTimeValue = Model.NewEndTime; - durationValue = Model.NewDuration?.ToString(); - if(Model.NewDuration.HasValue) - { - durationValue = (Model.NewDuration / divisor).ToString(); - } + durationValue = (Model.NewDuration / divisor).ToString(); } } -
-
-
-
-
- Von -
-
- -
-
- -
+ } +
+
+
+
+
+ Von
-
-
- -
-
-
-
-
- Bis -
-
- -
-
- -
+ +
+
+
- + +
+
+
+
+
+ Bis +
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ @{ + var labelText = Model.EinheitZeiterfassung == 1 ? "Dauer (h)" : "Dauer"; + } +
+ @labelText +
+
+ + @if(Model.IsZeiterfassungInStdMin) + { +
+ + +
+ } +
+
+
+
+ + @if(Model.ShowDistanceField) + {
- @{ - var labelText = Model.EinheitZeiterfassung == 1 ? "Dauer (h)" : "Dauer"; - } -
- @labelText +
+ Gefahrene Kilometer
- - @if(Model.IsZeiterfassungInStdMin) - { -
- - -
- } +
- - @if(Model.ShowDistanceField) - { -
-
-
-
-
-
- Gefahrene Kilometer -
-
- -
-
-
-
- } - @if(AbstractModel.HasRightToSeeTextModules) - { - - -
-
- + + +
+
+ +
+
+ } +
+
+ @if(Model.NumberOfDokuTypes == 0) + { +
+ +
-
- } -
-
- @if(Model.NumberOfDokuTypes == 0) - { -
- - -
- } - else - { - +
+ @for(var i = 0; i < Model.Dokutypes.Length; i++) + { + var textareaName = i + 1 < 1 ? "Dokumentation" : "Dokumentation" + (i + 1); -
- -
- } -
- } -
-
+
+ +
+ } +
+ }
+
+
}
diff --git a/BeWoPlanerMobil/Views/Scheduler/AppointmentFormPartial.cshtml b/BeWoPlanerMobil/Views/Scheduler/AppointmentFormPartial.cshtml index 3a34ddcb0..049800467 100644 --- a/BeWoPlanerMobil/Views/Scheduler/AppointmentFormPartial.cshtml +++ b/BeWoPlanerMobil/Views/Scheduler/AppointmentFormPartial.cshtml @@ -113,7 +113,7 @@ @if(Model.HasResourcesEmployeesOrCustomers) {
- @if(AbstractModel.HasRightToViewEmployeeAppointments) + @if(AbstractModel.HasRightToViewEmployeeAppointments && AbstractModel.HasRightToInsertEmployeeAppointments) {
@@ -121,7 +121,7 @@
} - @if(AbstractModel.HasRightToViewCustomerSelectionInScheduler) + @if(AbstractModel.HasRightToViewCustomerSelectionInScheduler && AbstractModel.HasRightToInsertCustomerAppointments) {
@@ -129,7 +129,7 @@
} - @if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any()) + @if(AbstractModel.HasRightToViewAllResourceAppointments && AbstractModel.HasRightToInsertRessourceAppointments && Model.ResourceCategories2Resources.Any()) {
@@ -140,7 +140,7 @@
- @if(AbstractModel.HasRightToViewEmployeeAppointments) + @if(AbstractModel.HasRightToViewEmployeeAppointments && AbstractModel.HasRightToInsertEmployeeAppointments) {
@@ -169,7 +169,7 @@
} - @if(AbstractModel.HasRightToViewCustomerSelectionInScheduler) + @if(AbstractModel.HasRightToViewCustomerSelectionInScheduler && AbstractModel.HasRightToInsertCustomerAppointments) {
@@ -207,7 +207,7 @@
} - @if(AbstractModel.HasRightToViewAllResourceAppointments) + @if(AbstractModel.HasRightToViewAllResourceAppointments && AbstractModel.HasRightToInsertRessourceAppointments) {
@@ -293,7 +293,7 @@
-@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any()) +@if(AbstractModel.HasRightToViewAllResourceAppointments && AbstractModel.HasRightToInsertRessourceAppointments && Model.ResourceCategories2Resources.Any()) {