From 698ce8adc635cf6e7420d21eb529efe1c51cd4d0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 16 Dec 2021 13:13:27 +0100 Subject: [PATCH] Bug 29648: ILL - no change No change expected here for ILL Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers --- .../prog/en/modules/ill/ill-requests.tt | 2 +- .../prog/en/modules/members/ill-requests.tt | 2 +- .../intranet-tmpl/prog/js/ill-availability.js | 80 ++++++++++--------- .../intranet-tmpl/prog/js/ill-list-table.js | 5 +- 4 files changed, 46 insertions(+), 43 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 1d93ea2541..fea00c097c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -838,7 +838,7 @@ [% INCLUDE 'ill-list-table-strings.inc' %] [% Asset.js("js/ill-list-table.js") | $raw %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js b/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js index fd9a5845b0..dfcef7e43b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-availability.js @@ -188,51 +188,53 @@ $(document).ready(function() { // Initialise the table // Since we're not able to use the columns settings in core, // we need to mock the object that it would return - var columns_settings = [ - { - cannot_be_modified: 0, - cannot_be_toggled: 0, - columnname: 'source', - is_hidden: 0 - }, - { - cannot_be_modified: 0, - cannot_be_toggled: 0, - columnname: 'title', - is_hidden: 0 - }, - { - cannot_be_modified: 0, - cannot_be_toggled: 0, - columnname: 'author', - is_hidden: 0 - }, - { - cannot_be_modified: 0, - cannot_be_toggled: 0, - columnname: 'isbn', - is_hidden: 0 - }, - { - cannot_be_modified: 0, - cannot_be_toggled: 0, - columnname: 'issn', - is_hidden: 0 - }, - { - cannot_be_modified: 0, - cannot_be_toggled: 0, - columnname: 'date', - is_hidden: 0 - } - ]; + var table_settings = { + "columns": [ + { + cannot_be_modified : 0, + cannot_be_toggled : 0, + columnname : 'source', + is_hidden : 0 + }, + { + cannot_be_modified : 0, + cannot_be_toggled : 0, + columnname : 'title', + is_hidden : 0 + }, + { + cannot_be_modified : 0, + cannot_be_toggled : 0, + columnname : 'author', + is_hidden : 0 + }, + { + cannot_be_modified : 0, + cannot_be_toggled : 0, + columnname : 'isbn', + is_hidden : 0 + }, + { + cannot_be_modified : 0, + cannot_be_toggled : 0, + columnname : 'issn', + is_hidden : 0 + }, + { + cannot_be_modified : 0, + cannot_be_toggled : 0, + columnname : 'date', + is_hidden : 0 + } + ] + }; // Hide pagination buttons if appropriate tableDef.drawCallback = function() { var pagination = $(this).closest('.dataTables_wrapper') .find('.dataTables_paginate'); pagination.toggle(this.api().page.info().pages > 1); } - KohaTable(service.id, tableDef, columns_settings); + KohaTable(service.id, tableDef, table_settings); }); } diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js index 920d6aed68..d6e92cc517 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js @@ -405,7 +405,8 @@ $(document).ready(function() { // Assemble an array of column definitions for passing // to datatables var colData = []; - columns_settings.forEach(function(thisCol) { + var columns = table_settings['columns']; + columns.forEach(function(thisCol) { var colName = thisCol.columnname; // Create the base column object var colObj = $.extend({}, thisCol); @@ -494,7 +495,7 @@ $(document).ready(function() { } } - }, columns_settings); + }, table_settings); // Custom date range filtering $.fn.dataTable.ext.search.push(function(settings, data, dataIndex) { -- 2.39.5