Bugzilla – Attachment 32006 Details for
Bug 12982
Patron category dropdown empty in header search form on patron entry page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12982 - Patron category dropdown empty in header search form on patron entry page
SIGNED-OFF-Bug-12982---Patron-category-dropdown-em.patch (text/plain), 5.45 KB, created by
Nicole C. Engard
on 2014-10-06 12:34:48 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12982 - Patron category dropdown empty in header search form on patron entry page
Filename:
MIME Type:
Creator:
Nicole C. Engard
Created:
2014-10-06 12:34:48 UTC
Size:
5.45 KB
patch
obsolete
>From 323628d5dd607d29bb86f0d84f450177de4073fe Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 24 Sep 2014 08:47:51 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 12982 - Patron category dropdown empty in header search form on patron entry page > >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). > >Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> >--- > 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() %] > <div class="gradient"> > <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Patrons Resident Search Box --> > <div id="header_search"> >@@ -85,24 +87,37 @@ > </select> > > <input value="Search" class="submit" type="submit" /> >- [% IF ( branchloop ) %] >- <p id="filters"> <label for="branchcode">Library: </label> >- <select name="branchcode" id="branchcode"> >- [% IF branchloop.size != 1 %] >- <option value="">Any</option> >- [% END %] >- [% FOREACH branchloo IN branchloop %] >- [% IF ( branchloo.selected ) %] >- <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %] >- <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %] >- [% END %]</select> >- <label for="categorycode">Category: </label><select name="categorycode" id="categorycode"> >- <option value="">Any</option>[% FOREACH categorie IN categories %] >- [% IF ( categorie.selected ) %] >- <option value="[% categorie.categorycode %]" selected="selected">[% categorie.description |html_entity %]</option>[% ELSE %] >- <option value="[% categorie.categorycode %]">[% categorie.description |html_entity %]</option>[% END %] >- [% END %]</select> >- </p> >+ [% IF ( branchloop || patron_categories ) %] >+ <p id="filters"> >+ [% IF ( branchloop ) %] >+ <label for="branchcode">Library: </label> >+ <select name="branchcode" id="branchcode"> >+ [% IF branchloop.size != 1 %] >+ <option value="">Any</option> >+ [% END %] >+ [% FOREACH branchloo IN branchloop %] >+ [% IF ( branchloo.selected ) %] >+ <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option> >+ [% ELSE %] >+ <option value="[% branchloo.value %]">[% branchloo.branchname %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ [% END %] >+ [% IF ( patron_categories ) %] >+ <label for="patron_search_categorycode">Category: </label> >+ <select name="categorycode" id="patron_search_categorycode"> >+ <option value="">Any</option> >+ [% FOREACH categorie IN patron_categories %] >+ [% IF ( categorie.selected ) %] >+ <option value="[% categorie.categorycode %]" selected="selected">[% categorie.description |html_entity %]</option> >+ [% ELSE %] >+ <option value="[% categorie.categorycode %]">[% categorie.description |html_entity %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ [% END %] >+ </p> > [% END %] > </form> > </div> >-- >1.7.2.3
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 12982
:
31850
| 32006