From f52fd6ba488df8f5e7112b039d299ea3f5e309a8 Mon Sep 17 00:00:00 2001
From: Nuño López Ansótegui <nunyo@masmedios.com>
Date: Fri, 22 Feb 2013 09:56:06 +0100
Subject: [PATCH] Bug 9040 - uninitialized value in concatenation error in Opac-detail.tt

---
 koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt |    4 ++--
 opac/opac-detail.pl                                |    3 ++-
 2 files changed, 4 insertions(+), 3 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 cd58cb5..485f426 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
@@ -1450,7 +1450,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
             [% IF ( itemdata_copynumber ) %]<th id="item_copy">Copy</th>[% END %]
             <th id="item_status">Status</th>
             [% IF ( itemdata_itemnotes ) %]<th id="item_notes">Notes</th>[% END %]
-            <th id="item_datedue">Date due</th>
+            [% IF ( itemdata_datedue ) %]<th id="item_datedue">Date due</th>[% END %]
             [% IF ( OPACShowBarcode ) %]<th>Barcode</th>[% END %]
         [% IF holds_count.defined %]
             <th>Item holds</th>
@@ -1480,7 +1480,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
                [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %]
               <td class="status">[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
              [% IF ( itemdata_itemnotes ) %]<td class="notes">[% ITEM_RESULT.itemnotes %]</td>[% END %]
-        <td class="date_due">[% ITEM_RESULT.datedue | $KohaDates %]</td>
+        [% IF ( itemdata_datedue ) %]<td class="date_due">[% ITEM_RESULT.datedue | $KohaDates %]</td>[% END %]
         [% IF ( OPACShowBarcode ) %]<td class="barcode">[% ITEM_RESULT.barcode %]</td>[% END %]
         [% IF holds_count.defined || show_priority %]
         <td class="holds_count">
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index bb9cbd5..5faa606 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -541,7 +541,7 @@ for my $itm (@items) {
         $itm->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} );
         $itm->{'description'} = $itemtypes->{ $itm->{itype} }->{'description'};
     }
-    foreach (qw(ccode enumchron copynumber itemnotes uri)) {
+    foreach (qw(ccode enumchron copynumber itemnotes uri datedue)) {
         $itemfields{$_} = 1 if ($itm->{$_});
     }
 
@@ -610,6 +610,7 @@ my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($bib
                      itemdata_uri            => $itemfields{uri},
                      itemdata_copynumber     => $itemfields{copynumber},
                      itemdata_itemnotes          => $itemfields{itemnotes},
+                     itemdata_datedue         => $itemfields{datedue},
                      authorised_value_images => $biblio_authorised_value_images,
                      subtitle                => $subtitle,
                      OpacStarRatings         => C4::Context->preference("OpacStarRatings"),
-- 
1.5.6.5