Bug 11281: Printing holds awaiting pickup prints both tabs
authorOwen Leonard <oleonard@myacpl.org>
Fri, 22 Nov 2019 19:29:53 +0000 (19:29 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 10 Feb 2020 09:22:39 +0000 (09:22 +0000)
This patch adds columns configuration to the holds awaiting pickup
tables. Doing so helps solve the printing issue by adding a "Print"
option to both tables. Using this print function will provide a
printable version of only that table.

To test you should have multiple holds in your system which are marked
"waiting" and some which have been waiting longer than the value
specified in the ReservesMaxPickUpDelay system preference.

Apply the patch and go to Circulation -> Holds awaiting pickup.

 - On both the "Holds waiting" and "Holds waiting over..." tabs the
   DataTable should display correctly and all the controls should work,
   including the columns settings and the choices in the export menu.
 - Confirm that the "Print" action creates a printable version of only
   the table you are viewing.

 - Go to Administration -> Columns settings -> Circulation.
 - Change some visibility controls for the tables under the
   "holds_awaiting_pickup" heading (id=holdso and id=holdst). Confirm
   that these changes are reflected in the "Holds waiting" interface.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc
koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt

index e09cd5f..2c45659 100644 (file)
@@ -997,6 +997,55 @@ modules:
         -
           columnname: items_needed
 
+    holds_awaiting_pickup:
+      holdst:
+        -
+          columnname: waiting_since
+        -
+          columnname: date_hold_placed
+        -
+          columnname: title
+        -
+          columnname: patron
+        -
+          columnname: home_library
+        -
+          columnname: current_location
+        -
+          columnname: shelving_location
+        -
+          columnname: call_number
+        -
+          columnname: copy_number
+        -
+          columnname: enumeration
+        -
+          columnname: action
+
+      holdso:
+        -
+          columnname: waiting_since
+        -
+          columnname: date_hold_placed
+        -
+          columnname: title
+        -
+          columnname: patron
+        -
+          columnname: home_library
+        -
+          columnname: current_location
+        -
+          columnname: shelving_location
+        -
+          columnname: call_number
+        -
+          columnname: copy_number
+        -
+          columnname: enumeration
+        -
+          columnname: action
+
     overdues:
       circ-overdues:
         -
index f8a3045..3ec275f 100644 (file)
@@ -13,7 +13,7 @@
             <th>Call number</th>
             <th>Copy number</th>
             <th>Enumeration</th>
-            <th>Action</th>
+            <th class="NoSort noExport">Actions</th>
         </tr>
     </thead>
     <tbody>
index b4dd227..43a2684 100644 (file)
@@ -3,6 +3,7 @@
 [% USE Koha %]
 [% USE KohaDates %]
 [% USE Branches %]
+[% USE ColumnsSettings %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Circulation &rsaquo; Holds awaiting pickup</title>
@@ -27,7 +28,7 @@
                 [% IF Koha.Preference('CircSidebar') %]
                     <div class="col-sm-10 col-sm-push-2">
                 [% ELSE %]
-                    <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
+                    <div class="col-sm-12">
                 [% END %]
 
         <h2>Holds awaiting pickup for your library on: [% show_date | $KohaDates %]
 
 [% MACRO jsinclude BLOCK %]
     [% INCLUDE 'datatables.inc' %]
+    [% INCLUDE 'columns_settings.inc' %]
     <script>
+        var holdst_columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdst', 'json' ) | $raw %];
+        var holdso_columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdso', 'json' ) | $raw %];
+
         $(document).ready(function() {
-            $('#resultlist').tabs();
-            $("th a").hide();
-            $("#holdst,#holdso").dataTable($.extend(true, {}, dataTablesDefaults, {
+
+            KohaTable("holdst", {
+                "aoColumnDefs": [
+                    { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] },
+                    { "type": "anti-the", "targets" : [ "anti-the" ] },
+                    { "type": "title-string", "targets" : [ "title-string" ] }
+                ],
+                "sPaginationType": "full"
+            }, holdst_columns_settings);
+
+            KohaTable("holdso", {
                 "aoColumnDefs": [
-                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
-                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
-                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
+                    { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] },
+                    { "type": "anti-the", "targets" : [ "anti-the" ] },
+                    { "type": "title-string", "targets" : [ "title-string" ] }
                 ],
                 "sPaginationType": "full"
-            }));
+            }, holdso_columns_settings);
+
+            $('#resultlist').tabs();
+
         });
     </script>
 [% END %]