299 lines
16 KiB
Plaintext
299 lines
16 KiB
Plaintext
@model BeWoPlanerMobil.Models.SchedulerModel
|
|
|
|
<script>
|
|
function deleteAppointment(appointmentOid, appointmentIdentifier, isException, subject) {
|
|
try {
|
|
if(isException === false && appointmentOid === 0) {
|
|
$("#appointment-deletion-message").html("Wollen Sie alle Ereignisse des aktuellen Termins \"" + subject + "\", oder nur diesen einen löschen?");
|
|
$("#delete-popup-btn").on("click",
|
|
function () {
|
|
var deleteSeries = $("#deleteSeriesRadio").prop("checked");
|
|
|
|
submitDeletionForm(appointmentIdentifier, deleteSeries);
|
|
});
|
|
$("#delete-occurring-appoinment-popup").modal("show");
|
|
} else {
|
|
submitDeletionForm(appointmentIdentifier, false);
|
|
}
|
|
} catch(error) {
|
|
showErrorPopup(error);
|
|
}
|
|
}
|
|
|
|
function submitDeletionForm(appointmentIdentifier, deleteSeries) {
|
|
try {
|
|
$.get("@Url.Action("DeleteAppointment")", { appointmentIdentifier: appointmentIdentifier, deleteSeries: deleteSeries}).done(function() {
|
|
$("#appointment-list-container").load("@Url.Action("FetchAppointments")");
|
|
$("#delete-occurring-appoinment-popup").modal("hide");
|
|
});
|
|
} catch(error) {
|
|
showErrorPopup(error);
|
|
}
|
|
}
|
|
|
|
function copyToServiceRecord(appointmentIdentifier) {
|
|
try {
|
|
showSpinner();
|
|
|
|
$("#transformAppToServiceRecForm-" + appointmentIdentifier).submit();
|
|
} catch(error) {
|
|
showErrorPopup(error);
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<!-- Popup -->
|
|
<div class="modal" tabindex="-1" role="dialog" id="delete-occurring-appoinment-popup">
|
|
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h6 class="modal-title">Termin löschen</h6>
|
|
<button type="button" class="close" data-dismiss="modal">
|
|
<span>×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body pb-0">
|
|
<p id="appointment-deletion-message"></p>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="radio" name="deleteRadios" id="deleteSeriesRadio" />
|
|
<label class="form-check-label" for="deleteSeriesRadio">Lösche die Serie</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="radio" name="deleteRadios" id="deleteOccurrenceRadio" checked />
|
|
<label class="form-check-label" for="deleteOccurrenceRadio">Lösche dieses Ereignis</label>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Schließen</button>
|
|
<button type="button" class="btn btn-primary" data-dismiss="model" id="delete-popup-btn">OK</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@* Ganztagestermine in eine Liste mit weniger Margin und Padding *@
|
|
<div id="one-day-scheduler-partial-container">
|
|
@if(Model.AppointmentListItems.Any(a => a.AllDay))
|
|
{
|
|
foreach(var appointment in Model.AppointmentListItems.Where(a => a.AllDay))
|
|
{
|
|
<div class="card w-100 mb-3 p-0">
|
|
<div class="card-header border-left appointment-header py-0 my-0" onclick="cardHeaderClick('#chevron-appointment-@appointment.Identifier', '#collapse-appointment-@appointment.Identifier')">
|
|
<div class="d-inline-flex">
|
|
<i class="fas fa-chevron-down h-100 text-primary" id="chevron-appointment-@appointment.Identifier"></i>
|
|
</div>
|
|
<div class="p2 d-inline-flex text-primary h-100">
|
|
<button type="button" class="btn btn-link text-wrap text-break">
|
|
@if(appointment.IsTask)
|
|
{
|
|
<span class="text-bewo-task-red">@appointment.DateTimeInfo</span>
|
|
}
|
|
else
|
|
{
|
|
<span>@appointment.DateTimeInfo</span>
|
|
}
|
|
|
|
@if(appointment.Oid is null)
|
|
{
|
|
<i class="ml-2 fas fa-sync-alt text-secondary"></i>
|
|
}
|
|
|
|
@if(appointment.IsException)
|
|
{
|
|
<span class="fa-stack ml-2 mr-4" style="display: inline;">
|
|
<i class="fas fa-sync-alt fa-stack-1x text-secondary"></i>
|
|
<i class="fas fa-slash fa-stack-1x text-secondary"></i>
|
|
</span>
|
|
}
|
|
|
|
@if(appointment.HasServiceRecord)
|
|
{
|
|
<i class="ml-2 fas fa-clock text-bewo-service-records"></i>
|
|
}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="collapse" id="collapse-appointment-@appointment.Identifier">
|
|
<div class="card-body">
|
|
<div class="container-fluid">
|
|
@if(appointment.HasEmployeesCustomersOrResources && !appointment.IsTask)
|
|
{
|
|
<div class="row">
|
|
@if(!string.IsNullOrWhiteSpace(appointment.EmployeeListInfo))
|
|
{
|
|
<div class="col col-12 col-md-@appointment.ColSize">
|
|
<i class="fas fa-user text-bewo-employee"></i>
|
|
@appointment.EmployeeListInfo
|
|
</div>
|
|
}
|
|
@if(!string.IsNullOrWhiteSpace(appointment.CustomerListInfo))
|
|
{
|
|
<div class="col col-12 col-md-@appointment.ColSize">
|
|
<i class="fas fa-user text-bewo-customers"></i>
|
|
@appointment.CustomerListInfo
|
|
</div>
|
|
}
|
|
@if(!string.IsNullOrWhiteSpace(appointment.ResourceListInfo))
|
|
{
|
|
<div class="col col-12 col-md-@appointment.ColSize">
|
|
<i class="fas fa-cubes text-bewo-resource"></i>
|
|
@appointment.ResourceListInfo
|
|
</div>
|
|
}
|
|
</div>
|
|
<hr />
|
|
}
|
|
|
|
@if(Model.HasRightToEditAppointment(appointment.Identifier) && !appointment.IsTask && appointment.CanBeEdited)
|
|
{
|
|
<div class="row mb-3">
|
|
<div class="col-auto">
|
|
@if(appointment.Oid.HasValue)
|
|
{
|
|
using(Html.BeginForm("SelectAppointmentToEdit", "Scheduler", FormMethod.Post))
|
|
{
|
|
<button type="submit" class="btn btn-primary" onclick="showSpinner()">
|
|
<span class="fas fa-edit"></span>
|
|
</button>
|
|
<input type="hidden" name="scheduler-oid-holder" value="@appointment.Oid" />
|
|
}
|
|
}
|
|
</div>
|
|
<div class="col-auto">
|
|
<button type="button" class="btn btn-bewo-service-records" onclick="copyToServiceRecord('@appointment.Identifier')">
|
|
<span>
|
|
<i class="fas fa-external-link-alt"></i>
|
|
<i class="fas fa-clock"></i>
|
|
</span>
|
|
</button>
|
|
</div>
|
|
|
|
@using(Html.BeginForm("TransformAppointmentToServiceRecord", "Scheduler", FormMethod.Post, new {id="transformAppToServiceRecForm-" + appointment.Identifier}))
|
|
{
|
|
<input type="hidden" value="@appointment.Identifier" name="appointment-id-input" />
|
|
}
|
|
</div>
|
|
}
|
|
<p>@appointment.Description</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
<hr />
|
|
}
|
|
|
|
@foreach(var appointment in Model.AppointmentListItems.Where(a => !a.AllDay))
|
|
{
|
|
<div class="card w-100 mb-3">
|
|
<div class="card-header border-left appointment-header" onclick="cardHeaderClick('#chevron-appointment-@appointment.Identifier', '#collapse-appointment-@appointment.Identifier')">
|
|
<div class="d-inline-flex">
|
|
<i class="fas fa-chevron-down h-100 text-primary" id="chevron-appointment-@appointment.Identifier"></i>
|
|
</div>
|
|
<div class="p2 d-inline-flex text-primary h-100">
|
|
<button type="button" class="btn btn-link text-wrap text-break">
|
|
@if(appointment.IsTask)
|
|
{
|
|
<span class="text-bewo-task-red">@appointment.DateTimeInfo</span>
|
|
}
|
|
else
|
|
{
|
|
<span>@appointment.DateTimeInfo</span>
|
|
}
|
|
|
|
@if(appointment.Oid == null)
|
|
{
|
|
<i class="ml-2 fas fa-sync-alt text-secondary"></i>
|
|
}
|
|
|
|
@if(appointment.IsException)
|
|
{
|
|
<span class="fa-stack ml-2 mr-4" style="display: inline;">
|
|
<i class="fas fa-sync-alt fa-stack-1x text-secondary"></i>
|
|
<i class="fas fa-slash fa-stack-1x text-secondary"></i>
|
|
</span>
|
|
}
|
|
|
|
@if(appointment.HasServiceRecord)
|
|
{
|
|
<i class="ml-1 fas fa-clock text-bewo-service-records"></i>
|
|
}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="collapse" id="collapse-appointment-@appointment.Identifier">
|
|
<div class="card-body">
|
|
<div class="container-fluid">
|
|
@if(appointment.HasEmployeesCustomersOrResources && !appointment.IsTask)
|
|
{
|
|
<div class="row">
|
|
@if(!string.IsNullOrWhiteSpace(appointment.EmployeeListInfo))
|
|
{
|
|
<div class="col col-12 col-md-@appointment.ColSize">
|
|
<i class="fas fa-user text-bewo-employee"></i>
|
|
@appointment.EmployeeListInfo
|
|
</div>
|
|
}
|
|
@if(!string.IsNullOrWhiteSpace(appointment.CustomerListInfo))
|
|
{
|
|
<div class="col col-12 col-md-@appointment.ColSize">
|
|
<i class="fas fa-user text-bewo-customers"></i>
|
|
@appointment.CustomerListInfo
|
|
</div>
|
|
}
|
|
@if(!string.IsNullOrWhiteSpace(appointment.ResourceListInfo))
|
|
{
|
|
<div class="col col-12 col-md-@appointment.ColSize">
|
|
<i class="fas fa-cubes text-bewo-resource"></i>
|
|
@appointment.ResourceListInfo
|
|
</div>
|
|
}
|
|
</div>
|
|
<hr />
|
|
}
|
|
|
|
@if(Model.HasRightToEditAppointment(appointment.Identifier) && !appointment.IsTask && appointment.CanBeEdited)
|
|
{
|
|
<div class="row mb-3">
|
|
|
|
@if(appointment.Oid.HasValue)
|
|
{
|
|
using(Html.BeginForm("SelectAppointmentToEdit", "Scheduler", FormMethod.Post))
|
|
{
|
|
<div class="col-auto">
|
|
<button type="submit" class="btn btn-primary" onclick="showSpinner()">
|
|
<span class="fas fa-edit"></span>
|
|
</button>
|
|
<input type="hidden" name="scheduler-oid-holder" value="@appointment.Oid" />
|
|
</div>
|
|
}
|
|
}
|
|
|
|
<div class="col-auto">
|
|
<button type="button" class="btn btn-primary" onclick="deleteAppointment(@(appointment.Oid ?? 0), '@appointment.Identifier', @appointment.IsException.ToString().ToLower(), '@appointment.Subject')">
|
|
<span class="fas fa-trash-alt"></span>
|
|
</button>
|
|
</div>
|
|
<div class="col-auto">
|
|
<button type="button" class="btn btn-bewo-service-records" onclick="copyToServiceRecord('@appointment.Identifier')">
|
|
<span>
|
|
<i class="fas fa-external-link-alt"></i>
|
|
<i class="fas fa-clock"></i>
|
|
</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
using(Html.BeginForm("TransformAppointmentToServiceRecord", "Scheduler", FormMethod.Post, new {id="transformAppToServiceRecForm-" + appointment.Identifier}))
|
|
{
|
|
<input type="hidden" value="@appointment.Identifier" name="appointment-id-input" />
|
|
}
|
|
}
|
|
<p>@appointment.Description</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div> |