From cbab1a0829a17719d975c5f37fef3334335d5811 Mon Sep 17 00:00:00 2001 From: Maryse Simard Date: Tue, 20 Oct 2020 20:39:51 -0400 Subject: [PATCH] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall --- members/memberentry.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/members/memberentry.pl b/members/memberentry.pl index 2a839847e7..413c3932e6 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -672,6 +672,9 @@ my $no_categories = 1; my $no_add; foreach my $category_type (qw(C A S P I X)) { my $patron_categories = Koha::Patron::Categories->search_with_library_limits({ category_type => $category_type }, {order_by => ['categorycode']}); + my $categories_limits = { category_type => $category_type }; + $categories_limits->{canbeguarantee} = 1 if ($guarantor_id); + my $patron_categories = Koha::Patron::Categories->search_with_library_limits( $categories_limits, {order_by => ['categorycode']} ); $no_categories = 0 if $patron_categories->count > 0; my @categoryloop; -- 2.25.1