From 3a9d38b3a545888bb54e4d75c15218a05b79e132 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 20 Oct 2022 14:53:33 +0000 Subject: [PATCH] Bug 31422: Add patron's current category to dropdown while editing Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/members/memberentrygen.tt | 3 +++ members/memberentry.pl | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 73262a8ba1..e7ccc715c6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -974,6 +974,9 @@ legend:hover { [% END %] + [% IF limited_category %] + + [% END %] Required diff --git a/members/memberentry.pl b/members/memberentry.pl index 95f6e9dd58..ca43a1eede 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -658,7 +658,12 @@ my $patron_categories = Koha::Patron::Categories->search_with_library_limits( ); my $no_categories = ! $patron_categories->count; my $categories = {}; -foreach my $patron_category ($patron_categories->as_list ) { +my @patron_categories = $patron_categories->as_list; +unless ( $patron_categories->find( $category->id ) ){ + $template->param( limited_category => 1 ); + push @patron_categories, $category; +} +foreach my $patron_category ( @patron_categories ) { push @{ $categories->{ $patron_category->category_type } }, $patron_category; } -- 2.39.5