From 68faf0461df7c353ff1fa5656d5d1c5337c80b6c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 4 Dec 2024 11:59:55 +0100 Subject: [PATCH] Bug 38255: Exceptions Those tables are using a svc script, not the REST API. It is not compatible with kohaTable's default 'ajax' options. Signed-off-by: Lucas Gass --- .../intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 1 + koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 3 +++ koha-tmpl/intranet-tmpl/prog/js/datatables.js | 3 ++- koha-tmpl/intranet-tmpl/prog/js/holds.js | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index 544a9802920..e90af41e9a1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -657,6 +657,7 @@ }); } }, + bKohaAjaxSVC: true, 'columns':[ { "data": 'dt_public' }, { "data": 'dt_shelfname' }, diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 255571c0b76..6bb9f8cc17b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -436,6 +436,7 @@ function LoadIssuesTable() { ajax: { url: '/cgi-bin/koha/svc/checkouts?borrowernumber=%s'.format(borrowernumber), }, + bKohaAjaxSVC: true, "rowGroup":{ "dataSrc": "issued_today", "startRender": function ( rows, group ) { @@ -974,6 +975,7 @@ $(document).ready(function() { ajax: { url: '/cgi-bin/koha/svc/checkouts?%s'.format(relatives_borrowernumbers.map(b => 'borrowernumber=%s'.format(b)).join('&')), }, + bKohaAjaxSVC: true, }, table_settings_relatives_issues_table); } }); @@ -1170,6 +1172,7 @@ $(document).ready(function() { } } }, + bKohaAjaxSVC: true, "search": { "search": "is_unresolved" }, "footerCallback": function (row, data, start, end, display) { var api = this.api(); diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index b12f66f803d..4e54a2e88cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -1045,7 +1045,7 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){ }; } - if (options.ajax) { + if (options.ajax && !options.bKohaAjaxSVC) { options.ajax = Object.assign( {}, options.ajax, @@ -1085,6 +1085,7 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){ } $(this).data('bKohaColumnsUseNames', settings.bKohaColumnsUseNames); + $(this).data('bKohaAjaxSVC', settings.bKohaAjaxSVC); // Must not be used for new tables! var table = $(this).dataTable(settings); var table_dt = table.DataTable(); diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index de80f9fc699..fd728c04100 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -328,6 +328,7 @@ $(document).ready(function() { d.borrowernumber = borrowernumber; } }, + bKohaAjaxSVC: true, }, table_settings_holds_table ); $('#holds-table').on( 'draw.dt', function () { -- 2.34.1