@@ -, +, @@ --- Koha/Template/Plugin/Categories.pm | 12 +++++++++++- .../prog/en/includes/patron-toolbar.inc | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) --- a/Koha/Template/Plugin/Categories.pm +++ a/Koha/Template/Plugin/Categories.pm @@ -28,6 +28,11 @@ sub all { return Koha::Patron::Categories->search($params); } +sub limited { + my ( $self, $params ) = @_; + return Koha::Patron::Categories->search_with_library_limits($params); +} + sub GetName { my ( $self, $categorycode ) = @_; @@ -56,9 +61,14 @@ Koha::Template::Plugin::Categories - TT Plugin for categories =head2 all -In a template, you can get the all categories with +In a template, you can get all the categories with the following TT code: [% Categories.all() %] +=head2 limited + +In a template, you can get the categories with library limits applied with +the following TT code: [% Categories.limited() %] + =head2 GetName In a template, you can get the name of a patron category using --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc @@ -1,7 +1,7 @@ [% INCLUDE 'blocking_errors.inc' %] [% USE Categories %] [% USE Koha %] -[% SET categories = Categories.all %] +[% SET categories = Categories.limited %] [% UNLESS ( no_add ) %]
--