From 9371bec02e00adc9b26b678e2fdcfc6b003b3ad6 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 23 Jan 2019 15:23:15 +0000 Subject: [PATCH] Bug 22191: Add column configuration to libraries administration This patch adds column configuration to the table of libraries in administration. No new defaults for the table are defined. To test, apply the patch and clear your browser cache if necessary. - Go to Administration -> Libraries - Test that the "Column visibility" button works to show and hide columns. The "actions" column should be excluded. - Test that export options (Excel, CSV, etc) exclude the "actions" column. - Go to Administration -> Columns settings and edit the default configuration of the libraries table. Confirm that these changes are reflected in libraries administration. Signed-off-by: Jose-Mario Monteiro-Santos Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- admin/columns_settings.yml | 19 +++++++++++++++++++ .../prog/en/modules/admin/branches.tt | 13 ++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 8d636f1455..6bc5c5502c 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -157,6 +157,25 @@ modules: cannot_be_toggled: 1 cannot_be_modified: 1 + libraries: + libraries: + - + columnname: library_name + - + columnname: library_code + - + columnname: library_address + - + columnname: marc_organization_code + - + columnname: library_ip + - + columnname: is_pickup_location + - + columnname: actions + cannot_be_toggled: 1 + cannot_be_modified: 1 + catalogue: detail: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt index 4c23852185..20ed241f21 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -1,6 +1,7 @@ [% USE raw %] [% USE Asset %] [% SET footerjs = 1 %] +[% USE ColumnsSettings %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Libraries [% IF op == 'add_form' %] @@ -184,7 +185,7 @@ [% IF op == 'list' %] <h3>Libraries</h3> [% IF libraries.count %] - <table id="branchest"> + <table id="libraries"> <thead> <tr> <th>Name</th> @@ -261,16 +262,18 @@ [% MACRO jsinclude BLOCK %] [% Asset.js("js/admin-menu.js") | $raw %] [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] [% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %] <script> + var columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'libraries', 'libraries', 'json' ) | $raw %]; $(document).ready(function() { - $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, { + KohaTable("libraries", { "aoColumnDefs": [ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, ], - "iDisplayLength": 10, - "sPaginationType": "four_button" - })); + "sPaginationType": "four_button", + "exportColumns": [0,1,2,3,4,5] + }, columns_settings); [% UNLESS library %] $("#Aform").on("submit", function( event ) { -- 2.39.5