From f893f54ea1c6a44c60b10026833d60dfda68cd36 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 19 Mar 2012 14:43:47 +0100 Subject: [PATCH] Bug 7743: Update opac-detail.pl to use KohaDates TT plugin Signed-off-by: Marijana Glavica fixed conflict --- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 14 ++++++++------ opac/opac-detail.pl | 11 +++-------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 87fa839288..53215f7891 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -1,3 +1,5 @@ +[% USE KohaDates %] + [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -635,7 +637,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( itemdata_copynumber ) %][% ITEM_RESULT.copynumber %][% END %] [% INCLUDE 'item-status.inc' item = ITEM_RESULT %] [% IF ( itemdata_itemnotes ) %][% ITEM_RESULT.itemnotes %][% END %] - [% ITEM_RESULT.datedue %] + [% ITEM_RESULT.datedue | $KohaDates %] [% END %] @@ -817,7 +819,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( subscription.branchname ) %]

At library: [% subscription.branchname %]

[% ELSE %] [% IF ( subscription.branchcode ) %]

At library: [% subscription.branchcode %]

[% END %][% END %] [% IF ( subscription.subscriptionnotes ) %]

[% subscription.subscriptionnotes %]

[% END %] -

Subscription from: [% subscription.histstartdate %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate %] [% ELSE %] now (current)[% END %]

+

Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]

[% IF ( subscription.missinglist ) %]

Missing issues: [% subscription.missinglist %]

[% END %] [% IF ( subscription.opacnote ) %]

([% subscription.opacnote %])

[% END %] [% IF ( subscription.latestserials ) %] @@ -899,7 +901,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
Your Comment
- [% review.datereviewed %] + [% review.datereviewed | $KohaDates %]

[% FILTER html_break %] [% review.review |html %] @@ -924,9 +926,9 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% CASE 'username' %]

Comment by [% review.userid %]
[% END %] - [% review.datereviewed %] + [% review.datereviewed | $KohaDates %] [% ELSIF ( ShowReviewer == "none") %] -
Patron comment on [% review.datereviewed %]
+
Patron comment on [% review.datereviewed | $KohaDates %]
[% END %]

[% FILTER html_break %] @@ -1006,7 +1008,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% FOREACH AMAZON_CUSTOMER_REVIEW IN AMAZON_CUSTOMER_REVIEWS %]

-

[% AMAZON_CUSTOMER_REVIEW.Summary |html %]

[% AMAZON_CUSTOMER_REVIEW.Date %] +

[% AMAZON_CUSTOMER_REVIEW.Summary |html %]

[% AMAZON_CUSTOMER_REVIEW.Date | $KohaDates %] [% IF ( AMAZON_CUSTOMER_REVIEW.Content ) %]

[% AMAZON_CUSTOMER_REVIEW.Content |html %]

[% END %] diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index aed7dd7428..7fce1c2766 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -32,7 +32,6 @@ use C4::Biblio; use C4::Items; use C4::Circulation; use C4::Tags qw(get_tags); -use C4::Dates qw/format_date/; use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn); use C4::External::Amazon; use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes ); @@ -454,8 +453,8 @@ foreach my $subscription (@subscriptions) { $cell{subscriptionnotes} = $subscription->{notes}; $cell{missinglist} = $subscription->{missinglist}; $cell{opacnote} = $subscription->{opacnote}; - $cell{histstartdate} = format_date($subscription->{histstartdate}); - $cell{histenddate} = format_date($subscription->{histenddate}); + $cell{histstartdate} = $subscription->{histstartdate}; + $cell{histenddate} = $subscription->{histenddate}; $cell{branchcode} = $subscription->{branchcode}; $cell{branchname} = GetBranchName($subscription->{branchcode}); $cell{hasalert} = $subscription->{hasalert}; @@ -528,7 +527,7 @@ for my $itm (@items) { my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber}); if ( defined( $transfertwhen ) && $transfertwhen ne '' ) { - $itm->{transfertwhen} = format_date($transfertwhen); + $itm->{transfertwhen} = $transfertwhen; $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname}; $itm->{transfertto} = $branches->{$transfertto}{branchname}; } @@ -642,7 +641,6 @@ foreach ( @$reviews ) { } $_->{userid} = $borrowerData->{'userid'}; $_->{cardnumber} = $borrowerData->{'cardnumber'}; - $_->{datereviewed} = format_date($_->{datereviewed}); if ($borrowerData->{'borrowernumber'} eq $borrowernumber) { $_->{your_comment} = 1; $loggedincommenter = 1; @@ -724,9 +722,6 @@ if ( C4::Context->preference("OPACAmazonEnabled") ) { if ( $amazon_reviews ) { my $item = $amazon_details->{Items}->{Item}->[0]; my $customer_reviews = \@{ $item->{CustomerReviews}->{Review} }; - for my $one_review ( @$customer_reviews ) { - $one_review->{Date} = format_date($one_review->{Date}); - } my $editorial_reviews = \@{ $item->{EditorialReviews}->{EditorialReview} }; my $average_rating = $item->{CustomerReviews}->{AverageRating} || 0; $template->param( amazon_average_rating => $average_rating * 20); -- 2.39.5