From 881c0f9dd569f524905debc8657203896958f22d Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Mon, 14 Mar 2016 11:55:31 +0100 Subject: [PATCH] Bug 13392 - Replace using of C4::Dates and C4::ItemType by Koha::DateUtils and Koha::ItemTypes --- reports/suggestions_stats.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/reports/suggestions_stats.pl b/reports/suggestions_stats.pl index 6c0cef8..10a5305 100755 --- a/reports/suggestions_stats.pl +++ b/reports/suggestions_stats.pl @@ -27,8 +27,7 @@ use C4::Output; use C4::Branch; use C4::Budgets; use C4::Category; -use C4::Dates qw/format_date format_date_in_iso/; -use C4::ItemType; +use Koha::DateUtils qw/output_pref dt_from_string/; use C4::Koha; use C4::Reports; @@ -123,7 +122,7 @@ foreach my $branch (@$branches) { $display_values->{branchcode}->{$branchcode} = $branch->{branchname}; } -my @itemtypes = C4::ItemType->all; +my @itemtypes = Koha::ItemTypes->search; foreach my $itemtype (@itemtypes) { my $itype = $itemtype->itemtype; $display_values->{itemtype}->{$itype} = $itemtype->description; @@ -184,11 +183,15 @@ sub calculate { foreach my $filter (qw(suggesteddate rejecteddate ordereddate)) { if ($filters->{"${filter}_from"}) { push @conditions, "$filter >= ?"; - push @bind_values, format_date_in_iso($filters->{"${filter}_from"}); + push @bind_values, output_pref({ + dt => dt_from_string( $filters->{"${filter}_from"} ), + dateformat => 'iso', dateonly => 1 }); } if ($filters->{"${filter}_to"}) { push @conditions, "$filter <= ?"; - push @bind_values, format_date_in_iso($filters->{"${filter}_to"}); + push @bind_values, output_pref({ + dt => dt_from_string( $filters->{"${filter}_to"} ), + dateformat => 'iso', dateonly => 1 }); } } -- 2.1.4