From 31d651a3cc7bec9f48a4b7ce06c7963916ec5750 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 27 Dec 2012 14:18:34 +0100 Subject: [PATCH] Bug 8845: Followup Allow to give a date using the syspref format Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- members/member.pl | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/members/member.pl b/members/member.pl index d705810cfb..39ae379a02 100755 --- a/members/member.pl +++ b/members/member.pl @@ -31,6 +31,7 @@ use CGI; use C4::Members; use C4::Branch; use C4::Category; +use Koha::DateUtils; use File::Basename; my $input = new CGI; @@ -95,25 +96,22 @@ else { @orderby = ({surname=>0},{firstname=>0}); } -my $searchfields = $input->param('searchfields'); -my @searchfields = $searchfields ? split( ',', $searchfields ) : ( "firstname", "surname", "othernames", "cardnumber", "userid", "email" ); - $member =~ s/,//g; #remove any commas from search string $member =~ s/\*/%/g; -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 $searchfields = $input->param('searchfields'); + my @searchfields = $searchfields ? split( ',', $searchfields ) : ( "firstname", "surname", "othernames", "cardnumber", "userid", "email" ); + + if ( $searchfields eq "dateofbirth" ) { + $member = output_pref(dt_from_string($member), 'iso', 1); + } + + my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" ); ($results) = Search( $member || $patron, \@orderby, undef, undef, \@searchfields, $search_scope ); } -- 2.39.5