Browse Source

Bug 23606: Add columns configuration and export options to item types administration

This patch adds column configuration to the table of item types
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 -> 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.

Test with noItemTypeImages on and off.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
remotes/origin/19.11.x
Owen Leonard 3 years ago
committed by Martin Renvoize
parent
commit
42f4249bf1
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 33
      admin/columns_settings.yml
  2. 24
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt

33
admin/columns_settings.yml

@ -157,6 +157,39 @@ 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: library_limitations
-
columnname: actions
cannot_be_toggled: 1
cannot_be_modified: 1
libraries:
libraries:
-

24
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' %]
<title>Koha &rsaquo; Administration &rsaquo; Item types [% IF op == 'add_form' %]&rsaquo;
@ -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>
@ -360,7 +361,7 @@ Item types administration
<th>Processing fee (when lost)</th>
<th>Checkin message</th>
<th>Library limitations</th>
<th>Actions</th>
<th class="noExport">Actions</th>
</thead>
[% FOREACH itemtype IN itemtypes %]
<tr>
@ -458,17 +459,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 },

Loading…
Cancel
Save