[Koha-bugs] [Bug 9407] patrons search should match substrings

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jan 17 15:34:00 CET 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9407

Jonathan Druart <jonathan.druart at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Patch doesn't apply         |Needs Signoff

--- Comment #5 from Jonathan Druart <jonathan.druart at biblibre.com> ---
MJ,

Thanks!

I will signoff your patch but I have 1 question:
Don't you think the following change gives the code easier to read?

-my $searchtype = $input->param('searchtype');
-my %searchtype_ok = ( 'contain' => 1 );
-if ( !defined($searchtype_ok{$searchtype}) ) {
-    undef $searchtype;
-}
-
 my $from = ( $startfrom - 1 ) * $resultsperpage;
 my $to   = $from + $resultsperpage;

 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 = $searchtype || ( $quicksearch ? "field_start_with" :
"start_with" );
+    my $search_scope = ( $input->param('searchtype') eq 'contain' )
+        ? 'contain'
+        : ( $quicksearch ? "field_start_with" : "start_with" );

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list