Bug 27212: Add Table configuration to acqui-home.pl accounts table
authorLucas Gass <lucas@bywatersolutions.com>
Wed, 2 Feb 2022 23:36:58 +0000 (23:36 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 8 Apr 2022 13:49:16 +0000 (15:49 +0200)
To test, apply the patch and clear your browser cache

1. Go to acqui-home.pl
2. Test that the "Columns" button works to show and hide columns.
3. Go to Administration -> Table settings and look under the Acquisitions tab for the page 'acq_acqui-home' and the table 'accounts'.
4. Hide each column and make sure it hides correctly on acqui-home.pl
5. Test the export options (Excel, CSV, etc) and make sure hidden columns do not show up.
6. Make sure the totals at the bottom of the screen can still be calculated

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt

index 394b5d3..1a91d8c 100644 (file)
@@ -1,5 +1,33 @@
 modules:
   acqui:
+    acq_acqui-home:
+      accounts:
+        columns:
+            -
+              columnname: active
+              cannot_be_toggled: 1
+              cannot_be_modified: 1
+            -
+              columnname: budget_period_descriptions
+              cannot_be_toggled: 1
+              cannot_be_modified: 1
+            -
+              columnname: fund_code
+            -
+              columnname: fund_name
+            -
+              columnname: owner
+            -
+              columnname: library
+            -
+              columnname: amount
+            -
+              columnname: ordered
+            -
+              columnname: spent
+            -
+              columnname: total_available
+
     histsearch:
       histsearcht:
         columns:
index f2853fc..e7041bf 100644 (file)
@@ -2,6 +2,7 @@
 [% USE Asset %]
 [% USE Price %]
 [% USE Branches %]
+[% USE TablesSettings %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Acquisitions &rsaquo; Koha</title>
         dt_overwrite_html_sorting_localeCompare();
 
         $(document).ready(function() {
-
+            var column_settings = [% TablesSettings.GetColumns( 'acqui', 'acq_acqui-home', 'accounts', 'json' ) | $raw %];
             var oTable = KohaTable("accounts", {
                 "fnDrawCallback": function ( oSettings ) {
                     if ( oSettings.aiDisplay.length == 0 )
                 'aaSortingFixed': [[ 1, 'asc' ]],
                 'bPaginate': false,
                 "bAutoWidth": false
-            });
+            }, column_settings );
 
             $(oTable).treetable({
                 expandable: true