From db40b5154b9034063e30bdcb23e0250a5954af33 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 Signed-off-by: David Nind --- members/memberentry.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/members/memberentry.pl b/members/memberentry.pl index 63389d452f..dfd9f26277 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -669,6 +669,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