Bug 23061: Add column/print/export feature on checkout history page
authorOwen Leonard <oleonard@myacpl.org>
Thu, 6 Jun 2019 12:24:41 +0000 (12:24 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 19 Jun 2019 12:12:11 +0000 (13:12 +0100)
This patch adds columns configuration and export features to the
checkout history page.

This patch also removes some inline CSS: "overflow:hidden" from both the
checkout and holds history pages. This was breaking the table controls
tooltips, and didn't appear to me to be necessary.

To test, apply the patch and restart Plack (or restart_all on
kohadevbox).

 - Open a patron's checkout history page in the staff client.
 - The table of checkouts should have controls at the top.
   for columns configuration and export/print.
 - These controls should work correctly.

Signed-off-by: Michal Denar <black23@gmail.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/modules/members/holdshistory.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt

index f484ed9..213ee00 100644 (file)
@@ -590,6 +590,33 @@ modules:
           columnname: itemtype
         -
           columnname: status
+
+    checkouthistory:
+      checkouthistory-table:
+        - columnname: type
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+        -
+          columnname: date
+        -
+          columnname: title
+        -
+          columnname: author
+        -
+          columnname: call_number
+        -
+          columnname: barcode
+        -
+          columnname: number_of_renewals
+        -
+          columnname: checked_out_on
+        -
+          columnname: checked_out_from
+        -
+          columnname: date_due
+        -
+          columnname: return_date
+
     patron-lists:
       patron-list-table:
         -
index 87b4417..e030588 100644 (file)
@@ -36,7 +36,7 @@
 
 [% SET show_itemtype_column = Koha.Preference('AllowHoldItemTypeSelection') %]
 
-<div id="holdshistory" style="overflow:hidden">
+<div id="holdshistory">
   <table id="table_holdshistory">
       <thead>
         <tr>
index ccd72b7..097dbf0 100644 (file)
@@ -4,6 +4,7 @@
 [% USE Koha %]
 [% USE AuthorisedValues %]
 [% USE Branches %]
+[% USE ColumnsSettings %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Circulation History for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
@@ -44,7 +45,7 @@
     <li><a href="#readingrec" id="tab_onsite_checkout">On-site checkouts</a></li>
   </ul>
   [% END %]
-  <div id="readingrec" style="overflow:hidden">
+  <div id="readingrec">
     <table id="table_readingrec">
       <thead>
         <tr>
     [% INCLUDE 'str/members-menu.inc' %]
     [% Asset.js("js/members-menu.js") | $raw %]
     [% INCLUDE 'datatables.inc' %]
+    [% INCLUDE 'columns_settings.inc' %]
     <script id="js">
         $(document).ready(function() {
-            var table = $("#table_readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
+            var columns_settings = [% ColumnsSettings.GetColumns('members', 'checkouthistory', 'checkouthistory-table', 'json') %];
+            var table = KohaTable("table_readingrec", {
                 "sPaginationType": "four_button",
-                "aaSorting": [],
+                "aaSorting": [[10, 'desc']],
+                "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
                 "aoColumnDefs": [
                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
                 ]
-            }));
+            }, columns_settings);
+
             var tabs = $("#tabs").tabs({
                 activate: function(e, ui) {
                     var active = tabs.tabs("option", "active" );