Bug 13865: Columns configuration - Orders search
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 18 Mar 2015 12:16:43 +0000 (13:16 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 13 Apr 2015 12:59:16 +0000 (09:59 -0300)
This patch adds the ability to hide columns on the orders search page
(acqui/histsearch.pl).

Test plan:
Go on the orders 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: Nicole <nicole@bywatersolutions.com>
http://bugs.koha-community.org/show_bug.cgi?id=13685

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt

index 529cd15..bf3e4d6 100644 (file)
@@ -1,5 +1,36 @@
 modules:
   acqui:
+    histsearch:
+      histsearcht:
+        -
+          columnname: order_line
+        -
+          columnname: status
+        -
+          columnname: basket
+        -
+          columnname: basket_creator
+        -
+          columnname: basket_group
+        -
+          columnname: invoice_number
+        -
+          columnname: summary
+        -
+          columnname: vendor
+        -
+          columnname: placed_on
+        -
+          columnname: received_on
+        -
+          columnname: quantity_received
+        -
+          columnname: pending_order
+        -
+          columnname: unit_cost
+        -
+          columnname: fund
+
     lateorders:
       late_orders:
         -
index ebb9f74..77e42a4 100644 (file)
@@ -1,23 +1,26 @@
 [% USE KohaDates %]
+[% USE ColumnsSettings %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( order_loop ) %]Orders search &rsaquo; Search results[% ELSE %]Order search[% END %]</title>
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
 [% INCLUDE 'datatables.inc' %]
+[% INCLUDE 'columns_settings.inc' %]
 
 <script type="text/javascript" src="[% interface %]/js/autocomplete/patrons.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 var MSG_REMOVE_PATRON = _("Remove");
  $(document).ready(function() {
-    $("#histsearcht").dataTable($.extend(true, {}, dataTablesDefaults, {
+    var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) %];
+    KohaTable("#histsearcht", {
         "aoColumnDefs": [
             { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
             { "sType": "title-string", "aTargets" : [ "title-string" ] }
         ],
         "sPaginationType": "four_button"
-    } ) );
+    }, columns_settings );
 
     [% UNLESS order_loop %]
         patron_autocomplete({