120 lines
3.9 KiB
Plaintext
120 lines
3.9 KiB
Plaintext
<script type="text/javascript">
|
|
function onAppointmentTipDisplaying(s, e) {
|
|
const currentApt = getCurrentApt();
|
|
|
|
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;
|
|
|
|
logInfo(`Mitarbeiter: ${participationInfos.length}\r\nKlienten: ${customerInfos.length}\r\nRessourcen: ${resourceInfos.length}`);
|
|
|
|
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) => {
|
|
logInfo2(`Farbe der Ressource <<${info.ResourceName}>>: ${info.ResourceColor}`);
|
|
$("#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);
|
|
|
|
$('#tool-tip-title').html(textInterval);
|
|
|
|
if(currentApt.CanBeDeleted === false) {
|
|
$("#aptToolTipDelete").hide();
|
|
}
|
|
|
|
if(currentApt.CanBeEdited === false) {
|
|
if(currentApt.CanBeViewed) {
|
|
$("#aptToolTipEdit").text("Ansehen");
|
|
} else {
|
|
$("#aptToolTipEdit").hide();
|
|
}
|
|
}
|
|
}
|
|
|
|
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() {
|
|
scheduler.DeleteAppointment(GetCurrentApt());
|
|
}
|
|
|
|
function onAptToolTipEditClick() {
|
|
scheduler.ShowAppointmentFormByClientId(getCurrentApt().GetId());
|
|
}
|
|
|
|
function onAptToolTipShowMenuClick() {
|
|
toolTipContext.toolTip.ShowAppointmentMenu();
|
|
}
|
|
</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>
|
|
</div> |