Browse Source

Bug 28055: Convert DataTables option names to current version

This patch makes changes the two global DataTables files in the staff
interface, replacing older 1.9.x option names with the current 1.10.x
version.

To test, apply the patch and confirm that default DataTables behaviors
continue to work correctly: Table information, "Show XX entries"
controls, pagination, search.

- Test tables which use the default DataTables configuration from
  datatables.js:
  - Administration -> Z39.50/SRU servers
  - Administration -> MARC frameworks -> MARC structure
- Test tables which use the DataTables configuration in
  columns_settings.inc, including column visibility and export controls.
  - Administration -> Libraries
  - Patrons -> Patron search results
  - Circulation -> Holds queue

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Owen Leonard 3 years ago
committed by Jonathan Druart
parent
commit
627897857c
  1. 12
      koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc
  2. 34
      koha-tmpl/intranet-tmpl/prog/js/datatables.js

12
koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc

@ -130,13 +130,13 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) {
var new_parameters = {}
$.extend(true, new_parameters, dataTablesDefaults, dt_parameters);
var default_column_defs = [
{ "aTargets": [ "title-string" ], "sType": "title-string" },
{ "aTargets": [ "string-sort" ], "sType": "string" },
{ "aTargets": [ "anti-the" ], "sType": "anti-the" },
{ "aTargets": [ "NoSort" ], "bSortable": false, "bSearchable": false },
{ "targets": [ "title-string" ], "type": "title-string" },
{ "targets": [ "string-sort" ], "type": "string" },
{ "targets": [ "anti-the" ], "type": "anti-the" },
{ "targets": [ "NoSort" ], "orderable": false, "searchable": false },
];
if ( new_parameters["aoColumnDefs"] === undefined ) {
new_parameters["aoColumnDefs"] = default_column_defs;
if ( new_parameters["columnDefs"] === undefined ) {
new_parameters["columnDefs"] = default_column_defs;
} else {
$.extend(true, new_parameters, default_column_defs);
}

34
koha-tmpl/intranet-tmpl/prog/js/datatables.js

@ -5,22 +5,22 @@
// // other settings
// } ) );
var dataTablesDefaults = {
"oLanguage": {
"oPaginate": {
"sFirst" : __('First'),
"sLast" : __('Last'),
"sNext" : __('Next'),
"sPrevious" : __('Previous'),
"language": {
"paginate": {
"first" : __('First'),
"last" : __('Last'),
"next" : __('Next'),
"previous" : __('Previous'),
},
"sEmptyTable" : __('No data available in table'),
"sInfo" : __('Showing _START_ to _END_ of _TOTAL_ entries'),
"sInfoEmpty" : __('No entries to show'),
"sInfoFiltered" : __('(filtered from _MAX_ total entries)'),
"sLengthMenu" : __('Show _MENU_ entries'),
"sLoadingRecords" : __('Loading...'),
"sProcessing" : __('Processing...'),
"sSearch" : __('Search:'),
"sZeroRecords" : __('No matching records found'),
"emptyTable" : __('No data available in table'),
"info" : __('Showing _START_ to _END_ of _TOTAL_ entries'),
"infoEmpty" : __('No entries to show'),
"infoFiltered" : __('(filtered from _MAX_ total entries)'),
"lengthMenu" : __('Show _MENU_ entries'),
"loadingRecords" : __('Loading...'),
"processing" : __('Processing...'),
"search" : __('Search:'),
"zeroRecords" : __('No matching records found'),
buttons: {
"copyTitle" : __('Copy to clipboard'),
"copyKeys" : __('Press <i>ctrl</i> or <i>⌘</i> + <i>C</i> to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape.'),
@ -48,8 +48,8 @@ var dataTablesDefaults = {
node.addClass("disabled");
}
}],
"aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, __('All')]],
"iDisplayLength": 20,
"lengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, __('All')]],
"pageLength": 20,
"fixedHeader": true,
initComplete: function( settings) {
var tableId = settings.nTable.id

Loading…
Cancel
Save