From 6de8639023f33de06bddfe95ef48ee26010d4f91 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 24 Sep 2015 11:28:42 +0100 Subject: [PATCH] Bug 14879: Move the date displays to the template There is no special need to format the date in the perl script. Signed-off-by: Jonathan Druart --- catalogue/detail.pl | 7 ++----- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index b826f49..30ce2c2 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -205,9 +205,6 @@ foreach my $item (@items) { $item->{imageurl} = defined $item->{itype} ? getitemtypeimagelocation('intranet', $itemtypes->{ $item->{itype} }{imageurl}) : ''; - foreach (qw(datelastseen onloan)) { - $item->{$_} = output_pref({ dt => dt_from_string( $item->{$_} ), dateonly => 1 }); - } $item->{datedue} = format_sqldatetime($item->{datedue}); # item damaged, lost, withdrawn loops $item->{itemlostloop} = GetAuthorisedValues($authvalcode_items_itemlost, $item->{itemlost}) if $authvalcode_items_itemlost; @@ -236,7 +233,7 @@ foreach my $item (@items) { if ( defined $reservedate ) { $item->{backgroundcolor} = 'reserved'; - $item->{reservedate} = output_pref({ dt => dt_from_string($reservedate ), dateonly => 1 }); + $item->{reservedate} = $reservedate; $item->{ReservedForBorrowernumber} = $reservedfor; $item->{ReservedForSurname} = $ItemBorrowerReserveInfo->{'surname'}; $item->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'}; @@ -250,7 +247,7 @@ foreach my $item (@items) { # Check the transit status my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber}); if ( defined( $transfertwhen ) && ( $transfertwhen ne '' ) ) { - $item->{transfertwhen} = output_pref({ dt => dt_from_string($transfertwhen ), dateonly => 1 }); + $item->{transfertwhen} = $transfertwhen; $item->{transfertfrom} = $branches->{$transfertfrom}{branchname}; $item->{transfertto} = $branches->{$transfertto}{branchname}; $item->{nocancel} = 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 73a97a9..9332d63 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -652,7 +652,7 @@ function verify_images() { : due [% item.datedue %] [% ELSIF ( item.transfertwhen ) %] - In transit from [% item.transfertfrom %] to [% item.transfertto %] since [% item.transfertwhen %] + In transit from [% item.transfertfrom %] to [% item.transfertto %] since [% item.transfertwhen | $KohaDates %] [% END %] [% IF ( item.itemlost ) %] @@ -713,7 +713,7 @@ function verify_images() { since [% item.waitingdate | $KohaDates %] [% ELSE %] [% IF ( item.reservedate ) %] - (placed [% item.reservedate %]) + (placed [% item.reservedate | $KohaDates %]) [% END %] [% END %] [% END %] @@ -735,7 +735,7 @@ function verify_images() { [% END %] - [% item.datelastseen %] + [% item.datelastseen | $KohaDates %] [% item.barcode %] [% IF ( volinfo ) %] -- 2.1.0