From 75e4bce0bcbff0f054fd92528c9b40c61b08c9d1 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@biblibre.com>
Date: Wed, 26 Feb 2014 16:15:13 +0100
Subject: [PATCH] Bug 11169: Hide the date_due column

The date due information is useless for in order items.
---
 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt |   14 +++++++++++---
 koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt      |   15 ++++++++++++---
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
index 328c870..895faf4 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
@@ -834,7 +834,7 @@
                         <h2>Acquisition details</h2>
                         [% IF Koha.Preference('AcqCreateItem') == 'ordering' %]
                           The following items are on order.
-                          [% INCLUDE items_table items=acquisition_details.items tab="acquisition_details" noshelfbrowser=1 %]
+                          [% INCLUDE items_table items=acquisition_details.items tab="acquisition_details" noshelfbrowser=1 without="date_due" %]
                         [% ELSE %]
                           [% acquisition_details.total_quantity %] items are on order.
                         [% END %]
@@ -1141,7 +1141,11 @@
                 [% IF ( itemdata_copynumber ) %]<th id="item_copy" class="copynumber">Copy number</th>[% END %]
                 <th id="item_status" class="status">Status</th>
                 [% IF ( itemdata_itemnotes ) %]<th id="item_notes" class="notes">Notes</th>[% END %]
-                <th id="item_datedue" class="date_due">Date due</th>
+                [% IF without != "date_due" %]
+                  <th id="item_datedue" class="date_due">Date due</th>
+                [% ELSE %]
+                  <th id="item_datedue" class="date_due" style="display:none;">Date due</th>
+                [% END %]
                 [% IF ( OPACShowBarcode ) %]<th id="item_barcode" class="barcode">Barcode</th>[% END %]
                 [% IF holds_count.defined %]
                     <th>Item holds</th>
@@ -1215,7 +1219,11 @@
                     [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %]
                     <td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
                     [% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes %]</td>[% END %]
-                    <td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates %]</span></td>
+                    [% IF without != "date_due" %]
+                      <td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates %]</span></td>
+                    [% ELSE %]
+                      <td class="date_due" style="display:none;"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates %]</span></td>
+                    [% END %]
                     [% IF ( OPACShowBarcode ) %]<td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode %]</td>[% END %]
                     [% IF holds_count.defined || show_priority %]
                         <td class="holds_count">
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 8b6441f..d556c28 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
@@ -1247,7 +1247,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <h2>Acquisition details</h2>
     [% IF Koha.Preference('AcqCreateItem') == 'ordering' %]
       The following items are on order.
-      [% INCLUDE items_table items=acquisition_details.items tab="acquisition_details" noshelfbrowser=1 %]
+      [% INCLUDE items_table items=acquisition_details.items tab="acquisition_details" noshelfbrowser=1 without="date_due" %]
     [% ELSE %]
       [% acquisition_details.total_quantity %] items are on order.
     [% END %]
@@ -1542,7 +1542,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
             [% IF ( itemdata_copynumber ) %]<th id="item_copy" class="copynumber">Copy number</th>[% END %]
             <th id="item_status" class="status">Status</th>
             [% IF ( itemdata_itemnotes ) %]<th id="item_notes" class="notes">Notes</th>[% END %]
-            <th id="item_datedue" class="date_due">Date due</th>
+            [% IF without != "date_due" %]
+              <th id="item_datedue" class="date_due">Date due</th>
+            [% ELSE %]
+              <th id="item_datedue" class="date_due" style="display:none;">Date due</th>
+            [% END %]
             [% IF ( OPACShowBarcode ) %]<th id="item_barcode" class="barcode">Barcode</th>[% END %]
         [% IF holds_count.defined %]
             <th>Item holds</th>
@@ -1600,7 +1604,12 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
                [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %]
               <td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
              [% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes %]</td>[% END %]
-        <td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates %]</span></td>
+
+        [% IF without != "date_due" %]
+          <td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates %]</span></td>
+        [% ELSE %]
+          <td class="date_due" style="display:none;"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates %]</span></td>
+        [% END %]
         [% IF ( OPACShowBarcode ) %]<td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode %]</td>[% END %]
         [% IF holds_count.defined || show_priority %]
         <td class="holds_count">
-- 
1.7.10.4