2026-06-29 13:45:15 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
function onAppointmentTipDisplaying(s, e) {
|
|
|
|
|
const currentApt = getCurrentApt();
|
2026-07-16 16:01:13 +02:00
|
|
|
console.log(currentApt);
|
2026-06-29 13:45:15 +02:00
|
|
|
if(currentApt.updated === false) {
|
|
|
|
|
scheduler.RefreshClientAppointmentProperties(currentApt, AppointmentPropertyNames.Normal, OnAppointmentRefresh);
|
|
|
|
|
setAptToolTipSubject("Lade...");
|
|
|
|
|
} else {
|
|
|
|
|
setAptToolTipSubject(currentApt.GetSubject());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const participationInfos = currentApt.ParticipationInfos;
|
|
|
|
|
const resourceInfos = currentApt.ResourceInfos;
|
|
|
|
|
const customerInfos = currentApt.CustomerInfos;
|
2026-07-16 16:01:13 +02:00
|
|
|
|
2026-06-29 13:45:15 +02:00
|
|
|
let bgClass = "";
|
|
|
|
|
|
|
|
|
|
$("#tool-tip-info").empty();
|
|
|
|
|
|
|
|
|
|
if(participationInfos.length > 0) {
|
|
|
|
|
$("#tool-tip-info").append(`<div id="participation-container"></div><hr class="m-1" />`);
|
|
|
|
|
$("#participation-container").append(`<span class="small pr-1">Mitarbeiter:</span>`);
|
|
|
|
|
|
|
|
|
|
participationInfos.forEach((info) => {
|
|
|
|
|
switch(info.ParticipationAnswer) {
|
|
|
|
|
case 1:
|
|
|
|
|
bgClass = "badge-bewo-apt-confirm";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
bgClass = "badge-bewo-apt-decline";
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
bgClass = "badge-bewo-apt-maybe";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
bgClass = "badge-light border";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#participation-container").append(`<span class="badge ${bgClass}">${info.EmployeeName}</span>`);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(customerInfos.length > 0) {
|
|
|
|
|
$("#tool-tip-info").append(`<div id="customers-container"></div><hr class="m-1" />`);
|
|
|
|
|
$("#customers-container").append(`<span class="small pr-1">Klienten:</span>`);
|
|
|
|
|
|
|
|
|
|
customerInfos.forEach((info) => {
|
|
|
|
|
$("#customers-container").append(`<span class="badge badge-light border">${info.CustomerName}</span>`);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(resourceInfos.length > 0) {
|
|
|
|
|
$("#tool-tip-info").append(`<div id="resources-container"></div><hr class="m-1" />`);
|
|
|
|
|
$("#resources-container").append(`<span class="small pr-1">Ressourcen:</span>`);
|
|
|
|
|
|
|
|
|
|
resourceInfos.forEach((info) => {
|
|
|
|
|
$("#resources-container").append(`<span class="badge badge-light border"><div class="mr-1" style="display:inline-block;border-radius:3px;vertical-align:middle;width:10px;height:10px;border:1px slategray;background-color: ${info.ResourceColor};"></div>${info.ResourceName}</span>`);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#tool-tip-info").append(`<div id="originator-container"><span class="small">Angelegt von: ${currentApt.OriginatorName}</span></div>`);
|
|
|
|
|
|
|
|
|
|
const textInterval = e.toolTip.ConvertIntervalToString(currentApt.interval);
|
|
|
|
|
|
2026-07-09 11:39:24 +02:00
|
|
|
$('#tool-tip-title').html(`${textInterval}: ${currentApt.GetSubject()}`);
|
2026-06-29 13:45:15 +02:00
|
|
|
|
|
|
|
|
if(currentApt.CanBeDeleted === false) {
|
|
|
|
|
$("#aptToolTipDelete").hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(currentApt.CanBeEdited === false) {
|
|
|
|
|
if(currentApt.CanBeViewed) {
|
|
|
|
|
$("#aptToolTipEdit").text("Ansehen");
|
2026-07-16 16:01:13 +02:00
|
|
|
$("#aptToolTipEditSeries").text("Serie Ansehen");
|
2026-06-29 13:45:15 +02:00
|
|
|
} else {
|
2026-07-16 16:01:13 +02:00
|
|
|
$("#aptToolTipEdit, #aptToolTipEditSeries").hide();
|
2026-06-29 13:45:15 +02:00
|
|
|
}
|
|
|
|
|
}
|
2026-07-16 16:01:13 +02:00
|
|
|
|
|
|
|
|
if(currentApt.HasOccurrencies === false) {
|
|
|
|
|
$("#reset-series-list-item").hide();
|
|
|
|
|
} else {
|
|
|
|
|
$("#reset-series-list-item").show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(currentApt.RecurrenceId === null || currentApt.RecurrenceId === undefined) {
|
|
|
|
|
$("#aptToolTipEditSeries").hide();
|
|
|
|
|
} else {
|
|
|
|
|
$("#aptToolTipEditSeries").show();
|
|
|
|
|
}
|
2026-06-29 13:45:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setAptToolTipSubject(text) {
|
|
|
|
|
$('#aptToolTipSubject').html(ASPx.Str.EncodeHtml(text));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onAppointmentRefresh(apt) {
|
|
|
|
|
apt.updated = true;
|
|
|
|
|
setAptToolTipSubject(apt.GetSubject());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getCurrentApt() {
|
|
|
|
|
return toolTipContext.data.GetAppointment();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onAptToolTipDeleteClick() {
|
2026-07-16 16:01:13 +02:00
|
|
|
const appointment = getCurrentApt();
|
|
|
|
|
|
|
|
|
|
if(appointment.appointmentType === "Occurrence") {
|
|
|
|
|
$("#apt-del-ok-btn").on("click",
|
|
|
|
|
function() {
|
|
|
|
|
const radioOptionId = $("input[name='apt-del-radio-group']:checked").attr("id");
|
|
|
|
|
|
|
|
|
|
if(radioOptionId === "apt-del-radio-1") {
|
|
|
|
|
const patternId = appointment.appointmentId.split("_")[0];
|
|
|
|
|
|
|
|
|
|
scheduler.PerformCallback({apptID: patternId, actionId: "DeleteSeries", args: null}, () => { hideSpinner(); });
|
|
|
|
|
} else if(radioOptionId === "apt-del-radio-2") {
|
|
|
|
|
scheduler.DeleteAppointment(appointment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#apt-del-ok-btn").off("click");
|
|
|
|
|
$("#recurrence-delete-popup").modal("hide");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#recurrence-delete-popup").modal("show");
|
|
|
|
|
} else {
|
|
|
|
|
showWarningMessageBox("Löschen bestätigen", "Sind Sie sicher, dass Sie den Termin löschen möchten?", () => {
|
|
|
|
|
scheduler.DeleteAppointment(appointment);
|
|
|
|
|
}, false);
|
|
|
|
|
}
|
2026-06-29 13:45:15 +02:00
|
|
|
}
|
|
|
|
|
|
2026-07-16 16:01:13 +02:00
|
|
|
function onAptToolTipEditClick() {
|
2026-06-29 13:45:15 +02:00
|
|
|
scheduler.ShowAppointmentFormByClientId(getCurrentApt().GetId());
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-16 16:01:13 +02:00
|
|
|
function onAptToolTipEditSeriesClick() {
|
|
|
|
|
scheduler.ShowAppointmentFormByClientId(getCurrentApt().GetId().split("_")[0]);
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-29 13:45:15 +02:00
|
|
|
function onAptToolTipShowMenuClick() {
|
|
|
|
|
toolTipContext.toolTip.ShowAppointmentMenu();
|
2026-07-16 16:01:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onAptToolTipTransferClick() {
|
|
|
|
|
scheduler.PerformCallback({apptID: getCurrentApt().appointmentId, actionId: "ToServiceRecord" });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onAptToolTipResetClick() {
|
|
|
|
|
const appointment = getCurrentApt();
|
|
|
|
|
const recurrenceId = appointment.RecurrenceId;
|
|
|
|
|
|
|
|
|
|
if(recurrenceId !== undefined && recurrenceId !== null && recurrenceId.length > 0) {
|
|
|
|
|
showWarningMessageBox("Zurücksetzen der Serie bestätigen", "Sind Sie sicher, dass Sie die ausgewählte Terminserie zurücksetzen möchten?", () => {
|
|
|
|
|
scheduler.PerformCallback({ apptID: recurrenceId, actionId: "ResetSeries", args: null }, () => { hideSpinner(); });
|
|
|
|
|
}, false);
|
|
|
|
|
}
|
2026-06-29 13:45:15 +02:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="card p-1" style="min-width: 200px;">
|
|
|
|
|
<div class="card-body p-1">
|
|
|
|
|
<p class="card-title font-weight-bold p-0" id="tool-tip-title"></p>
|
|
|
|
|
<div id="tool-tip-info">
|
|
|
|
|
<div id="employees-container"></div>
|
|
|
|
|
<div id="customers-container"></div>
|
|
|
|
|
<div id="resources-container"></div>
|
|
|
|
|
<div id="originator-container"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-07-09 11:39:24 +02:00
|
|
|
<div class="card-footer m-0 p-1">
|
2026-07-16 16:01:13 +02:00
|
|
|
<ul class="list-group">
|
|
|
|
|
<li class="list-group-item p-1">
|
|
|
|
|
<button type="button" id="aptToolTipEdit" class="btn btn-sm btn-primary w-100" onclick="onAptToolTipEditClick()">
|
|
|
|
|
Bearbeiten
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="list-group-item p-1">
|
|
|
|
|
<button type="button" id="aptToolTipEditSeries" class="btn btn-sm btn-primary w-100" onclick="onAptToolTipEditSeriesClick()">
|
|
|
|
|
Serie Bearbeiten
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="list-group-item p-1">
|
|
|
|
|
<button type="button" id="aptToolTipDelete" class="btn btn-sm btn-danger w-100" onclick="onAptToolTipDeleteClick()">
|
|
|
|
|
Löschen
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="list-group-item p-1">
|
|
|
|
|
<button type="button" id="aptToolTipTransfer" class="btn btn-sm btn-primary w-100" onclick="onAptToolTipTransferClick()">
|
|
|
|
|
In die Zeiterfassung übertragen
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="list-group-item p-1" id="reset-series-list-item">
|
|
|
|
|
<button type="button" id="aptToolTipReset" class="btn btn-sm btn-primary w-100" onclick="onAptToolTipResetClick()">
|
|
|
|
|
Serie zurücksetzen
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
2026-07-09 11:39:24 +02:00
|
|
|
</div>
|
2026-06-29 13:45:15 +02:00
|
|
|
</div>
|