Bugzilla – Attachment 142706 Details for
Bug 31421
Library limitation on patron category breaks patron search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31421: Add a limited option to template plugin
Bug-31421-Add-a-limited-option-to-template-plugin.patch (text/plain), 2.24 KB, created by
Jonathan Druart
on 2022-10-27 10:41:32 UTC
(
hide
)
Description:
Bug 31421: Add a limited option to template plugin
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-10-27 10:41:32 UTC
Size:
2.24 KB
patch
obsolete
>From 566357d5f14457b486886d5f4cc13f8c3688cf0e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 20 Oct 2022 14:13:37 +0000 >Subject: [PATCH] Bug 31421: Add a limited option to template plugin > >This adds a specific 'limited' routine to the Categories plugin, and uses >it for the new patron dropdowns > >To test: >1 - Limit a patron category to some branches >2 - Sign in not at one of those >3 - Confirm the new patron dropdowns don't include the category > >Bug 31421: (follow-up) Add POD > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/Template/Plugin/Categories.pm | 12 +++++++++++- > .../prog/en/includes/patron-toolbar.inc | 2 +- > 2 files changed, 12 insertions(+), 2 deletions(-) > >diff --git a/Koha/Template/Plugin/Categories.pm b/Koha/Template/Plugin/Categories.pm >index 198690406c2..4da8748ac41 100644 >--- a/Koha/Template/Plugin/Categories.pm >+++ b/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 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc >index 4626a406c92..e26c5e676df 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc >+++ b/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 ) %] > <div id="toolbar" class="btn-toolbar"> >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31421
:
141468
|
141479
|
142247
|
142332
|
142705
| 142706 |
142707