Bug 13864: Columns configuration - Late orders
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 18 Mar 2015 11:56:07 +0000 (12:56 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 8 Apr 2015 17:51:09 +0000 (14:51 -0300)
This patch adds the ability to hide columns on the late orders page
(acqui/lateorders.pl).

Test plan:
Go on the late orders 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: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
http://bugs.koha-community.org/show_bug.cgi?id=13875
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt

index 9e9a49c..5222253 100644 (file)
@@ -1,4 +1,34 @@
 modules:
+  acqui:
+    lateorders:
+      late_orders:
+        -
+          columnname: checkbox
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+        -
+          columnname: order_date
+        -
+          columnname: estimated_delivery_date
+        -
+          columnname: vendor
+        -
+          columnname: information
+        -
+          columnname: total_cost
+        -
+          columnname: basket
+        -
+          columnname: basket_group
+        -
+          columnname: library
+        -
+          columnname: fund
+        -
+          columnname: claims_count
+        -
+          columnname: claimed_date
+
   admin:
     currency:
       currencies-table:
index d794d74..70a15be 100644 (file)
@@ -1,10 +1,12 @@
 [% USE KohaDates %]
 [% USE Branches %]
+[% USE ColumnsSettings %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'datatables.inc' %]
+[% INCLUDE 'columns_settings.inc' %]
 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 [% INCLUDE 'calendar.inc' %]
 <script type="text/javascript">
@@ -23,7 +25,8 @@ function check_uncheck() {
 
 $(document).ready(function() {
 
-    late_orderst = $("#late_orders").dataTable($.extend(true, {}, dataTablesDefaults, {
+    var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) %];
+    late_orderst = KohaTable("#late_orders", {
         "aoColumnDefs": [
             { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
             { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
@@ -37,7 +40,7 @@ $(document).ready(function() {
                 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
             };
         }
-    } ) );
+    }, columns_settings );
     $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
     $('#CheckAll').click(function(){ $(late_orderst.fnGetNodes()).find("td").checkCheckboxes();});
     $('#CheckNone').click(function(){ $(late_orderst.fnGetNodes()).find("td").unCheckCheckboxes();});