From 48a3db2dad97fa712e2d0bbf5106c23dfb67b749 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 12 Nov 2024 21:59:38 +0000 Subject: [PATCH] Bug 38429: Add dropdown to Add guarantee button if multiple categories are allowed To test: 1. Have multiple patron categories that are set to 'Can be guarantee'. 2. Go to a patron record and click '+ Add guarantee' 3. Look at how the patron category is set. 4. It defaults to the first one alphabetically, by code. 5. APPLY PATCH 6. Try steps 1 -2 again, this time you should get a dropdown to pick which category of guarantee you want. 7. Add some patron categories that can be gaurantees with library limitations. Make sure they only show for the correct libraries. 8. Set only patron category to be a gaurantee. The dropdown should now be a button. Signed-off-by: Laura ONeil Signed-off-by: Baptiste Wojtkowski Signed-off-by: Katrin Fischer (cherry picked from commit 264887a87f34fd2233005454ccc54df9b06a1727) Signed-off-by: Paul Derscheid --- .../prog/en/includes/members-toolbar.inc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 7ffde08165..1c8c1847d2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -9,13 +9,24 @@ [% IF CAN_user_borrowers_edit_borrowers %] Edit [% END %] - + [% SET guarantee_categories = Categories.limited( can_be_guarantee => 1 ).unblessed %] [% IF CAN_user_borrowers_edit_borrowers %] [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %] - Add guarantee - [% END %] + [% IF guarantee_categories.size > 1 %] +
+ + +
+ [% ELSE %] + Add guarantee + [% END %] Change password Duplicate + [% END %] [% END %] [% IF CAN_user_circulate_circulate_remaining_permissions %]