From ae8f65b9f9dd8d2c10d555859a5c8f9ace9e7728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Thu, 12 Mar 2015 10:51:40 +0100 Subject: [PATCH] Bug 13813 - Remove C4::Dates from C4/Items.pm This patch removes depraceted C4::Dates from C4/Items.pm To test: Apply patch To test: Add modify items. Checkout added item. Verify that item handling works as before. Amended following comment #58 / MV --- C4/Items.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 22a8bc2..f077948 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -25,7 +25,7 @@ use Carp; use C4::Context; use C4::Koha; use C4::Biblio; -use C4::Dates qw/format_date format_date_in_iso/; +use Koha::DateUtils; use MARC::Record; use C4::ClassSource; use C4::Log; @@ -647,8 +647,8 @@ C<$itemnum> is the item number sub ModDateLastSeen { my ($itemnumber) = @_; - my $today = C4::Dates->new(); - ModItem({ itemlost => 0, datelastseen => $today->output("iso") }, undef, $itemnumber); + my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); + ModItem({ itemlost => 0, datelastseen => $today }, undef, $itemnumber); } =head2 DelItem @@ -2102,7 +2102,7 @@ C sub _set_defaults_for_add { my $item = shift; - $item->{dateaccessioned} ||= C4::Dates->new->output('iso'); + $item->{dateaccessioned} || output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); $item->{$_} ||= 0 for (qw( notforloan damaged itemlost withdrawn)); } @@ -2135,7 +2135,7 @@ sub _koha_new_item { notforloan = ?, damaged = ?, itemlost = ?, - withdrawn = ?, + withdrawn = ?, itemcallnumber = ?, coded_location_qualifier = ?, restricted = ?, @@ -2143,7 +2143,7 @@ sub _koha_new_item { holdingbranch = ?, paidfor = ?, location = ?, - permanent_location = ?, + permanent_location = ?, onloan = ?, issues = ?, renewals = ?, @@ -2153,14 +2153,14 @@ sub _koha_new_item { ccode = ?, itype = ?, materials = ?, - uri = ?, + uri = ?, enumchron = ?, more_subfields_xml = ?, copynumber = ?, stocknumber = ? "; my $sth = $dbh->prepare($query); - my $today = C4::Dates->today('iso'); + my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); $sth->execute( $item->{'biblionumber'}, $item->{'biblioitemnumber'}, -- 1.7.10.4