From ba9fe14a5c23f8968491dab69ffa22454f2205a3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sun, 4 Aug 2019 21:21:30 -0500 Subject: [PATCH] Bud 15522: Restore categories filtering Mimicking what is done for Branches Signed-off-by: Lisette Scheer Signed-off-by: Lari Taskula --- Koha/Template/Plugin/Categories.pm | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/admin/policy.tt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Koha/Template/Plugin/Categories.pm b/Koha/Template/Plugin/Categories.pm index 140f12a395..0ee967be8b 100644 --- a/Koha/Template/Plugin/Categories.pm +++ b/Koha/Template/Plugin/Categories.pm @@ -25,7 +25,11 @@ use Koha::Patron::Categories; sub all { my ( $self, $params ) = @_; + my $unfiltered = delete $params->{unfiltered} || 0; return Koha::Patron::Categories->search_limited($params); + return $unfiltered + ? Koha::Patron::Categories->search( $params ) + : Koha::Patron::Categories->search_limited( $params ) } sub GetName { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/policy.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/policy.tt index ef10b71d6c..c60b927b2a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/policy.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/policy.tt @@ -56,7 +56,7 @@ }; // TODO: Account for branch category limits Koha.PATRON_CATEGORIES = { - [% FOREACH category IN Categories.all() %] + [% FOREACH category IN Categories.all( unfiltered => 1 ) %] "[% category.categorycode %]": [% To.json( category ) %], [% END %] }; -- 2.20.1