From: Owen Leonard Date: Fri, 25 Jan 2019 14:02:01 +0000 (+0000) Subject: Bug 22175: Make stock rotation table sortable X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=8bf043b94d73724244429adfae249d87ca5c8b9c 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. Signed-off-by: Jose-Mario Monteiro-Santos Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index f033cd3..f484ed9 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -967,3 +967,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 cddab8d..719dac4 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 @@ -55,15 +56,15 @@

Stock rotation

[% IF existing_rotas.size > 0 %] - +
- + - + @@ -79,12 +80,12 @@ Edit -
+
-
NameName Cyclical Active Description Number of items  
+
- - - - - - - + + + + + + + @@ -497,6 +498,7 @@ [% END %] + @@ -507,22 +509,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); + });
BarcodeTitleAuthorCallnumberIn transitStages & duration in days
(current stage highlighted)
 BarcodeTitleAuthorCall numberIn transitStages & duration in days
(current stage highlighted)