From 2121675574c7a4c7a275c3f0604f2fe2d4f1bba2 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 11 Jul 2014 11:16:38 -0400 Subject: [PATCH] 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 --- .../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 ef7a776..309f7d2 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.tmpl", 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