Bugzilla – Attachment 3140 Details for
Bug 5750
Add exact matching filter for categorycode and branchcode fields in search members's result
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed Patch
0001-Bug-5750-MT-4095-add-exact-matching-filter-for-categ.patch (text/plain), 1.95 KB, created by
Chris Cormack
on 2011-02-13 22:36:57 UTC
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-02-13 22:36:57 UTC
Size:
1.95 KB
patch
obsolete
>From 80526cc73849f643c2a2624c43ad39debde9b1c9 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?St=C3=A9phane=20Delaune?= <stephane.delaune@biblibre.com> >Date: Wed, 25 Aug 2010 16:19:02 +0200 >Subject: [PATCH] Bug 5750: (MT #4095) add exact matching filter for categorycode and branchcode fields in search members's result > >--- > members/member.pl | 22 ++++++++++++++-------- > 1 files changed, 14 insertions(+), 8 deletions(-) > >diff --git a/members/member.pl b/members/member.pl >index df688d1..a2a79fa 100755 >--- a/members/member.pl >+++ b/members/member.pl >@@ -99,14 +99,20 @@ my ($count,$results); > > my @searchpatron; > push @searchpatron, $member if ($member); >-push @searchpatron, $patron if (keys %$patron); >-my $from= ($startfrom-1)*$resultsperpage; >-my $to=$from+$resultsperpage; >- #($results)=Search(\@searchpatron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"] ) if (@searchpatron); >- my $search_scope=($quicksearch?"field_start_with":"contain"); >- ($results)=Search(\@searchpatron,\@orderby,undef,undef,["firstname","surname","email","othernames","cardnumber","userid"],$search_scope ) if (@searchpatron); >-if ($results){ >- $count =scalar(@$results); >+push @searchpatron, $patron if ( keys %$patron ); >+my $from = ( $startfrom - 1 ) * $resultsperpage; >+my $to = $from + $resultsperpage; >+ >+#($results)=Search(\@searchpatron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"] ) if (@searchpatron); >+my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" ); >+($results) = Search( \@searchpatron, \@orderby, undef, undef, [ "firstname", "surname", "othernames", "cardnumber", "userid" ], $search_scope ) if (@searchpatron); >+ >+if ($results) { >+ for my $field ('categorycode','branchcode'){ >+ next unless ($patron->{$field}); >+ @$results = grep { $_->{$field} eq $patron->{$field} } @$results; >+ } >+ $count = scalar(@$results); > } > my @resultsdata; > $to=($count>$to?$to:$count); >-- >1.7.1 >
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 5750
: 3140