From f5dc1b31f55fed41d5d68306efbcf616389f298a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Sat, 14 Mar 2015 16:31:14 +0100 Subject: [PATCH] Bug 13813 - Remove C4::Dates from C4/Suggestions.pm To test: Apply patch Go to Home > Acquisitions > Suggestions management Verify in "Filter by" that filter works for Suggestion information / dates --- C4/Suggestions.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index f34c942..aae37b5 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -25,13 +25,11 @@ use CGI qw ( -utf8 ); use C4::Context; use C4::Output; -use C4::Dates qw(format_date format_date_in_iso); use C4::Debug; use C4::Letters; -use Koha::DateUtils qw( dt_from_string ); +use Koha::DateUtils; use List::MoreUtils qw(any); -use C4::Dates qw(format_date_in_iso); use base qw(Exporter); our $VERSION = 3.07.00.049; @@ -174,16 +172,15 @@ sub SearchSuggestion { } # filter on date fields - my $today = C4::Dates->today('iso'); foreach my $field (qw( suggesteddate manageddate accepteddate )) { my $from = $field . "_from"; my $to = $field . "_to"; if ( $suggestion->{$from} || $suggestion->{$to} ) { push @query, qq{ AND suggestions.$field BETWEEN ? AND ? }; push @sql_params, - format_date_in_iso( $suggestion->{$from} ) || '0000-00-00'; + output_pref({ dt => dt_from_string( $suggestion->{$from} ), dateformat => 'iso', dateonly => 1 }) || '0000-00-00'; push @sql_params, - format_date_in_iso( $suggestion->{$to} ) || $today; + output_pref({ dt => dt_from_string( $suggestion->{$to} ), dateformat => 'iso', dateonly => 1 }) || output_pref({ dt => DateTime->now(), dateformat => 'iso', dateonly => 1 }); } } -- 1.7.10.4