Bugzilla – Attachment 53000 Details for
Bug 14874
Add ability to search for patrons by date of birth from checkout and patron quick searches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14874: Tidy previous patch
Bug-14874-Tidy-previous-patch.patch (text/plain), 2.38 KB, created by
Nick Clemens
on 2016-06-30 15:19:40 UTC
(
hide
)
Description:
Bug 14874: Tidy previous patch
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2016-06-30 15:19:40 UTC
Size:
2.38 KB
patch
obsolete
>From 78f78672f098d890e792b172f7a88030f746c966 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 6 Jun 2016 14:21:01 +0100 >Subject: [PATCH] Bug 14874: Tidy previous patch > >remove debug statements >remove useless add of new var $termsearchfieldstype >rename term_is_dt with term_dt (term_is_dt is not a boolean but a dt) >--- > C4/Utils/DataTables/Members.pm | 22 +++++++++------------- > 1 file changed, 9 insertions(+), 13 deletions(-) > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index 720cbf0..b91a1e4 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -88,22 +88,20 @@ sub search { > foreach my $term (@terms) { > next unless $term; > >- my $termsearchfieldstype; >- my $term_is_dt = eval { local $SIG{__WARN__}={}; Koha::DateUtils::output_pref( { str=>$term, dateonly=>1, dateformat=>'sql' } ); }; >+ my $term_dt = eval { local $SIG{__WARN__} = {}; output_pref( { str => $term, dateonly => 1, dateformat => 'sql' } ); }; > >- if ( $term_is_dt ){ >- $termsearchfieldstype = 'dateofbirth' ; >- $term = $term_is_dt; >+ if ($term_dt) { >+ $searchfieldstype = 'dateofbirth'; >+ $term = $term_dt; > } else { >- $termsearchfieldstype = $searchfieldstype; >- $term .= '%' # end with anything >- if $term !~ /%$/; >- $term = "%$term" # begin with anythin unless start_with >- if $searchtype eq 'contain' && $term !~ /^%/; >+ $term .= '%' # end with anything >+ if $term !~ /%$/; >+ $term = "%$term" # begin with anythin unless start_with >+ if $searchtype eq 'contain' && $term !~ /^%/; > } > > my @where_strs_or; >- for my $searchfield ( split /,/, $searchfields->{$termsearchfieldstype} ) { >+ for my $searchfield ( split /,/, $searchfields->{$searchfieldstype} ) { > push @where_strs_or, "borrowers." . $dbh->quote_identifier($searchfield) . " LIKE ?"; > push @where_args, $term; > } >@@ -145,8 +143,6 @@ sub search { > ($limit ? $limit : "") > ); > my $sth = $dbh->prepare($query); >- warn Data::Dumper::Dumper( $query ); >- warn Data::Dumper::Dumper( @where_args ); > > $sth->execute(@where_args); > my $patrons = $sth->fetchall_arrayref({}); >-- >2.1.4
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 14874
:
51503
|
51504
|
51505
|
51652
|
51653
|
51654
|
51971
|
51972
|
52079
|
52998
|
52999
|
53000
|
53001
|
55589
|
55899
|
55912
|
55913
|
55919
|
55920
|
56027
|
56028
|
57009