2025-01-17 16:21:58 +01:00
|
|
|
|
function submitInsertAppointmentForm() {
|
2020-04-02 13:19:14 +02:00
|
|
|
|
showSpinner();
|
2025-01-17 16:21:58 +01:00
|
|
|
|
window.validateAppointmentForm();
|
2020-04-02 13:19:14 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function submitSchedulerDateForm() {
|
|
|
|
|
|
showSpinner();
|
|
|
|
|
|
$("#scheduler-date-form").submit();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-12 14:20:58 +02:00
|
|
|
|
function hideAppointmentForm() {
|
2020-07-16 18:50:34 +02:00
|
|
|
|
$("#form-container").addClass("d-none d-sm-none");
|
2020-05-12 14:20:58 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function showAppointmentForm() {
|
2020-07-16 18:50:34 +02:00
|
|
|
|
$("#form-container").removeClass("d-none d-sm-none");
|
2025-01-17 16:21:58 +01:00
|
|
|
|
window.calcPrependTextSizes();
|
2020-05-12 14:20:58 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function toggleAppointmentForm() {
|
2025-01-17 16:21:58 +01:00
|
|
|
|
const isVisible = $("#form-container").css("display") === "block";
|
2020-05-12 14:20:58 +02:00
|
|
|
|
|
2025-01-17 16:21:58 +01:00
|
|
|
|
if(isVisible) {
|
2020-05-12 14:20:58 +02:00
|
|
|
|
hideAppointmentForm();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
showAppointmentForm();
|
|
|
|
|
|
}
|
2020-06-29 19:24:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-10 11:06:03 +01:00
|
|
|
|
function listSearchOnChange(searchInputId, entryClass, textClass) {
|
|
|
|
|
|
try {
|
2025-01-17 16:21:58 +01:00
|
|
|
|
var text = $(`#${searchInputId}`).val().toLowerCase();
|
2020-06-29 19:24:24 +02:00
|
|
|
|
|
2025-01-17 16:21:58 +01:00
|
|
|
|
const entries = $(`.${entryClass}`);
|
2020-06-29 19:24:24 +02:00
|
|
|
|
|
2025-01-17 16:21:58 +01:00
|
|
|
|
if(text.length === 0) {
|
2022-02-10 11:06:03 +01:00
|
|
|
|
entries.show();
|
|
|
|
|
|
}
|
2020-06-29 19:24:24 +02:00
|
|
|
|
|
2025-01-17 16:21:58 +01:00
|
|
|
|
$.each(entries, function(index, item) {
|
|
|
|
|
|
const customer = $(item);
|
2020-06-29 19:24:24 +02:00
|
|
|
|
|
2025-01-17 16:21:58 +01:00
|
|
|
|
if(customer.find(`.${textClass}`).text().toLowerCase().includes(text)) {
|
2022-02-10 11:06:03 +01:00
|
|
|
|
customer.show();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
customer.hide();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2025-01-17 16:21:58 +01:00
|
|
|
|
} catch(error) {
|
|
|
|
|
|
window.showErrorPopup(error);
|
2020-06-29 19:24:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-10 11:06:03 +01:00
|
|
|
|
function resetSearch(searchInputId, entryClass) {
|
|
|
|
|
|
try {
|
2025-01-17 16:21:58 +01:00
|
|
|
|
$(`#${searchInputId}`).val("");
|
|
|
|
|
|
$(`.${entryClass}`).show();
|
2022-02-10 11:06:03 +01:00
|
|
|
|
} catch (error) {
|
2025-01-17 16:21:58 +01:00
|
|
|
|
window.showErrorPopup(error);
|
2020-06-29 19:24:24 +02:00
|
|
|
|
}
|
2020-04-02 13:19:14 +02:00
|
|
|
|
}
|