From ba9442e6c37f02caebc14d96b4d598b3693051b6 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 20 Oct 2023 19:10:25 -0400 Subject: [PATCH] Added Confirmation to Close Ticket in Client Portal - Seperated cofirmation modal to a seperate JS file which is now included in the Client Portal --- footer.php | 1 + js/app.js | 17 ----------------- js/confirm_modal.js | 16 ++++++++++++++++ portal/portal_footer.php | 6 +++++- portal/ticket.php | 2 +- 5 files changed, 23 insertions(+), 19 deletions(-) create mode 100644 js/confirm_modal.js diff --git a/footer.php b/footer.php index a1a872e8..fd0e3b9e 100644 --- a/footer.php +++ b/footer.php @@ -28,6 +28,7 @@ + diff --git a/js/app.js b/js/app.js index 1d55abf3..1fdea279 100644 --- a/js/app.js +++ b/js/app.js @@ -105,20 +105,3 @@ clipboard.on('error', function(e) { $(function () { $('[data-toggle="popover"]').popover() }); - -$(document).ready(function() { - $("a.confirm-link").click(function(e) { - e.preventDefault(); - - // Save the link reference to use after confirmation - var linkReference = this; - - // Show the confirmation modal - $("#confirmationModal").modal('show'); - - // When the submission is confirmed via the modal - $("#confirmSubmitBtn").off('click').on('click', function() { - window.location.href = $(linkReference).attr('href'); - }); - }); -}); diff --git a/js/confirm_modal.js b/js/confirm_modal.js new file mode 100644 index 00000000..3055ef04 --- /dev/null +++ b/js/confirm_modal.js @@ -0,0 +1,16 @@ +$(document).ready(function() { + $("a.confirm-link").click(function(e) { + e.preventDefault(); + + // Save the link reference to use after confirmation + var linkReference = this; + + // Show the confirmation modal + $("#confirmationModal").modal('show'); + + // When the submission is confirmed via the modal + $("#confirmSubmitBtn").off('click').on('click', function() { + window.location.href = $(linkReference).attr('href'); + }); + }); +}); \ No newline at end of file diff --git a/portal/portal_footer.php b/portal/portal_footer.php index f8f579dd..692d6cdb 100644 --- a/portal/portal_footer.php +++ b/portal/portal_footer.php @@ -13,6 +13,8 @@

+ + @@ -52,4 +54,6 @@ plugins: 'link image lists table code codesample fullscreen autoresize', }); - \ No newline at end of file + + + \ No newline at end of file diff --git a/portal/ticket.php b/portal/ticket.php index 5b505dde..bfc9fa40 100644 --- a/portal/ticket.php +++ b/portal/ticket.php @@ -53,7 +53,7 @@ if (isset($_GET['id']) && intval($_GET['id'])) { Ticket - Close ticket + Close ticket