From 04ca66cb8cea4eb48c951c40d0341fcb64ea9d21 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. --- admin/columns_settings.yml | 19 +++++++++++++++++++ .../intranet-tmpl/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 c616851..fdc7293 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -124,6 +124,25 @@ modules: - columnname: actions + 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: acquisitiondetails-table: 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 4c23852..20ed241 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.1.4