Ziele und Bewerten repariert
Abfrage bei Klick auf Neu oder Abbrechen beim Unterschriftenfeld und die Buttons sind normalgroß
This commit is contained in:
@@ -724,6 +724,23 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return base.Logout();
|
||||
}
|
||||
|
||||
private List<ValueListEntryDC> LoadAvailableGoals()
|
||||
{
|
||||
var availableGoals = new List<ValueListEntryDC>();
|
||||
|
||||
if(Model.IsInGroupBookingMode)
|
||||
{
|
||||
var list = GetSelectedGroupBookingSupportConcepts();
|
||||
LoadSupportConceptThings(null, false);
|
||||
list.DoForEach(sc => { availableGoals.AddRangeIfElementsNotIn(sc.Goals); });
|
||||
}
|
||||
else
|
||||
{
|
||||
availableGoals = GetAllGoalsForSelectedSupportConcept();
|
||||
}
|
||||
|
||||
return availableGoals;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public string RateSelectedGoal(long? ratingTypeOid, long? goalOid)
|
||||
@@ -735,18 +752,18 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var rating = Model.GoalRatingTypes.FirstOrDefault(ratingType => ratingType.RatingTypeOid == ratingTypeOid);
|
||||
|
||||
var allGoals = new List<ValueListEntryDC>();
|
||||
var allGoals = LoadAvailableGoals();//new List<ValueListEntryDC>();
|
||||
|
||||
if(Model.IsInGroupBookingMode)
|
||||
{
|
||||
var list = GetSelectedGroupBookingSupportConcepts();
|
||||
LoadSupportConceptThings(null, false);
|
||||
list.DoForEach(sc => { allGoals.AddRangeIfElementsNotIn(sc.Goals); });
|
||||
}
|
||||
else if(!Model.IsInGroupBookingMode)
|
||||
{
|
||||
allGoals = GetAllGoalsForSelectedSupportConcept();
|
||||
}
|
||||
//if(Model.IsInGroupBookingMode)
|
||||
//{
|
||||
// var list = GetSelectedGroupBookingSupportConcepts();
|
||||
// LoadSupportConceptThings(null, false);
|
||||
// list.DoForEach(sc => { allGoals.AddRangeIfElementsNotIn(sc.Goals); });
|
||||
//}
|
||||
//else if(!Model.IsInGroupBookingMode)
|
||||
//{
|
||||
// allGoals = GetAllGoalsForSelectedSupportConcept();
|
||||
//}
|
||||
|
||||
var goal = allGoals.FirstOrDefault(g => g.ValueListEntryOid?.Equals(goalOid.Value) ?? false);
|
||||
|
||||
@@ -804,7 +821,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void LoadGoals(List<SupportConceptTreeNodeDetailInfoDC> infos)
|
||||
{
|
||||
try
|
||||
@@ -984,7 +1000,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Authorize]
|
||||
public string LoadStatistics(long oid)
|
||||
@@ -2352,14 +2367,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string UpdateGoals(string pGoalOids)
|
||||
{
|
||||
SkipModelInitialization = true;
|
||||
if (!IsUserLoggedIn())
|
||||
if(!IsUserLoggedIn())
|
||||
{
|
||||
Logout();
|
||||
return "0";
|
||||
}
|
||||
|
||||
|
||||
if(string.IsNullOrEmpty(pGoalOids))
|
||||
{
|
||||
Model.SelectedGoalOids.Clear();
|
||||
@@ -2370,33 +2383,20 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var splitOids = pGoalOids.Trim(';').Split(';');
|
||||
var selectedGoalOids = splitOids.Select(long.Parse).ToList();
|
||||
|
||||
//var allGoals = new List<ValueListEntryDC>();
|
||||
var removedGoalOids = Model.SelectedGoalOids.Except(selectedGoalOids).ToList();
|
||||
|
||||
//if(Model.IsInGroupBookingMode || Model.IsInMultiBookingMode)
|
||||
//{
|
||||
// var supportConcepts = GetSelectedGroupBookingSupportConcepts();
|
||||
// LoadSupportConceptThings(null, false);
|
||||
|
||||
// supportConcepts.DoForEach(supportConcept => { allGoals.AddRangeIfElementsNotIn(supportConcept.Goals); });
|
||||
//}
|
||||
//else if(!Model.IsInGroupBookingMode)
|
||||
//{
|
||||
// allGoals = sc.Goals;
|
||||
//}
|
||||
|
||||
//var parents = CustomerService.GetSupportConceptGoalParents(allGoals.Where(w => w.ParentOid.HasValue).Select(s => s.ParentOid.Value).ToList());
|
||||
|
||||
//allGoals.AddRangeIfElementsNotIn(parents);
|
||||
|
||||
//var goals = allGoals.Where(w => w.ValueListEntryOid.HasValue && selectedGoalOids.Contains(w.ValueListEntryOid.Value)).ToList();
|
||||
|
||||
//var stillSelectedGoals = Model.SelectedGoals.Where(s => goals.Any(a => a.ValueListEntryOid.HasValue && a.ValueListEntryOid.Value == s.ValueListEntryOid)).ToList();
|
||||
|
||||
//Model.SelectedGoals = stillSelectedGoals;
|
||||
//Model.SelectedGoals.AddRangeIfElementsNotIn(DcToMokMapper.CreateZiele(goals));
|
||||
Model.SelectedGoalOids = selectedGoalOids;
|
||||
|
||||
return Model.SelectedGoalOids.Count.ToString() ?? "0";
|
||||
var newGoalOids = selectedGoalOids.Where(goalOid => false == (Model.SelectedGoals?.Any(goal => goal.ValueListEntryOid.HasValue && goal.ValueListEntryOid.Value.Equals(goalOid)) ?? false)).ToList();
|
||||
|
||||
var newGoals = DcToMokMapper.CreateZiele(Model.AllGoals.Where(goal => goal.ValueListEntryOid.HasValue && newGoalOids.Contains(goal.ValueListEntryOid.Value))).ToList();
|
||||
var oldGoals = Model.SelectedGoals.Where(goal => goal.ValueListEntryOid.HasValue && selectedGoalOids.Contains(goal.ValueListEntryOid.Value)).ToList();
|
||||
|
||||
oldGoals.AddRange(newGoals);
|
||||
|
||||
Model.SelectedGoals = oldGoals;
|
||||
|
||||
return string.Join(",", removedGoalOids);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
|
||||
@@ -105,6 +105,35 @@ function showMessagePopupWithCallback(title, message, callback, executeCallbackB
|
||||
);
|
||||
}
|
||||
|
||||
function showMessagePopupWithOkAndCancelCallback(title, message, okCallback, cancelCallback) {
|
||||
$("#popupTitle").text(title);
|
||||
|
||||
if(message !== null) {
|
||||
$("#modal-body").html("<p id=\"popupMessage\"></p>");
|
||||
}
|
||||
|
||||
$("#popupMessage").text(message);
|
||||
|
||||
$("#message-popup-ok-btn").off("click");
|
||||
|
||||
$("#message-popup-ok-btn").on("click", function() {
|
||||
okCallback();
|
||||
});
|
||||
|
||||
$("#message-popup-close-btn, #message-popup-esc-btn").off("click");
|
||||
$("#message-popup-close-btn, #message-popup-esc-btn").on("click",
|
||||
function() {
|
||||
cancelCallback();
|
||||
});
|
||||
|
||||
$("#messagePopup").modal(
|
||||
{
|
||||
backdrop: "static",
|
||||
keyboard: false
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function submitForm(submitButton) {
|
||||
if(hasEmptyRequiredFields($(submitButton.form))) {
|
||||
return;
|
||||
|
||||
@@ -360,7 +360,8 @@ function showGoalRatingPopup(goalOid) {
|
||||
function hideGoalRatingPopup() {
|
||||
try {
|
||||
$("#goal-rating-popup").modal("hide");
|
||||
} catch (error) {
|
||||
resetGoalRatingPopup();
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BeWoPlanerMobil.Util
|
||||
|
||||
public static IList<MokZiel> CreateZiele(IEnumerable<ValueListEntryDC> dclist)
|
||||
{
|
||||
return dclist?.Select(g => CreateZiel(g)).ToList();
|
||||
return dclist?.Select(CreateZiel).ToList();
|
||||
}
|
||||
|
||||
public static MokServiceRecord CreateServiceRecord(ServiceRecordDC dc, ReportModel model)
|
||||
|
||||
@@ -6,42 +6,47 @@
|
||||
{
|
||||
<text>
|
||||
<script type="text/javascript">
|
||||
$("#second-logout-form").submit();
|
||||
$("#second-logout-form").submit();
|
||||
</script>
|
||||
</text>
|
||||
}
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
function rateGoal(ratingTypeOid) {
|
||||
try {
|
||||
var goalOid = $("#goal-to-rate-oid").val();
|
||||
function resetGoalRatingPopup() {
|
||||
$('input[name="goal-rating-radios"]').prop("checked", false);
|
||||
}
|
||||
|
||||
window.updateGoalRating("@Model.BookingModePrefix", goalOid, ratingTypeOid);
|
||||
function rateGoal(ratingTypeOid) {
|
||||
try {
|
||||
var goalOid = $("#goal-to-rate-oid").val();
|
||||
|
||||
$.get("@Url.Action("RateSelectedGoal")",
|
||||
{
|
||||
ratingTypeOid: ratingTypeOid,
|
||||
goalOid: goalOid
|
||||
}).done(
|
||||
function (result) {
|
||||
if(false === checkJson(result)) {
|
||||
hideSpinner();
|
||||
return;
|
||||
}
|
||||
window.updateGoalRating("@Model.BookingModePrefix", goalOid, ratingTypeOid);
|
||||
|
||||
const obj = parseJason(result);
|
||||
$.get("@Url.Action("RateSelectedGoal")",
|
||||
{
|
||||
ratingTypeOid: ratingTypeOid,
|
||||
goalOid: goalOid
|
||||
}).done(
|
||||
function (result) {
|
||||
if(false === checkJson(result)) {
|
||||
resetGoalRatingPopup();
|
||||
hideSpinner();
|
||||
return;
|
||||
}
|
||||
|
||||
$(`#goal-rating-${goalOid}`).text(obj.RatingName);
|
||||
$(`#${goalOid}`).prop("checked", true);
|
||||
hideGoalRatingPopup();
|
||||
$("#goal-to-rate-oid").val("");
|
||||
}
|
||||
);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
const obj = parseJason(result);
|
||||
|
||||
$(`#goal-rating-${goalOid}`).text(obj.RatingName);
|
||||
$(`#${goalOid}`).prop("checked", true);
|
||||
hideGoalRatingPopup();
|
||||
$("#goal-to-rate-oid").val("");
|
||||
}
|
||||
);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@if(Model.HasRightToRateGoals)
|
||||
|
||||
@@ -123,9 +123,28 @@
|
||||
|
||||
window.updateGoals2Ratings("@Model.BookingModePrefix", goalsAsMap);
|
||||
|
||||
$.get("@Url.Action("UpdateGoals")", {pGoalOids: selectedGoals}, function (numberOfSelectedGoals) {
|
||||
$("#goals-button").html(`Ziele <span class='badge badge-light text-primary'>${numberOfSelectedGoals}</span>`);
|
||||
});
|
||||
$.get("@Url.Action("UpdateGoals")", {pGoalOids: selectedGoals}, function (removedGoalOids) {
|
||||
@if(Model.HasAnyRatingTypes)
|
||||
{
|
||||
<text>
|
||||
if(removedGoalOids === null ||removedGoalOids===undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(removedGoalOids === "0") {
|
||||
$(".goal-rating-badge").text("Bewerten");
|
||||
return;
|
||||
}
|
||||
|
||||
const oids = removedGoalOids.split(",");
|
||||
|
||||
$.each(oids, (index, oid) => {
|
||||
$(`#goal-rating-${oid}`).text("Bewerten");
|
||||
});
|
||||
|
||||
</text>
|
||||
}
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
|
||||
@@ -188,15 +188,42 @@
|
||||
Benötigt: Modal-Id
|
||||
*@
|
||||
function singleSignatureCloseButtonEvent(signaturePad) {
|
||||
$("#single-signature-modal").modal("hide");
|
||||
hideSingleSignaturePopup();
|
||||
|
||||
signaturePad.clear();
|
||||
|
||||
return;
|
||||
showMessagePopupWithOkAndCancelCallback(
|
||||
"Unterschreiben abbrechen",
|
||||
"Möchten Sie wirklich das Unterschreiben abbrechen?",
|
||||
() => {
|
||||
signaturePad.clear();
|
||||
},
|
||||
() => {
|
||||
$("#single-signature-modal").modal("show");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function singleSignatureClearButtonEvent(signaturePad) {
|
||||
signaturePad.clear();
|
||||
hideSingleSignaturePopup();
|
||||
|
||||
showMessagePopupWithOkAndCancelCallback(
|
||||
"Unterschriftenfeld leeren",
|
||||
"Möchten Sie wirklich das Unterschriftenfeld leeren?",
|
||||
() => {
|
||||
$("#single-signature-modal").modal("show");
|
||||
signaturePad.clear();
|
||||
},
|
||||
() => {
|
||||
$("#single-signature-modal").modal("show");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function hideSingleSignaturePopup() {
|
||||
$("#single-signature-modal").modal("hide");
|
||||
}
|
||||
|
||||
function showSingleSignaturePopup() {
|
||||
$("#single-signature-modal").modal("show");
|
||||
}
|
||||
|
||||
function signatureFooterClick() {
|
||||
@@ -241,15 +268,15 @@ else
|
||||
<div class="card">
|
||||
<div class="card-header p-0" onclick="signatureFooterClick()">
|
||||
<div class="d-inline-flex">
|
||||
<button type="button" class="btn-sm btn text-primary h-100">
|
||||
<i class="fas fa-chevron-down text-primary" id="single-signature-info-chevron"></i>
|
||||
@Model.ServiceRecord2Monatsunterschrift.ServiceRecord.Customer.LastNameFirstName, @Model.ServiceRecord2Monatsunterschrift.DatumSchraegstrichUhrzeit
|
||||
</button>
|
||||
<button type="button" class="btn-sm btn text-primary h-100">
|
||||
<i class="fas fa-chevron-down text-primary" id="single-signature-info-chevron"></i>
|
||||
@Model.ServiceRecord2Monatsunterschrift.ServiceRecord.Customer.LastNameFirstName, @Model.ServiceRecord2Monatsunterschrift.DatumSchraegstrichUhrzeit
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-inline-flex float-right">
|
||||
<button type="button" class="btn btn-secondary btn-sm m-1" id="single-signature-cancel-btn">Abbrechen</button>
|
||||
<button type="button" class="btn btn-primary btn-sm m-1" id="single-signature-clear-btn">Neu</button>
|
||||
<button type="button" class="btn btn-primary btn-sm m-1 mr-2" id="single-signature-ok-btn">OK</button>
|
||||
<button type="button" class="btn btn-secondary m-1" id="single-signature-cancel-btn">Abbrechen</button>
|
||||
<button type="button" class="btn btn-primary m-1" id="single-signature-clear-btn">Neu</button>
|
||||
<button type="button" class="btn btn-primary m-1 mr-2" id="single-signature-ok-btn">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse" id="single-signature-collapse">
|
||||
|
||||
@@ -53,9 +53,9 @@
|
||||
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/moment/moment.min.js")"></script>
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/moment/locale/de.js")"></script>
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/mobileUtils.js?v=1.7")"></script>
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/mobileUtils.js?v=1.8")"></script>
|
||||
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/view-scripts/main.js?v=2.5")"></script>
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/view-scripts/main.js?v=2.6")"></script>
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/signature.js?v=1.5")"></script>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="@Url.Content("~/Scripts/bootstrap/bootstrap4-modal-fullscreen.min.css")" />
|
||||
|
||||
Reference in New Issue
Block a user