From 830470a48231a0bfc0256419ee1636315efd31dd 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 0001ca5d2ab..ad49f10be24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -678,6 +678,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 88af9c08d8e..c317d3cf5b7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -653,6 +653,7 @@ function LoadIssuesTable() { borrowernumber ), }, + bKohaAjaxSVC: true, rowGroup: { dataSrc: "issued_today", startRender: function (rows, group) { @@ -1325,6 +1326,7 @@ $(document).ready(function () { .join("&") ), }, + bKohaAjaxSVC: true, }, table_settings_relatives_issues_table ); @@ -1581,6 +1583,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 95c460aa2e5..6b8370b1fe7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -1252,7 +1252,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, @@ -1311,6 +1311,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 06b373be1fd..fda88ec7dd4 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -484,6 +484,7 @@ $(document).ready(function () { d.borrowernumber = borrowernumber; }, }, + bKohaAjaxSVC: true, }, table_settings_holds_table ); -- 2.34.1