Bug 14753 - Use columns configuration for checkins table
authorNick Clemens <nick@bywatersolutions.com>
Wed, 10 Feb 2016 00:54:26 +0000 (00:54 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Wed, 2 Mar 2016 04:18:33 +0000 (04:18 +0000)
This patch adds the ability to configrue the visible columns on the
check in screen.

To test with both patches:
1 - Check in an item
2 - Note there is no 'Date acquired' column
3 - Apply  patches
4 - Note there is still no 'Date acquired' column
5 - Note that there is now a "Show / hide columns" button
6 - Verify that you can check the box and view the 'Date acquired'
column
7 - Verify that showing/hiding columns works (it will not carry over
        between items due to page reload)
8 - Verify that changes from the 'Configure columns' section of
Administration hold between checkins

Sponsored by: North Central Regional Library (ncrl.org)

Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt

index 9d1e38f..1a3bd12 100644 (file)
@@ -317,6 +317,33 @@ modules:
           cannot_be_toggled: 1
           cannot_be_modified: 1
 
+      checkedintable:
+        -
+          columnname: due_date
+        -
+          columnname: title
+        -
+          columnname: author
+        -
+          columnname: barcode
+        -
+          columnname: homelibrary
+        -
+          columnname: holdinglibrary
+        -
+          columnname: location
+        -
+          columnname: itemcallnumber
+        -
+          columnname: dateaccessioned
+          is_hidden: 1
+        -
+          columnname: itype
+        -
+          columnname: borrower
+        -
+          columnname: itemnote
+
     view_holdsqueue:
       holds-table:
         -
index c3e0a1e..7b73118 100644 (file)
@@ -4,11 +4,14 @@
 [% USE Borrowers %]
 [% USE ItemTypes %]
 [% USE AuthorisedValues %]
+[% USE ColumnsSettings %]
 
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Circulation &rsaquo; Check in [% title |html %]</title>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
-
+[% INCLUDE 'datatables.inc' %]
+[% INCLUDE 'columns_settings.inc' %]
 [% INCLUDE 'calendar.inc' %]
 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
 [% INCLUDE 'timepicker.inc' %]
@@ -25,6 +28,14 @@ $(document).ready(function () {
         Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% biblionumber %]');
     [% END %]
 
+    var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'checkedintable', 'json' ) %]
+    var returns_table = KohaTable("#checkedintable", {
+            "bFilter":false,
+            "bPaginate":false,
+            "bInfo":false,
+            "bSort":false
+            }, columns_settings);
+
     $("#return_date_override").datetimepicker({
         onClose: function(dateText, inst) { $("#barcode").focus(); },
         defaultDate: -1,
@@ -589,7 +600,7 @@ $(document).ready(function () {
 [% IF ( riloop ) %]
     <h2>Checked-in items</h2>
     <table id="checkedintable">
-    <tr><th class="ci-duedate">Due date</th><th class="ci-title">Title</th><th class="ci-author">Author</th><th class="ci-barcode">Barcode</th><th class="ci-homelibrary">Home library</th><th class="ci-holdinglibrary">Holding library</th><th class="ci-shelvinglocation">Shelving location</th><th class="ci-callnumber">Call number</th><th class="ci-dateaccessioned">Date acquired</th><th class="ci-type">Type</th><th class="ci-patron">Patron</th><th class="ci-note">Note</th></tr>
+    <thead><th class="ci-duedate">Due date</th><th class="ci-title">Title</th><th class="ci-author">Author</th><th class="ci-barcode">Barcode</th><th class="ci-homelibrary">Home library</th><th class="ci-holdinglibrary">Holding library</th><th class="ci-shelvinglocation">Shelving location</th><th class="ci-callnumber">Call number</th><th class="ci-dateaccessioned">Date acquired</th><th class="ci-type">Type</th><th class="ci-patron">Patron</th><th class="ci-note">Note</th></thead>
 
         [% FOREACH riloo IN riloop %]
             <tr>