Bugzilla – Attachment 29827 Details for
Bug 5502
Patron card category search field should be menu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 5502 - Patron card category search field should be menu
PASSED-QA-Bug-5502---Patron-card-category-search-f.patch (text/plain), 6.65 KB, created by
Kyle M Hall (khall)
on 2014-07-18 12:43:36 UTC
(
hide
)
Description:
[PASSED QA] Bug 5502 - Patron card category search field should be menu
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-07-18 12:43:36 UTC
Size:
6.65 KB
patch
obsolete
>From f335f61ac5a7221e9c434a7a7a640d1a7c3f55f9 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 11 Jul 2014 11:16:38 -0400 >Subject: [PATCH] [PASSED QA] Bug 5502 - Patron card category search field should be menu > >When searching for patrons to add to a patron card creator batch there >is a text input field for submitting a patron category. This should be a >dropdown menu. This patch corrects it. > >To test, go to Tools -> Patron card creator and click "New batch." > - Click the "Add item(s)" button. > - Confirm that in the Patron search pop-up window there is a dropdown > menu populated with existing patron categories. > - Confirm that searches limited by patron category return correct > results. > - Confirm that the correct patron category is automatically preselected > after performing a search limited by category. > - Confirm that reordering the table of search results works correctly. > >Signed-off-by: Aleisha <aleishaamohia@hotmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../prog/en/modules/patroncards/members-search.tt | 31 ++++++++++++++------ > patroncards/members-search.pl | 12 +++++++ > 2 files changed, 34 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/members-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/members-search.tt >index 2452ed0..50289c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/members-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/members-search.tt >@@ -45,7 +45,7 @@ function add_item(borrowernum,batch_id,type_id){ > <div id="custom-doc" class="yui-t7"> > <div id="bd"> > <div class="yui-g"> >-<h3>Patron Search</h3> >+<h3>Patron search</h3> > > <div class="browse"> > Browse by last name: >@@ -58,14 +58,27 @@ function add_item(borrowernum,batch_id,type_id){ > <input type="hidden" name="batch_id" value="[% batch_id %]" /> > <input type="hidden" name="type" value="[% type %]" /> > <label for="member">Name: </label> >-<input id="member" name="member" /> >-<label for="category">Category code: </label> >-<input id="category" name="category" /> >+<input id="member" name="member" value="[% member %]" /> >+ >+[% UNLESS ( no_categories ) %] >+ <label for="category">Category: </label> >+ <select name="category" id="category"> >+ <option value="">Any</option> >+ [% FOREACH categorie IN categories %] >+ [% IF ( categorie.categorycode == category ) %] >+ <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 %] >+ > <input type="submit" value="Search" /></p> > </form> > > [% IF ( resultsloop ) %] >-<div id="searchheader"> <h3>Results [% from %] to [% to %] of [% numresults %] found for [% IF ( member ) %]name: '<span class="ex">[% member %][% ELSIF ( category_type ) %]category code: '<span class="ex">[% category_type %][% END %]</span>'</h3></div> >+<div id="searchheader"> <h3>Results [% from %] to [% to %] of [% numresults %] found [% IF ( member ) %]for name: '<span class="ex">[% member %]</span>'[% END %] [% IF ( category ) %]with category code: '<span class="ex">[% category %]</span>'[% END %]</h3></div> > [% IF ( paginationbar ) %]<div id="pagination_top" class="pages">[% paginationbar %]</div>[% END %] > <form name="resultform" action="/cgi-bin/koha/patroncards/members-search.pl" method="get" class="checkboxed"><div style="float: right; margin-top: .5em;"><input type="submit" class="icon addchecked" value="Add checked" onclick="add_item('checked',[% batch_id %]); return false" /> <input type="button" class="close" value="Done" /></div> > <div style="line-height: 2em; margin-left: .7em;"><a id="CheckAll" href="/cgi-bin/koha/patroncards/members-search.pl">Select All</a><a id="CheckNone" href="/cgi-bin/koha/patroncards/members-search.pl">Clear All</a></div> >@@ -74,10 +87,10 @@ function add_item(borrowernum,batch_id,type_id){ > <table style="float: left; margin: .5em 0;"> > <tr> > <th>Select</th> >- <th><a href="members-search.pl?member=[% member %]&category=[% category_type %]&batch_id=[% batch_id %]&orderby=cardnumber">Card</a></th> >- <th><a href="members-search.pl?member=[% member %]&category=[% category_type %]&batch_id=[% batch_id %]&orderby=surname">Name</a></th> >- <th><a href="members-search.pl?member=[% member %]&category=[% category_type %]&batch_id=[% batch_id %]&orderby=borrowers.categorycode">Category</a></th> >- <th><a href="members-search.pl?member=[% member %]&category=[% category_type %]&batch_id=[% batch_id %]&orderby=branchcode">Library</a></th> >+ <th><a href="members-search.pl?member=[% member %]&category=[% category %]&batch_id=[% batch_id %]&orderby=cardnumber">Card</a></th> >+ <th><a href="members-search.pl?member=[% member %]&category=[% category %]&batch_id=[% batch_id %]&orderby=surname">Name</a></th> >+ <th><a href="members-search.pl?member=[% member %]&category=[% category %]&batch_id=[% batch_id %]&orderby=borrowers.categorycode">Category</a></th> >+ <th><a href="members-search.pl?member=[% member %]&category=[% category %]&batch_id=[% batch_id %]&orderby=branchcode">Library</a></th> > <th>Expires on</th> > <th>Notes</th> > <th></th> >diff --git a/patroncards/members-search.pl b/patroncards/members-search.pl >index ebc53d9..8d46417 100755 >--- a/patroncards/members-search.pl >+++ b/patroncards/members-search.pl >@@ -38,6 +38,7 @@ my $orderby = $cgi->param('orderby') || undef; > > my @categories=C4::Category->all; > my %categories_display; >+my $no_categories; > > foreach my $category (@categories) { > my $hash={ >@@ -47,6 +48,7 @@ foreach my $category (@categories) { > $categories_display{$$category{categorycode}} = $hash; > } > >+ > my ($template, $loggedinuser, $cookie) = get_template_and_user({ > template_name => "patroncards/members-search.tt", > query => $cgi, >@@ -55,6 +57,16 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({ > flagsrequired => {borrowers => 1}, > debug => 1,}); > >+if(scalar(@categories) < 1){ $no_categories = 1; } >+if($no_categories && C4::Context->preference("AddPatronLists")=~/code/){ >+ $template->param(no_categories => 1); >+} else { >+ $template->param( >+ categories=>\@categories, >+ category => $category >+ ); >+} >+ > $orderby = "surname,firstname" unless $orderby; > $member =~ s/,//g; #remove any commas from search string > $member =~ s/\*/%/g; >-- >1.7.2.5
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 5502
:
29646
|
29688
| 29827