Bugzilla – Attachment 7708 Details for
Bug 7544
Add ability search borrowers only on email / phone
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7544 - Add ability search borrowers only on email / phone
Bug-7544---Add-ability-search-borrowers-only-on-em.patch (text/plain), 3.43 KB, created by
Kyle M Hall
on 2012-02-17 13:36:00 UTC
(
hide
)
Description:
Bug 7544 - Add ability search borrowers only on email / phone
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-02-17 13:36:00 UTC
Size:
3.43 KB
patch
obsolete
>From 7bfc8fb3c18f5e76605a77e3da7f7456c790c28d Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 15 Feb 2012 10:44:20 -0500 >Subject: [PATCH] Bug 7544 - Add ability search borrowers only on email / phone > >This commit adds a new pulldown field to the patron quick search. >This pulldown "Search Fields" can have any number of field combinations >to search on. The combinations added in this commit are: > >Standard: Default, searches on original fields >Email: Searches on email, emailpro, and B_email >Borrower Number: Searches on borrowernumber >Phone Number: Searches on phone, phonepro, B_phone, altcontactphone, and mobile > >Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> > >Tested by running searches on all the new fields, and the old fields >with limits on branch and category. The seach on phone number could be >a bit more inclusive, but it works with and without symbols so I >give my sign off on this patch. >--- > .../prog/en/includes/patron-search.inc | 11 ++++++++++- > members/member.pl | 5 ++++- > 2 files changed, 14 insertions(+), 2 deletions(-) > >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 5376e87..17a212f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -53,7 +53,16 @@ YAHOO.util.Event.onContentReady("header_search", function() { > <span class="filteraction" id="filteraction_off"> <a href="#" onclick="$('#filters').toggle();$('.filteraction').toggle();">[-]</a></span> > <span class="filteraction" id="filteraction_on"> <a href="#" onclick="$('#filters').toggle();$('.filteraction').toggle();">[+]</a></span> > [% END %] >- order by: >+ >+ <label for="searchfields">Search fields:</label> >+ <select name="searchfields" id="searchfields"> >+ <option selected="selected" value=''>Standard</option> >+ <option value='email,emailpro,B_email,'>Email</option> >+ <option value='borrowernumber'>Borrower number</option> >+ <option value='phone,phonepro,B_phone,altcontactphone,mobile'>Phone number</option> >+ </select> >+ >+ <label for="orderby">Order by:</label> > <select name="orderby" id="searchorderby"> > <option value="surname,0">Surname</option> > <option value="cardnumber,0">Cardnumber</option> >diff --git a/members/member.pl b/members/member.pl >index d759c31..9b793f4 100755 >--- a/members/member.pl >+++ b/members/member.pl >@@ -94,6 +94,9 @@ else { > @orderby = ({surname=>0},{firstname=>0}); > } > >+my $searchfields = $input->param('searchfields'); >+my @searchfields = $searchfields ? split( ',', $searchfields ) : ( "firstname", "surname", "othernames", "cardnumber", "userid", "email" ); >+ > $member =~ s/,//g; #remove any commas from search string > $member =~ s/\*/%/g; > >@@ -104,7 +107,7 @@ my ($count,$results); > if ($member || keys %$patron) { > #($results)=Search($member || $patron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"] ); > my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" ); >- ($results) = Search( $member || $patron, \@orderby, undef, undef, [ "firstname", "surname", "othernames", "cardnumber", "userid", "email" ], $search_scope ); >+ ($results) = Search( $member || $patron, \@orderby, undef, undef, \@searchfields, $search_scope ); > } > > if ($results) { >-- >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 7544
:
7659
|
7662
|
7686
|
7696
|
7707
|
7708
|
7777