Bugzilla – Attachment 44279 Details for
Bug 15090
Fix date filter for Suggestions management
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 15090: Fix date filter for Suggestions management
PASSED-QA-Bug-15090-Fix-date-filter-for-Suggestion.patch (text/plain), 2.15 KB, created by
Katrin Fischer
on 2015-11-01 15:31:58 UTC
(
hide
)
Description:
[PASSED QA] Bug 15090: Fix date filter for Suggestions management
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-11-01 15:31:58 UTC
Size:
2.15 KB
patch
obsolete
>From 44847ee555d3a34beadc13c211dbb71eefd60b3a Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Fri, 30 Oct 2015 15:23:30 +0100 >Subject: [PATCH] [PASSED QA] Bug 15090: Fix date filter for Suggestions > management > >Home > Acquisitions > Suggestions management: >Before 13813 the "from" date in filters was 0000-00-00 if not >filled, afer 13813 it's today. > >This patch re-introduces 0000-00-00. > >See http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13813#c172 > >To test: >- Go to Home > Acquisitions > Suggestions management >- Verify that date filters work as expected >- Verify that start dates in sql query are 0000-00-00 if no start > dates are given >- Note: Line 185 outputs the start dates as warn if $debug is set. > >Signed-off-by: Nicole Engard <nengard@bywatersolutions.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Suggestions.pm | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 02e32b9..30746b7 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -177,10 +177,15 @@ sub SearchSuggestion { > foreach my $field (qw( suggesteddate manageddate accepteddate )) { > my $from = $field . "_from"; > my $to = $field . "_to"; >+ my $from_dt; >+ $from_dt = eval { dt_from_string( $suggestion->{$from} ) } if ( $suggestion->{$from} ); >+ my $from_sql = '0000-00-00'; >+ $from_sql = output_pref({ dt => $from_dt, dateformat => 'iso', dateonly => 1 }) >+ if ($from_dt); >+ $debug && warn "SQL for start date ($field): $from_sql"; > if ( $suggestion->{$from} || $suggestion->{$to} ) { > push @query, qq{ AND suggestions.$field BETWEEN ? AND ? }; >- push @sql_params, >- output_pref({ dt => dt_from_string( $suggestion->{$from} ), dateformat => 'iso', dateonly => 1 }) || '0000-00-00'; >+ push @sql_params, $from_sql; > push @sql_params, > output_pref({ dt => dt_from_string( $suggestion->{$to} ), dateformat => 'iso', dateonly => 1 }) || output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); > } >-- >1.9.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 15090
:
44201
|
44258
| 44279