125 lines
5.3 KiB
Plaintext
125 lines
5.3 KiB
Plaintext
@using BeWoPlanerMobil.Models;
|
|
@using BeWoPlanerMobil.Util
|
|
@using BS.Shared.Extensions
|
|
|
|
@model CustomerModel
|
|
|
|
<script type="text/javascript">
|
|
@if(ViewData["AbsenceTimeError"] is string testMessage)
|
|
{
|
|
<text>
|
|
showMessagePopupWithHtml("Fehler", "<div class='alert' role='alert'>@Html.Raw(ViewData["AbsenceTimeError"])</div>");
|
|
</text>
|
|
}
|
|
|
|
$(window).ready(function() {
|
|
@if(!(Model.SelectedAbsenceTime is null))
|
|
{
|
|
<text>
|
|
$("#customer-absence-times-form-popup").modal("show");
|
|
</text>
|
|
}
|
|
});
|
|
|
|
function deleteAbsenceTime(absenceTimeOid, absenceTimeSpanDescription) {
|
|
try {
|
|
event.stopPropagation();
|
|
|
|
var word = absenceTimeSpanDescription.includes("Ab") ? "" : "vom ";
|
|
|
|
showMessagePopupWithCallback("Abwesenheit löschen",
|
|
"Möchten Sie wirklich die Abwesenheit " + word + absenceTimeSpanDescription.toLowerCase() + " löschen?",
|
|
function() {
|
|
showSpinner();
|
|
|
|
$("#absence-times-container").load("@Url.Action("DeleteAbsenceTime")", {absenceTimeOid: absenceTimeOid}, function() {
|
|
hideSpinner();
|
|
});
|
|
},
|
|
false);
|
|
} catch (error) {
|
|
showErrorPopup(error);
|
|
}
|
|
}
|
|
|
|
function selectAbsenceTime(absenceTimeOid) {
|
|
try {
|
|
event.stopPropagation();
|
|
$.get("@Url.Action("SetSelectedAbsenceTimeOid")", { absenceTimeOid: absenceTimeOid }).done(function(result) {
|
|
if(result !== undefined && result !== null && result.length > 1) {
|
|
showMessagePopupWithHtml("Fehler", "<div class='alert alert-danger' role='alert'>" + result + "</div>");
|
|
} else if(result !== undefined && result !== null && result.length === 1) {
|
|
$("#customer-absence-time-modal-body").load('@Url.Action("LoadAbsenceTimeToForm", "Customer")', function () {
|
|
calcAbsenceTimePrependWidth();
|
|
$("#customer-absence-times-form-popup").modal("show");
|
|
});
|
|
}
|
|
});
|
|
} catch (error) {
|
|
showErrorPopup(error);
|
|
}
|
|
}
|
|
</script>
|
|
|
|
@foreach(var absenceTime in Model.SelectedCustomer.AbsenceTimes.OrderByDescending(at => at.Start))
|
|
{
|
|
if(absenceTime.Start is null)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
<div class="row mb-3">
|
|
<div class="card w-100">
|
|
<div class="card-header" onclick="cardHeaderClick2(this)">
|
|
<div class="row">
|
|
<div class="col-sm-auto mr-auto">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<i class="fas fa-chevron-down h-100 text-bewo-customer-card-header chevron-identifier-class"></i>
|
|
</div>
|
|
<p class="form-control text-bewo-customer-card-header border-0 bg-transparent" style="user-select: none !important;">
|
|
@absenceTime.Start.Value.GetIntervalDescription(absenceTime.End)
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-auto">
|
|
<div class="btn-toolbar justify-content-between">
|
|
<div class="btn-group pr-1" role="group">
|
|
<button class="btn btn-primary" type="button" onclick="selectAbsenceTime(@absenceTime.AbsenceTimeOid)">
|
|
<span class="fas fa-edit mr-0 pr-0"></span>
|
|
</button>
|
|
</div>
|
|
<div class="btn-group" role="group">
|
|
<button class="btn btn-danger" type="button" onclick="deleteAbsenceTime(@absenceTime.AbsenceTimeOid, '@absenceTime.Start.Value.GetIntervalDescription(absenceTime.End)')">
|
|
<span class="fas fa-trash mr-0 pr-0"></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="collapse @Html.GetCollapsibleClass(Model.Collapsibles2IsShown, $"customer-absence-time-{absenceTime.AbsenceTimeOid}")" id="customer-absence-time-@absenceTime.AbsenceTimeOid">
|
|
<div class="card-body">
|
|
<div class="container-fluid px-0">
|
|
<div class="row">
|
|
<div class="col-auto mr-auto text-secondary">
|
|
Kategorie:
|
|
</div>
|
|
<div class="col-auto">
|
|
@absenceTime.Reason.Description
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-auto mr-auto text-secondary">
|
|
Erläuterung:
|
|
</div>
|
|
<div class="col-auto">
|
|
@absenceTime.Notice
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
} |