From afdb4c06da7e8e43c648d01a6a65f20197b545c1 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 19 Feb 2025 17:10:41 -0500 Subject: [PATCH] Converted edit Calendar to the new ajax modal function --- ajax/ajax_calendar_edit.php | 55 ++++++++ ajax/ajax_calendar_event_edit.php | 194 +++++++++++++++++++++++++++ calendar.php | 22 ++- modals/calendar_edit_modal.php | 42 ------ modals/calendar_event_edit_modal.php | 174 ------------------------ 5 files changed, 266 insertions(+), 221 deletions(-) create mode 100644 ajax/ajax_calendar_edit.php create mode 100644 ajax/ajax_calendar_event_edit.php delete mode 100644 modals/calendar_edit_modal.php delete mode 100644 modals/calendar_event_edit_modal.php diff --git a/ajax/ajax_calendar_edit.php b/ajax/ajax_calendar_edit.php new file mode 100644 index 00000000..7773b33d --- /dev/null +++ b/ajax/ajax_calendar_edit.php @@ -0,0 +1,55 @@ + + + +
+ + + +
+ + + + +
+ + + + +
+ +
- +
@@ -97,8 +102,6 @@ while ($row = mysqli_fetch_array($sql)) { $calendar_name = nullable_htmlentities($row['calendar_name']); $calendar_color = nullable_htmlentities($row['calendar_color']); $client_id = intval($row['event_client_id']); - - require "modals/calendar_event_edit_modal.php"; } ?> @@ -140,7 +143,16 @@ while ($row = mysqli_fetch_array($sql)) { selectMirror: true, eventClick: function(editEvent) { - $('#editEventModal' + editEvent.event.id).modal(); + var $link = $('', { + href: '#', + 'data-toggle': 'ajax-modal', + 'data-ajax-url': 'ajax/ajax_calendar_event_edit.php?', + 'data-ajax-id': editEvent.event.id + }); + + $('body').append($link); // Append to the body + $link.trigger('click'); // Trigger the modal + $link.remove(); // Cleanup }, dayMaxEvents: true, // allow "more" link when too many events views: { diff --git a/modals/calendar_edit_modal.php b/modals/calendar_edit_modal.php deleted file mode 100644 index 4747bd24..00000000 --- a/modals/calendar_edit_modal.php +++ /dev/null @@ -1,42 +0,0 @@ - diff --git a/modals/calendar_event_edit_modal.php b/modals/calendar_event_edit_modal.php deleted file mode 100644 index 9debcc42..00000000 --- a/modals/calendar_event_edit_modal.php +++ /dev/null @@ -1,174 +0,0 @@ -