Bug 17700: Add columns setting to fines tables
authorJosef Moravec <josef.moravec@gmail.com>
Wed, 16 Nov 2016 10:02:34 +0000 (10:02 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 16 Dec 2016 11:39:09 +0000 (11:39 +0000)
Test plan:
0) Apply the patch and restart memcached + koha-common services if
needed
1) Go to adminitration -> Configure columns and confirm there is new
table configuration with id=account-fines in Patrons section available
2) play with table setting to ensure it works as expected
3) go to to boraccount page for some patron with both fines - payed and
owed
4) Note there is new button "Columns visibility" in top paginator panel,
try to use it
5) Play with the datatable, sort filter and so on

Signed-off-by: Radek Šiman <rbit@rbit.cz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt

index 7ef4d35..ee73b1e 100644 (file)
@@ -155,6 +155,27 @@ modules:
           columnname: stocknumber
 
   members:
+    fines:
+      account-fines:
+        -
+          columnname: date
+        -
+          columnname: description
+        -
+          columnname: note
+        -
+          columnname: amount
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+        -
+          columnname: amountoutstanding
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+        -
+          columnname: actions
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+
     member:
       memberresultst:
         -
index ca0a804..90e8a48 100644 (file)
@@ -1,23 +1,26 @@
 [% USE Koha %]
 [% USE KohaDates %]
+[% USE ColumnsSettings %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
 [% INCLUDE 'datatables.inc' %]
+[% INCLUDE 'columns_settings.inc' %]
 <script type="text/javascript">
 $(document).ready(function() {
     var txtActivefilter = _("Filter paid transactions");
     var txtInactivefilter = _("Show all transactions");
-    var table_account_fines = $("#table_account_fines").dataTable($.extend(true, {}, dataTablesDefaults, {
+    var columns_settings = [% ColumnsSettings.GetColumns('members', 'fines', 'account-fines', 'json') %];
+    var table_account_fines = KohaTable("#table_account_fines", {
         "sPaginationType": "four_button",
         'aaSorting': [[0, 'desc']],
-        "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
+        "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
         "aoColumnDefs": [
             { "sType": "title-string", "aTargets" : [ "title-string" ] },
             { "bSortable": false, "bSearchable": false, "aTargets": [-1] }
         ]
-    }));
+    }, columns_settings);
     $("#filter_c").html('<p><a href="#" id="filter_transacs"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>');
     $('#filter_transacs').click(function(e) {
         e.preventDefault();