View | Details | Raw Unified | Return to bug 7544
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-1 / +10 lines)
Lines 53-59 YAHOO.util.Event.onContentReady("header_search", function() { Link Here
53
	<span class="filteraction" id="filteraction_off"> <a href="#" onclick="$('#filters').toggle();$('.filteraction').toggle();">[-]</a></span>
53
	<span class="filteraction" id="filteraction_off"> <a href="#" onclick="$('#filters').toggle();$('.filteraction').toggle();">[-]</a></span>
54
	<span class="filteraction" id="filteraction_on"> <a href="#" onclick="$('#filters').toggle();$('.filteraction').toggle();">[+]</a></span>
54
	<span class="filteraction" id="filteraction_on"> <a href="#" onclick="$('#filters').toggle();$('.filteraction').toggle();">[+]</a></span>
55
	[% END %]
55
	[% END %]
56
    order by:
56
57
      <label for="searchfields">Search fields:</label>
58
      <select name="searchfields" id="searchfields">
59
          <option selected="selected" value=''>Standard</option>
60
          <option value='email,emailpro,B_email,'>Email</option>
61
          <option value='borrowernumber'>Borrower number</option>
62
          <option value='phone,phonepro,B_phone,altcontactphone,mobile'>Phone number</option>
63
      </select>
64
65
    <label for="orderby">Order by:</label>
57
    <select name="orderby" id="searchorderby">
66
    <select name="orderby" id="searchorderby">
58
    <option value="surname,0">Surname</option>
67
    <option value="surname,0">Surname</option>
59
    <option value="cardnumber,0">Cardnumber</option>
68
    <option value="cardnumber,0">Cardnumber</option>
(-)a/members/member.pl (-2 / +4 lines)
Lines 94-99 else { Link Here
94
	@orderby = ({surname=>0},{firstname=>0});
94
	@orderby = ({surname=>0},{firstname=>0});
95
}
95
}
96
96
97
my $searchfields = $input->param('searchfields');
98
my @searchfields = $searchfields ? split( ',', $searchfields ) : ( "firstname", "surname", "othernames", "cardnumber", "userid", "email" );
99
97
$member =~ s/,//g;   #remove any commas from search string
100
$member =~ s/,//g;   #remove any commas from search string
98
$member =~ s/\*/%/g;
101
$member =~ s/\*/%/g;
99
102
Lines 104-110 my ($count,$results); Link Here
104
if ($member || keys %$patron) {
107
if ($member || keys %$patron) {
105
    #($results)=Search($member || $patron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"]  );
108
    #($results)=Search($member || $patron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"]  );
106
    my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" );
109
    my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" );
107
    ($results) = Search( $member || $patron, \@orderby, undef, undef, [ "firstname", "surname", "othernames", "cardnumber", "userid", "email" ], $search_scope );
110
    ($results) = Search( $member || $patron, \@orderby, undef, undef, \@searchfields, $search_scope );
108
}
111
}
109
112
110
if ($results) {
113
if ($results) {
111
- 

Return to bug 7544