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

(-)a/members/member.pl (-9 / +13 lines)
Lines 31-36 use CGI; Link Here
31
use C4::Members;
31
use C4::Members;
32
use C4::Branch;
32
use C4::Branch;
33
use C4::Category;
33
use C4::Category;
34
use Koha::DateUtils;
34
use File::Basename;
35
use File::Basename;
35
36
36
my $input = new CGI;
37
my $input = new CGI;
Lines 95-114 else { Link Here
95
	@orderby = ({surname=>0},{firstname=>0});
96
	@orderby = ({surname=>0},{firstname=>0});
96
}
97
}
97
98
98
my $searchfields = $input->param('searchfields');
99
my @searchfields = $searchfields ? split( ',', $searchfields ) : ( "firstname", "surname", "othernames", "cardnumber", "userid", "email" );
100
101
$member =~ s/,//g;   #remove any commas from search string
102
$member =~ s/\*/%/g;
103
104
my $from = ( $startfrom - 1 ) * $resultsperpage;
99
my $from = ( $startfrom - 1 ) * $resultsperpage;
105
my $to   = $from + $resultsperpage;
100
my $to   = $from + $resultsperpage;
106
101
107
my ($count,$results);
102
my ($count,$results);
108
if ($member || keys %$patron) {
103
if ($member || keys %$patron) {
109
    #($results)=Search($member || $patron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"]  );
104
    my $searchfields = $input->param('searchfields');
105
    my @searchfields = $searchfields ? split( ',', $searchfields ) : ( "firstname", "surname", "othernames", "cardnumber", "userid", "email" );
106
107
    $member =~ s/,//g;   #remove any commas from search string
108
    $member =~ s/\*/%/g;
109
    my $search = $member || $patron;
110
111
    if ( $searchfields eq "dateofbirth" ) {
112
        $search = output_pref(dt_from_string($search), 'iso', 1);
113
    }
114
110
    my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" );
115
    my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" );
111
    ($results) = Search( $member || $patron, \@orderby, undef, undef, \@searchfields, $search_scope );
116
    ($results) = Search( $search, \@orderby, undef, undef, \@searchfields, $search_scope );
112
}
117
}
113
118
114
if ($results) {
119
if ($results) {
115
- 

Return to bug 8845