From 2f69be2bd0bd51deed689e8ed3a5a2616beca9d5 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 1 Jun 2023 14:30:08 +0200 Subject: [PATCH] Update the equivalent appointment removal action of the calendar table view. --- application/controllers/Calendar.php | 2 +- assets/js/utils/calendar_table_view.js | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/application/controllers/Calendar.php b/application/controllers/Calendar.php index 4e31d31d..c0f57022 100644 --- a/application/controllers/Calendar.php +++ b/application/controllers/Calendar.php @@ -312,7 +312,7 @@ class Calendar extends EA_Controller { } $appointment_id = request('appointment_id'); - $cancellation_reason = request('cancellation_reason'); + $cancellation_reason = (string)request('cancellation_reason'); if (empty($appointment_id)) { diff --git a/assets/js/utils/calendar_table_view.js b/assets/js/utils/calendar_table_view.js index 1449ca78..29b49279 100755 --- a/assets/js/utils/calendar_table_view.js +++ b/assets/js/utils/calendar_table_view.js @@ -297,19 +297,19 @@ App.Utils.CalendarTableView = (function () { const buttons = [ { text: lang('cancel'), - click: () => { - $('#message-box').dialog('close'); + click: (event, messageModal) => { + messageModal.dispose(); } }, { text: lang('delete'), - click: () => { + click: (event, messageModal) => { const appointmentId = lastFocusedEventData.extendedProps.data.id; - const deleteReason = $('#delete-reason').val(); + const cancellationReason = $('#cancellation-reason').val(); - App.Http.Calendar.deleteAppointment(appointmentId, deleteReason).done(() => { - $('#message-box').dialog('close'); + App.Http.Calendar.deleteAppointment(appointmentId, cancellationReason).done(() => { + messageModal.dispose(); // Refresh calendar event items. $reloadAppointments.trigger('click'); @@ -326,16 +326,14 @@ App.Utils.CalendarTableView = (function () { $('