From 2ee444c524fad48e38d1906d45e5d9271be94b3d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 17 Oct 2024 12:32:34 +0200 Subject: [PATCH] Bug 33484: Allow several tables using the same table settings - columns_settings In some cases (at least on the suggestions page) we display several pages using the same settings. In that case the key "DataTables_acqui_suggestions_suggestions" is not specific enough, we need to add the id of the table as well. This patch does not modify koha-tmpl/intranet-tmpl/prog/js/datatables.js / REST API wrapper as I don't think we have occurrences that need this. Signed-off-by: Pedro Amorim Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../prog/en/includes/columns_settings.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc index fdc3374569..30146653da 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc @@ -14,10 +14,12 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { let columns_settings = table_settings["columns"]; - let table_key = 'DataTables_%s_%s_%s'.format( + let table_key = 'DataTables_%s_%s_%s_%s'.format( table_settings.module, table_settings.page, - table_settings.table); + table_settings.table, + id_selector, + ); let default_save_state = table_settings.default_save_state; let default_save_state_search = table_settings.default_save_state_search; @@ -221,10 +223,12 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { titleAttr: __("Copy shareable link"), text: ' ' + __("Copy shareable link") + '', action: function (e, dt, node, config) { - let table_key = 'DataTables_%s_%s_%s'.format( + let table_key = 'DataTables_%s_%s_%s_%s'.format( table_settings.module, table_settings.page, - table_settings.table); + table_settings.table, + dt.settings()[0].nTable.id, + ); let state = JSON.stringify(dt.state()); delete state.time; -- 2.39.5