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 <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-10-17 12:32:34 +02:00 committed by Katrin Fischer
parent 80e37da75f
commit 2ee444c524
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 8 additions and 4 deletions

View File

@ -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: '<i class="fa fa-lg fa-copy"></i> <span class="dt-button-text">' + __("Copy shareable link") + '</span>',
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;