From 9c925a5951e66aec65d4829843692b7d0a30dec3 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 25 Jan 2019 14:02:01 +0000 Subject: [PATCH] Bug 22175: Make stock rotation table sortable This patch adds sorting and column configuration to the stock rotation tables, both rotas and items. No new defaults for the table are defined. To test, apply the patch and clear your browser cache if necessary. - Go to Tools -> Stock rotation. - In the table of rotas test that sorting works correctly. - 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. - Choose a rota with multiple items on it and select manage -> items. Repeat the above DataTables functionality tests. - Go to Administration -> Columns settings and edit the default configuration of the stock rotation tables. Confirm that these changes are reflected in the corresponding tables. --- admin/columns_settings.yml | 35 ++++++++++++++++++ .../prog/en/modules/tools/stockrotation.tt | 42 ++++++++++------------ .../intranet-tmpl/prog/js/pages/stockrotation.js | 23 ++++++++++++ 3 files changed, 76 insertions(+), 24 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 6bc5c55..795926b 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -858,3 +858,38 @@ modules: columnname: actions cannot_be_toggled: 1 cannot_be_modified: 1 + + stockrotation: + stock_rotation: + - + columnname: name + - + columnname: cyclical + - + columnname: active + - + columnname: description + - + columnname: number_of_items + - + columnname: actions + cannot_be_toggled: 1 + cannot_be_modified: 1 + + stock_rotation_manage_items: + - + columnname: barcode + - + columnname: title + - + columnname: author + - + columnname: call_number + - + columnname: in_transit + - + columnname: stages + - + columnname: actions + cannot_be_toggled: 1 + cannot_be_modified: 1 diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt index 7cbf98f..027b199 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt @@ -3,6 +3,7 @@ [% USE Koha %] [% USE Branches %] [% USE KohaDates %] +[% USE ColumnsSettings %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Stock rotation @@ -56,15 +57,15 @@

Stock rotation

[% IF existing_rotas.size > 0 %] - +
- + - + @@ -80,12 +81,12 @@ Edit -
+
-
NameName Cyclical Active Description Number of items  
+
- - - - - - - + + + + + + + @@ -498,6 +499,7 @@ [% END %] + @@ -508,22 +510,14 @@ - [% MACRO jsinclude BLOCK %] [% Asset.js("js/tools-menu.js") | $raw %] [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] [% Asset.js("js/pages/stockrotation.js") | $raw %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js b/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js index 2763945..b9493df 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js @@ -1,3 +1,5 @@ +/* global KohaTable columns_settings */ + function init() { $('#ajax_status').hide(); $('#ajax_saving_msg').hide(); @@ -62,4 +64,25 @@ $(document).ready(function() { }) } }); + + KohaTable("stock_rotation_manage_items", { + "aoColumnDefs": [ + { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, + { "sType": "anti-the", "aTargets": [ "anti-the" ] } + ], + "sPaginationType": "four_button", + "autoWidth": false, + "exportColumns": [0,1,2,3,4,5] + }, stock_rotation_items_columns_settings); + + KohaTable("stock_rotation", { + "aoColumnDefs": [ + { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, + { "sType": "anti-the", "aTargets": [ "anti-the" ] } + ], + "sPaginationType": "four_button", + "autoWidth": false, + "exportColumns": [0,1,2,3,4] + }, stock_rotation_columns_settings); + }); -- 2.1.4
BarcodeTitleAuthorCallnumberIn transitStages & duration in days
(current stage highlighted)
 BarcodeTitleAuthorCall numberIn transitStages & duration in days
(current stage highlighted)