From f9fe35ca1a64fba396bba1682132dcb13926f55b Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Tue, 9 Jul 2024 15:20:57 +0000 Subject: [PATCH] Bug 31921: Add confirmation modal when deleting a vendor This patch adds a new modal for confirming vendor deletion. It fixes the previous functionality, showing a confirmation modal for each vendor and appropriately handling the response. To test: 1) Visit Acquisitions home. Under where it says 'Manage orders', click the search bar to bring up the list of vendors. 2) Add a few vendors by clicking 'New' and 'Vendor'. After this, go back to the vendor search so that all the vendors are showing. 3) For each vendor, click on 'Delete vendor' and ensure the modal shows properly. 4) Attempt to delete one of the vendors. Go back to the vendor search and ensure they are deleted correctly. 5) Click on a vendor's name to go their supplier page. Make sure modal works properly and attempt to delete a vendor from here. --- .../prog/en/includes/acquisitions-toolbar.inc | 7 +----- .../prog/en/includes/modals/delete_vendor.inc | 23 +++++++++++++++++++ .../prog/en/modules/acqui/booksellers.tt | 6 +++-- .../prog/en/modules/acqui/supplier.tt | 2 ++ koha-tmpl/intranet-tmpl/prog/js/acq.js | 6 +++-- 5 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/modals/delete_vendor.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc index bf80bcabb4..63171b96dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc @@ -23,12 +23,7 @@ [% UNLESS ( basketcount OR subscriptioncount ) %]
-
- [% INCLUDE 'csrf-token.inc' %] - - - -
+
[% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/delete_vendor.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/delete_vendor.inc new file mode 100644 index 0000000000..be4801b88f --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/delete_vendor.inc @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt index 673d6d15ab..2fc0622e46 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -201,7 +201,7 @@ Add to basket [% END %] -