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

(-)a/members/member.pl (-9 / +14 lines)
Lines 99-112 my ($count,$results); Link Here
99
99
100
my @searchpatron;
100
my @searchpatron;
101
push @searchpatron, $member if ($member);
101
push @searchpatron, $member if ($member);
102
push @searchpatron, $patron if (keys %$patron);
102
push @searchpatron, $patron if ( keys %$patron );
103
my $from= ($startfrom-1)*$resultsperpage;
103
my $from = ( $startfrom - 1 ) * $resultsperpage;
104
my $to=$from+$resultsperpage;
104
my $to   = $from + $resultsperpage;
105
 #($results)=Search(\@searchpatron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"]  ) if (@searchpatron);
105
106
 my $search_scope=($quicksearch?"field_start_with":"contain");
106
#($results)=Search(\@searchpatron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"]  ) if (@searchpatron);
107
 ($results)=Search(\@searchpatron,\@orderby,undef,undef,["firstname","surname","email","othernames","cardnumber","userid"],$search_scope  ) if (@searchpatron);
107
my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" );
108
if ($results){
108
($results) = Search( \@searchpatron, \@orderby, undef, undef, [ "firstname", "surname", "othernames", "cardnumber", "userid" ], $search_scope ) if (@searchpatron);
109
	$count =scalar(@$results);
109
110
if ($results) {
111
	for my $field ('categorycode','branchcode'){
112
		next unless ($patron->{$field});
113
		@$results = grep { $_->{$field} eq $patron->{$field} } @$results; 
114
	}
115
    $count = scalar(@$results);
110
}
116
}
111
my @resultsdata;
117
my @resultsdata;
112
$to=($count>$to?$to:$count);
118
$to=($count>$to?$to:$count);
113
- 

Return to bug 5750