Bug 19902: Add column settings to bibliographic record checkouts history table
authorJosef Moravec <josef.moravec@gmail.com>
Tue, 2 Jan 2018 06:35:47 +0000 (06:35 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 18 Jul 2018 17:24:51 +0000 (17:24 +0000)
Test plan:
0) Apply the patch
1) Go to administration -> Configure columns, note there is new
checkoutshistory-table in Catalogue section
2) Make some configuration in this table settings
3) Go to detail of any record -> Checkout history
4) The columns should be visible according to your configuration from
step 2
5) Play with Column visibility, to ensure it does work as it should

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Fixed a minor typo during signoff.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt

index 8f0628f..6f7022d 100644 (file)
@@ -83,6 +83,28 @@ modules:
         -
           columnname: actions
 
+  catalogue:
+    detail:
+      checkoutshistory-table:
+        -
+          columnname: patron
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+        -
+          columnname: barcode
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+        -
+          columnname: checked_out_from
+        -
+          columnname: renewed
+        -
+          columnname: checkout_on
+        -
+          columnname: due_date
+        -
+          columnname: checkin_on
+
   cataloguing:
     additem:
       itemst:
index 785857a..3900344 100644 (file)
@@ -2,6 +2,7 @@
 [% USE Koha %]
 [% USE KohaDates %]
 [% USE Branches %]
+[% USE ColumnsSettings %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% biblio.title |html %]</title>
 
 [% MACRO jsinclude BLOCK %]
 [% INCLUDE 'datatables.inc' %]
+[% INCLUDE 'columns_settings.inc' %]
     <script type="text/javascript" id="js">
         $(document).ready(function() {
-            $("#table_issues").dataTable($.extend(true, {}, dataTablesDefaults, {
+            var columns_settings = [% ColumnsSettings.GetColumns('catalogue', 'detail', 'checkoutshistory-table', 'json') %];
+            var table = KohaTable("table_issues", {
                 "aoColumnDefs": [
                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
                 ],
+                "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
                 "aaSorting": [[ 4, "desc" ]],
                 "sPaginationType": "full_numbers"
-            }));
+            }, columns_settings);
         });
     </script>
 [% END %]