From f335f61ac5a7221e9c434a7a7a640d1a7c3f55f9 Mon Sep 17 00:00:00 2001 From: Owen Leonard 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 Signed-off-by: Kyle M Hall --- .../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){
-

Patron Search

+

Patron search

Browse by last name: @@ -58,14 +58,27 @@ function add_item(borrowernum,batch_id,type_id){ - - - + + +[% UNLESS ( no_categories ) %] + + +[% END %] +

[% IF ( resultsloop ) %] -

Results [% from %] to [% to %] of [% numresults %] found for [% IF ( member ) %]name: '[% member %][% ELSIF ( category_type ) %]category code: '[% category_type %][% END %]'

+

Results [% from %] to [% to %] of [% numresults %] found [% IF ( member ) %]for name: '[% member %]'[% END %] [% IF ( category ) %]with category code: '[% category %]'[% END %]

[% IF ( paginationbar ) %]
[% paginationbar %]
[% END %]
@@ -74,10 +87,10 @@ function add_item(borrowernum,batch_id,type_id){ - - - - + + + + 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
SelectCardNameCategoryLibraryCardNameCategoryLibrary Expires on Notes