Bug 13749: On loading holds in patron account 'processing' is not translatable

This patch updates the DataTables configuration for two tables: The
checkouts and holds lists shown on the checkout and patron details
screen.

The tables lacked the standard application of a custom set of
defaults defined in js/datatables.js. It is in this file that custom
language strings are defined for DataTable interface elements, pulling
in the translated values from datatables.inc.

Without our custom defaults applied, DataTables used its own defaults,
which are not translated.

To test, apply the patch and check out to a patron who has both
checkouts and holds. The more the better to give you more time to
observer the loading state of the tables.

 - Checkouts: This table doesn't exhibit any visible problems because
   page-specific text is defined for the table's "Loading" message.
   However, it still makes sense to apply the defaults to the table for
   consistency's sake. There should be no visible changes to the table.

 - Holds: From the checkout or patron details page click the "Holds"
   tab. While the table loads there should be a "Processing" message. If
   you switch to another translation the message should appear in that
   language.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Owen Leonard 2019-10-08 17:11:17 +00:00 committed by Martin Renvoize
parent 342baeecbb
commit 9af572c796
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 4 additions and 4 deletions

View file

@ -648,7 +648,7 @@ $(document).ready(function() {
var relativesIssuesTable; var relativesIssuesTable;
$("#relatives-issues-tab").click( function() { $("#relatives-issues-tab").click( function() {
if ( ! relativesIssuesTable ) { if ( ! relativesIssuesTable ) {
relativesIssuesTable = $("#relatives-issues-table").dataTable({ relativesIssuesTable = $("#relatives-issues-table").dataTable($.extend(true, {}, dataTablesDefaults, {
"bAutoWidth": false, "bAutoWidth": false,
"sDom": "rt", "sDom": "rt",
"aaSorting": [], "aaSorting": [],
@ -808,7 +808,7 @@ $(document).ready(function() {
fnCallback(json) fnCallback(json)
} ); } );
}, },
}); }));
} }
}); });

View file

@ -10,7 +10,7 @@ $(document).ready(function() {
function load_holds_table() { function load_holds_table() {
var holds = new Array(); var holds = new Array();
if ( ! holdsTable ) { if ( ! holdsTable ) {
holdsTable = $("#holds-table").dataTable({ holdsTable = $("#holds-table").dataTable($.extend(true, {}, dataTablesDefaults, {
"bAutoWidth": false, "bAutoWidth": false,
"sDom": "rt", "sDom": "rt",
"columns": [ "columns": [
@ -183,7 +183,7 @@ $(document).ready(function() {
d.borrowernumber = borrowernumber; d.borrowernumber = borrowernumber;
} }
}, },
}); }));
$('#holds-table').on( 'draw.dt', function () { $('#holds-table').on( 'draw.dt', function () {
$(".hold-suspend").on( "click", function() { $(".hold-suspend").on( "click", function() {