Bug 13866: Columns configuration - Patrons search
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 18 Mar 2015 12:09:06 +0000 (13:09 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 10 Apr 2015 13:31:21 +0000 (10:31 -0300)
This patch adds the ability to hide columns on the patrons search page
(acqui/lateorders.pl).

Test plan:
Go on the patrons search page and confirm you are able to hide columns.
You can also play with the columns configuration admin page and confirm
that the behaviors are consistent.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Works as expected

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Small rebase was needed.

admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt

index f2d9cc9..529cd15 100644 (file)
@@ -51,6 +51,35 @@ modules:
           columnname: active
         -
           columnname: actions
+
+  members:
+    member:
+      memberresultst:
+        -
+          columnname: checkbox
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+        -
+          columnname: cardnumber
+        -
+          columnname: name
+        -
+          columnname: category
+        -
+          columnname: library
+        -
+          columnname: expires_on
+        -
+          columnname: od_checkouts
+        -
+          columnname: fines
+        -
+          columnname: circ_notes
+        -
+          columnname: actions
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+
   reports:
     lostitems:
       lostitems-table:
index db629e5..cb799f7 100644 (file)
             [% PROCESS pagelist module=modules.circ modulename="circ" %]
           </div>
 
+          <h3><a href="#members">Patrons</a></h3>
+          <div id="members">
+            <h4>Patrons tables</h4>
+            [% PROCESS pagelist module=modules.members modulename="members" %]
+          </div>
+
           <h3><a href="#reports">Reports</a></h3>
           <div id="reports">
             <h4>Reports tables</h4>
index d481c60..7ecf271 100644 (file)
@@ -1,9 +1,11 @@
 [% USE Koha %]
+[% USE ColumnsSettings %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Patrons [% IF ( searching ) %]&rsaquo; Search results[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'datatables.inc' %]
+[% INCLUDE 'columns_settings.inc' %]
 <script type="text/javascript">
 //<![CDATA[
 $(document).ready(function() {
@@ -130,7 +132,8 @@ $(document).ready(function() {
     });
 
     // Apply DataTables on the results table
-    dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
+    var columns_settings = [% ColumnsSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) %];
+    dtMemberResults = KohaTable("#memberresultst", {
         'bServerSide': true,
         'sAjaxSource': "/cgi-bin/koha/svc/members/search",
         'fnServerData': function(sSource, aoData, fnCallback) {
@@ -215,7 +218,7 @@ $(document).ready(function() {
         'sPaginationType': 'full_numbers',
         "iDisplayLength": [% PatronsPerPage %],
         "bProcessing": true,
-    }));
+    }, columns_settings);
     update_searched();
 });