From 956573f5d7d804c3e612f95d74822884fd204b00 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 24 Sep 2014 08:47:51 -0400 Subject: [PATCH] Bug 12982 - Patron category dropdown empty in header search form on patron entry page Content-Type: text/plain; charset="utf-8" The include file which contains the patron search form assumes that the page in which it is included will have access to a set of patron categories passed from the script. This is often not the case. This patch adds a new template plugin for getting patron categories and adds usage of it to patron-search.inc. The follow templates include patron-search.inc: members\boraccount.tt members\deletemem.tt members\files.tt members\mancredit.tt members\maninvoice.tt members\member-flags.tt members\member-password.tt members\member.tt members\memberentrygen.tt members\members-update.tt members\moremember.tt members\notices.tt members\pay.tt members\paycollect.tt members\purchase-suggestions.tt members\readingrec.tt members\routing-lists.tt members\statistics.tt tools\import_borrowers.tt tools\picture-upload.tt To test, view those pages and confirm that the patron category dropdown is present in the patron header search at the top of the page (shown by clicking the [+] link). --- Koha/Template/Plugin/Borrowers.pm | 7 +++ .../prog/en/includes/patron-search.inc | 51 +++++++++++++------- 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/Koha/Template/Plugin/Borrowers.pm b/Koha/Template/Plugin/Borrowers.pm index b8f3de5..b476a17 100644 --- a/Koha/Template/Plugin/Borrowers.pm +++ b/Koha/Template/Plugin/Borrowers.pm @@ -24,6 +24,8 @@ use base qw( Template::Plugin ); use Koha::Borrower::Debarments qw//; +use C4::Category; + =pod This plugin is a home for various patron related Template Toolkit functions @@ -48,4 +50,9 @@ sub IsDebarred { return Koha::Borrower::Debarments::IsDebarred($borrower->{borrowernumber}); } +sub getBorrowerCategories { + my ( $self ) = @_; + return C4::Category->all; +} + 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index 47cd2ad..b3a581d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -1,4 +1,6 @@ [% USE Koha %] +[% USE Borrowers %] +[% SET patron_categories = Borrowers.getBorrowerCategories() %]

[% LibraryName %]

-- 1.7.9.5