Bug 7743: Update opac-detail.pl to use KohaDates TT plugin
authorJulian Maurice <julian.maurice@biblibre.com>
Mon, 19 Mar 2012 13:43:47 +0000 (14:43 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 26 Mar 2012 14:22:41 +0000 (16:22 +0200)
Signed-off-by: Marijana Glavica <mglavica@ffzg.hr>
fixed conflict

koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
opac/opac-detail.pl

index 87fa839..53215f7 100644 (file)
@@ -1,3 +1,5 @@
+[% USE KohaDates %]
+
 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog &rsaquo; Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %]
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
@@ -635,7 +637,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
                [% IF ( itemdata_copynumber ) %]<td>[% ITEM_RESULT.copynumber %]</td>[% END %]
                <td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
                [% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %]
-               <td>[% ITEM_RESULT.datedue %]</td>
+               <td>[% ITEM_RESULT.datedue | $KohaDates %]</td>
            </tr>
            [% END %]</tbody>
        </table>
@@ -817,7 +819,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     [% IF ( subscription.branchname ) %]<h3>At library: [% subscription.branchname %]</h3>[% ELSE %]
     [% IF ( subscription.branchcode ) %]<h3>At library: [% subscription.branchcode %]</h3>[% END %][% END %]
     [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes %] </p>[% END %]
-    <p>Subscription from: [% subscription.histstartdate %]  to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate %] [% ELSE %] now (current)[% END %]</p>
+    <p>Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
     [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist %] </p>[% END %]
     [% IF ( subscription.opacnote ) %]<p>([% subscription.opacnote %])</p>[% END %]
 [% IF ( subscription.latestserials ) %]
@@ -899,7 +901,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
             <h5>
                 Your Comment
             </h5>
-            <small>[% review.datereviewed %]</small>
+            <small>[% review.datereviewed | $KohaDates %]</small>
         <p>
           [% FILTER html_break %]
           [% review.review |html %]
@@ -924,9 +926,9 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
                     [% CASE 'username' %]
                         <h5>Comment by [% review.userid %]</h5>
                     [% END %]
-                <small>[% review.datereviewed %]</small>
+                <small>[% review.datereviewed | $KohaDates %]</small>
             [% ELSIF ( ShowReviewer == "none") %]
-                <h5>Patron comment on [% review.datereviewed %]</h5>
+                <h5>Patron comment on [% review.datereviewed | $KohaDates %]</h5>
             [% END %]
         <p>
           [% FILTER html_break %]
@@ -1006,7 +1008,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 
         [% FOREACH AMAZON_CUSTOMER_REVIEW IN AMAZON_CUSTOMER_REVIEWS %]
             <div class="content_set">
-            <div class="clearfix" style="margin: .5em 0;"><h4 style="float: left;">[% AMAZON_CUSTOMER_REVIEW.Summary |html %]</h4>  <span class="starMT" style="float: left;"><span class="starFull" style="float: left; width:[% Rating * 10 %]px"></span></span> </div>  [% AMAZON_CUSTOMER_REVIEW.Date %]
+            <div class="clearfix" style="margin: .5em 0;"><h4 style="float: left;">[% AMAZON_CUSTOMER_REVIEW.Summary |html %]</h4>  <span class="starMT" style="float: left;"><span class="starFull" style="float: left; width:[% Rating * 10 %]px"></span></span> </div>  [% AMAZON_CUSTOMER_REVIEW.Date | $KohaDates %]
             [% IF ( AMAZON_CUSTOMER_REVIEW.Content ) %]
                 <p style="margin-left: .2em;">[% AMAZON_CUSTOMER_REVIEW.Content |html %]</p>
             [% END %]
index aed7dd7..7fce1c2 100755 (executable)
@@ -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);