From 6a9f45686eea487e158563932bc2f4824b3db11c Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Wed, 23 Oct 2024 16:44:47 +0000 Subject: [PATCH] Bug 38222: Use comboboxes in circ/circulation.pl, bookings/list.pl, members/moremember.pl MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To test: 1) Apply dependencies and this patch 2) Maybe update class files w/ update_dbix_class_files.pl 3) Build a new bundle w/ yarn api:bundle 4) Restart plack 5) Add a couple bookings to a patron 6) Go to any of the above modules 7) Cancel the booking and note 7.1) That the value you input is correctly received by the backend for cancellation_reason 7.2) Do it for the other 2 modules 8) Configure some authorised values under category BOOKING_CANCELLATION 9) Repeat 7 and note that you can select them in the combobox 10) Sign off or leave your feedback Sponsored-by: Büchereizentrale Schleswig-Holstein Signed-off-by: LEBSimonsen Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/modules/bookings/list.tt | 11 ++++++++++- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 10 ++++++++++ .../prog/en/modules/members/moremember.tt | 10 ++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt index 6619b20e00..2610464c65 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt @@ -84,6 +84,7 @@ [% Asset.js("js/modals/place_booking.js") | $raw %] [% Asset.js("js/cancel_booking_modal.js") | $raw %] + [% Asset.js("js/combobox.js") | $raw %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index c31e66bd86..26a89d1e83 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1026,6 +1026,7 @@ [% Asset.js("js/holds.js") | $raw %] [% INCLUDE 'calendar.inc' %] [% Asset.js("js/cancel_booking_modal.js") | $raw %] + [% Asset.js("js/combobox.js") | $raw %] [% INCLUDE 'js-biblio-format.inc' %] [% INCLUDE 'str/members-menu.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 99d09c2707..7e0c205b45 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -768,6 +768,7 @@ [% Asset.js("js/holds.js") | $raw %] [% INCLUDE 'calendar.inc' %] [% Asset.js("js/cancel_booking_modal.js") | $raw %] + [% Asset.js("js/combobox.js") | $raw %] [% INCLUDE 'js-biblio-format.inc' %] [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] @@ -826,6 +827,15 @@ $("#view_guarantees_finesandcharges").on("click", function () { $("#guarantees_finesandcharges-tab").click(); }); + + $("#cancellation-reason").comboBox({ + displayProperty: 'name', + placeholder: _("Select or type a reason"), + }); + + document.getElementById("cancelBookingModal")?.addEventListener('hide.bs.modal', () => { + $("#cancellation-reason").comboBox('reset'); + }); }); [% Asset.js("js/tables/bookings.js") | $raw %] -- 2.39.5