Bug beim Entfernen von ausgewählten Hilfeplänen in Gruppen- und Mehrfachbuchungen.

This commit is contained in:
2025-12-10 13:37:14 +01:00
parent f5de03bd43
commit 8d3d50161d
11 changed files with 104 additions and 45 deletions

View File

@@ -314,6 +314,7 @@
<Compile Include="Controllers\ReportViewerController.cs" />
<Compile Include="Controllers\SchedulerController.cs" />
<Compile Include="Models\AbstractModel.cs" />
<Compile Include="Models\DevExpressSchedulerSessionModel.cs" />
<Compile Include="Models\MokZiel.cs" />
<Compile Include="Models\MokSupportConceptListObject.cs" />
<Compile Include="Models\MokMandator.cs" />

View File

@@ -63,6 +63,7 @@ namespace BeWoPlanerMobil.Controllers
return View(Model);
}
[Authorize]
public ActionResult SchedulerPagePartial()
{

View File

@@ -948,12 +948,6 @@ namespace BeWoPlanerMobil.Controllers
item.IsLeaf = true;
}
//goalTree = goalTree.OrderBy(o => o.ValueListEntryOid).ToList();
//foreach(var item in goalTree)
//{
// SortGoals(item);
//}
return goalTree;
}
@@ -3352,13 +3346,6 @@ namespace BeWoPlanerMobil.Controllers
return RedirectToActionPermanent("Customer", "Customer", new { id = Model.SelectedSupportConcept.Customer.Oid });
}
//if(Model?.SelectedSupportConcept is null && (CustomerModel)Session[ModelSessionConstants.CustomerModelKey] != null)
//{
// var customerModel = (CustomerModel) Session[ModelSessionConstants.CustomerModelKey];
// customerModel.SelectedCustomerOid = null;
// customerModel.SelectedCustomer = null;
//}
return RedirectToActionPermanent("Customer", "Customer");
}
@@ -5123,17 +5110,16 @@ namespace BeWoPlanerMobil.Controllers
}
[Authorize]
public ActionResult ReloadGoals(bool forceReload = false)
public ActionResult ReloadGoals()
{
SkipModelInitialization = true;
if (!IsUserLoggedIn())
if(!IsUserLoggedIn())
{
TempData[TempDataConstants.DoLogoutKey] = true;
}
//LoadGoals();
CreateModelSupportConceptListObjects(forceReload);
CreateModelSupportConceptListObjects(false);
LoadSupportConceptThings(null, true);
Model.GoalRatingTypes = OperationsService.GetAllRatingTypes().OrderBy(o => o.Position).ToList();
Model.HasAnyRatingTypes = Model.HasRightToRateGoals && Model.GoalRatingTypes.Any();

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace BeWoPlanerMobil.Models
{
public class DevExpressSchedulerSessionModel
{
}
}

View File

@@ -832,7 +832,7 @@ namespace BeWoPlanerMobil.Models
#region ServiceRecord-Pagination
public int ServiceRecordCount { get; set; }
public int CurrentPage { get { return MainSessionModel.CurrentPage; } set { MainSessionModel.CurrentPage = value; } }
public int CurrentPage { get => MainSessionModel.CurrentPage; set => MainSessionModel.CurrentPage = value; }
public int MaxResults { get; set; } = 10;

View File

@@ -5,7 +5,26 @@ using DevExpress.Web.Mvc;
using DevExpress.XtraScheduler;
using DayView = DevExpress.Web.ASPxScheduler.DayView;
// TODO: Ist veraltet!
// TODO:
/*
*
* ToDo am 08.12.2025: Folgende Klassen erstellen:
*
* 1: SchedulerDataHelper mit Datenbankzugriffen
* GetAppointments()
* GetResources()
*
*
*
*
*
*
*
* 1. SchedulerDataObject
*
*/
namespace BeWoPlanerMobil.Views.DevExpressScheduler
{
public static class SchedulerHelper

View File

@@ -15,29 +15,29 @@
<script type="text/javascript">
function rateGoal(ratingTypeOid) {
try {
var goalOid = $("#goal-to-rate-oid").val();
var goalOid = $("#goal-to-rate-oid").val();
window.updateGoalRating("@Model.BookingModePrefix", goalOid, ratingTypeOid);
window.updateGoalRating("@Model.BookingModePrefix", goalOid, ratingTypeOid);
$.get("@Url.Action("RateSelectedGoal")",
{
ratingTypeOid: ratingTypeOid,
goalOid: goalOid
}).done(
function (result) {
if(false === checkJson(result)) {
hideSpinner();
return;
}
$.get("@Url.Action("RateSelectedGoal")",
{
ratingTypeOid: ratingTypeOid,
goalOid: goalOid
}).done(
function (result) {
if(false === checkJson(result)) {
hideSpinner();
return;
}
const obj = parseJason(result);
const obj = parseJason(result);
$(`#goal-rating-${goalOid}`).text(obj.RatingName);
$(`#${goalOid}`).prop("checked", true);
hideGoalRatingPopup();
$("#goal-to-rate-oid").val("");
}
);
$(`#goal-rating-${goalOid}`).text(obj.RatingName);
$(`#${goalOid}`).prop("checked", true);
hideGoalRatingPopup();
$("#goal-to-rate-oid").val("");
}
);
} catch(error) {
showErrorPopup(error);
}

View File

@@ -175,7 +175,7 @@
{
var selectedGoal = Model.SelectedGoals.FirstOrDefault(f => f.ValueListEntryOid.HasValue && f.ValueListEntryOid.Value == goalTreeItem.ValueListEntryOid);
if(!(selectedGoal is null))
if(selectedGoal != null)
{
ratingType = Model.GoalRatingTypes.FirstOrDefault(f => f.RatingTypeOid.HasValue && f.RatingTypeOid.Value == selectedGoal.RatingTypeOid);
}

View File

@@ -22,11 +22,29 @@
updateLocallyStoredGroupBookingCb2ScRelOids();
$("#gb-selection-container").load("@Url.Action("RemoveSupportConceptCostbearerRel")", { relOid: relOid }, function() {
$("#goals-tree").load("@Url.Action("ReloadGoals")", function() {
toggleGroupBookingForm();
$("#gb-selection-container").load("@Url.Action("RemoveSupportConceptCostbearerRel")", {relOid: relOid}, function() {
if($("#goals-tree").length <= 0) {
toggleGroupBookingForm();
$("#tree").load("@Url.Action("LoadUpToDateTextModules")", function() {
if($("#tree").length <= 0) {
hideSpinner();
return;
}
$("#tree").load("@Url.Action("LoadUpToDateTextModules")", function() {
hideSpinner();
});
}
$("#goals-tree").load("@Url.Action("ReloadGoals")", function() {
toggleGroupBookingForm();
if($("#tree").length <= 0) {
hideSpinner();
return;
}
$("#tree").load("@Url.Action("LoadUpToDateTextModules")", function() {
hideSpinner();
});
});

View File

@@ -82,6 +82,10 @@
</div>
<div class="collapse @Html.GetCollapsibleClass(Model.Collapsibles2IsShown, "goals-container")" id="goals-container">
<div class="card-body p-1">
<div class="btn-group btn-group-sm mb-1 w-100" role="group">
<button type="button" class="btn btn-outline-primary" onclick="window.showAllGoals()">Alle auf</button>
<button type="button" class="btn btn-outline-primary" onclick="window.hideAllGoals()">Alle zu</button>
</div>
<div class="container p-0" id="goals-tree">
@Html.Partial("GoalTreePartial", Model)
</div>

View File

@@ -23,9 +23,27 @@
updateLocallyStoredMultiBookingCb2ScRelOids();
$("#mb-selection-container").load("@Url.Action("RemoveSupportConceptCostbearerRelFromMultiBooking")", { relOid: relOid }, function() {
$("#goals-tree").load("@Url.Action("ReloadGoals")", function() {
if($("#goals-tree").length <= 0) {
changeMultiBookingFormEnableState($(".mb-cb2sc-input:checkbox:checked").length > 0 ? false : true);
if($("#tree").length <= 0) {
hideSpinner();
return;
}
$("#tree").load("@Url.Action("LoadUpToDateTextModules")", function() {
hideSpinner();
});
}
$("#goals-tree").load("@Url.Action("ReloadGoals")", function() {
changeMultiBookingFormEnableState($(".mb-cb2sc-input:checkbox:checked").length > 0 ? false : true);
if($("#tree").length <= 0) {
hideSpinner();
return;
}
$("#tree").load("@Url.Action("LoadUpToDateTextModules")", function() {
hideSpinner();
});