@@ -, +, @@ item types administration - Go to Administration -> Item types. - 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 item types table. Confirm that these changes are reflected in item tyeps administration. --- admin/columns_settings.yml | 31 ++++++++++++++++++++++ .../prog/en/modules/admin/itemtypes.tt | 24 ++++++++++++----- 2 files changed, 48 insertions(+), 7 deletions(-) --- a/admin/columns_settings.yml +++ a/admin/columns_settings.yml @@ -157,6 +157,37 @@ modules: cannot_be_toggled: 1 cannot_be_modified: 1 + itemtypes: + table_item_type: + - + columnname: image + - + columnname: code + - + columnname: description + - + columnname: search_category + - + columnname: not_for_loan + - + columnname: hide_in_opac + - + columnname: rental_charge + - + columnname: daily_rental_charge + - + columnname: hourly_rental_charge + - + columnname: default_replacement_cost + - + columnname: lost_processing_fee + - + columnname: checkin_message + - + columnname: actions + cannot_be_toggled: 1 + cannot_be_modified: 1 + libraries: libraries: - --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -3,6 +3,7 @@ [% USE Koha %] [% USE AuthorisedValues %] [% USE Price %] +[% USE ColumnsSettings %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Item types [% IF op == 'add_form' %]› @@ -347,7 +348,7 @@ Item types administration [% IF itemtypes %] <table id="table_item_type"> <thead> - [% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %] + [% UNLESS Koha.Preference('noItemTypeImages') %]<th class="noExport">Image</th>[% END %] <th>Code</th> <th>Description</th> <th>Search category</th> @@ -359,7 +360,7 @@ Item types administration <th>Default replacement cost</th> <th>Processing fee (when lost)</th> <th>Checkin message</th> - <th>Actions</th> + <th class="noExport">Actions</th> </thead> [% FOREACH itemtype IN itemtypes %] <tr> @@ -437,17 +438,26 @@ Item types administration [% Asset.js("js/admin-menu.js") | $raw %] [% INCLUDE 'greybox.inc' %] [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] <script> $(document).ready(function() { $('#icons').tabs(); - $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, { - "aoColumnDefs": [ - { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, - ], + var columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'itemtypes', 'table_item_type', 'json' ) | $raw %]; + [% IF Koha.Preference('noItemTypeImages') %] + columns_settings.shift(); // Remove item type image column from configuration + [% END %] + + $(document).ready(function() { + KohaTable("table_item_type", { + "aoColumnDefs": [ + { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, + ], "aaSorting": [[ 2, "asc" ]], "iDisplayLength": 10, "sPaginationType": "full" - })); + }, columns_settings); + }); + $( "#itemtypeentry" ).validate({ rules: { itemtype: { required: true }, --