From 07bad6b3faea8cce9618ca2fa07937925740b30c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Sun, 20 Sep 2015 21:39:44 +0200 Subject: [PATCH] Bug 14873: Remove C4::Dates from reserve/request.pl This bug removes deprecated C4::Dates from reserve/request.pl To test: - Apply patch - In staff client, search a biblio and try to put a hold for a borrower (Home > Catalog > [Some Biblio] > Place a hold to [Some biblio]) Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- reserve/request.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reserve/request.pl b/reserve/request.pl index 0d82f1c615..d32f7a072f 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -39,7 +39,7 @@ use C4::Biblio; use C4::Items; use C4::Koha; use C4::Circulation; -use C4::Dates qw/format_date/; +use Koha::DateUtils; use C4::Utils::DataTables::Members; use C4::Members; use C4::Search; # enabled_staff_search_views @@ -82,7 +82,7 @@ my $maxreserves; my $warnings; my $messages; -my $date = C4::Dates->today('iso'); +my $date = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); my $action = $input->param('action'); $action ||= q{}; @@ -358,7 +358,7 @@ foreach my $biblionumber (@biblionumbers) { my $ItemBorrowerReserveInfo = GetMember( borrowernumber => $reservedfor ); $item->{backgroundcolor} = 'reserved'; - $item->{reservedate} = format_date($reservedate); + $item->{reservedate} = output_pref({ dt => dt_from_string( $reservedate ), dateonly => 1 }); $item->{ReservedForBorrowernumber} = $reservedfor; $item->{ReservedForSurname} = $ItemBorrowerReserveInfo->{'surname'}; $item->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'}; @@ -393,7 +393,7 @@ foreach my $biblionumber (@biblionumbers) { GetTransfers($itemnumber); if ( defined $transfertwhen && $transfertwhen ne '' ) { - $item->{transfertwhen} = format_date($transfertwhen); + $item->{transfertwhen} = output_pref({ dt => dt_from_string( $transfertwhen ), dateonly => 1 }); $item->{transfertfrom} = $branches->{$transfertfrom}{branchname}; $item->{transfertto} = $branches->{$transfertto}{branchname}; @@ -516,9 +516,9 @@ foreach my $biblionumber (@biblionumbers) { $reserve{'hidename'} = 1; $reserve{'cardnumber'} = $reserveborrowerinfo->{'cardnumber'}; } - $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} ) + $reserve{'expirationdate'} = output_pref({ dt => dt_from_string( $res->{'expirationdate'} ), dateonly => 1 }) unless ( !defined($res->{'expirationdate'}) || $res->{'expirationdate'} eq '0000-00-00' ); - $reserve{'date'} = format_date( $res->{'reservedate'} ); + $reserve{'date'} = output_pref({ dt => dt_from_string( $res->{'reservedate'} ), dateonly => 1 }); $reserve{'borrowernumber'} = $res->{'borrowernumber'}; $reserve{'biblionumber'} = $res->{'biblionumber'}; $reserve{'borrowernumber'} = $res->{'borrowernumber'}; -- 2.39.5