View | Details | Raw Unified | Return to bug 33484
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc (-3 / +7 lines)
Lines 39-45 function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { Link Here
39
39
40
            // Load state from URL
40
            // Load state from URL
41
            const url = new URL(window.location.href);
41
            const url = new URL(window.location.href);
42
            let state_from_url = url.searchParams.get( settings.nTable.id + '_state');
42
            let state_from_url = url.searchParams.get( table_key + '_state');
43
            if ( state_from_url ) {
43
            if ( state_from_url ) {
44
                settings.loaded_from_state = true;
44
                settings.loaded_from_state = true;
45
                return JSON.parse(atob(state_from_url));
45
                return JSON.parse(atob(state_from_url));
Lines 221-231 function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { Link Here
221
                titleAttr: __("Copy conditions"),
221
                titleAttr: __("Copy conditions"),
222
                text: '<i class="fa fa-lg fa-copy"></i> <span class="dt-button-text">' + __("Copy conditions") + '</span>',
222
                text: '<i class="fa fa-lg fa-copy"></i> <span class="dt-button-text">' + __("Copy conditions") + '</span>',
223
                action: function (e, dt, node, config) {
223
                action: function (e, dt, node, config) {
224
                    let table_key = 'DataTables_%s_%s_%s'.format(
225
                        table_settings.module,
226
                        table_settings.page,
227
                        table_settings.table);
228
224
                    let state = JSON.stringify(dt.state());
229
                    let state = JSON.stringify(dt.state());
225
                    delete state.time;
230
                    delete state.time;
226
                    let searchParams = new URLSearchParams(window.location.search);
231
                    let searchParams = new URLSearchParams(window.location.search);
227
                    let table_id = dt.table().node().id;
232
                    searchParams.set(table_key + '_state', btoa(state));
228
                    searchParams.set(table_id + '_state', btoa(state));
229
                    let url = window.location.origin + window.location.pathname + '?' + searchParams.toString() + window.location.hash;
233
                    let url = window.location.origin + window.location.pathname + '?' + searchParams.toString() + window.location.hash;
230
                    if( navigator.clipboard && navigator.clipboard.writeText){
234
                    if( navigator.clipboard && navigator.clipboard.writeText){
231
                        navigator.clipboard.writeText( url );
235
                        navigator.clipboard.writeText( url );
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-4 / +7 lines)
Lines 767-777 function _dt_buttons(params){ Link Here
767
                titleAttr: __("Copy conditions"),
767
                titleAttr: __("Copy conditions"),
768
                text: '<i class="fa fa-lg fa-copy"></i> <span class="dt-button-text">' + __("Copy conditions") + '</span>',
768
                text: '<i class="fa fa-lg fa-copy"></i> <span class="dt-button-text">' + __("Copy conditions") + '</span>',
769
                action: function (e, dt, node, config) {
769
                action: function (e, dt, node, config) {
770
                    let table_key = 'DataTables_%s_%s_%s'.format(
771
                        table_settings.module,
772
                        table_settings.page,
773
                        table_settings.table);
774
770
                    let state = JSON.stringify(dt.state());
775
                    let state = JSON.stringify(dt.state());
771
                    delete state.time;
776
                    delete state.time;
772
                    let searchParams = new URLSearchParams(window.location.search);
777
                    let searchParams = new URLSearchParams(window.location.search);
773
                    let table_id = dt.table().node().id;
778
                    searchParams.set(table_key + '_state', btoa(state));
774
                    searchParams.set(table_id + '_state', btoa(state));
775
                    let url = window.location.origin + window.location.pathname + '?' + searchParams.toString() + window.location.hash;
779
                    let url = window.location.origin + window.location.pathname + '?' + searchParams.toString() + window.location.hash;
776
                    if( navigator.clipboard && navigator.clipboard.writeText){
780
                    if( navigator.clipboard && navigator.clipboard.writeText){
777
                        navigator.clipboard.writeText( url );
781
                        navigator.clipboard.writeText( url );
Lines 983-989 function _dt_save_restore_state(table_settings){ Link Here
983
987
984
        // Load state from URL
988
        // Load state from URL
985
        const url = new URL(window.location.href);
989
        const url = new URL(window.location.href);
986
        let state_from_url = url.searchParams.get( settings.nTable.id + '_state');
990
        let state_from_url = url.searchParams.get( table_key + '_state');
987
        if ( state_from_url ) {
991
        if ( state_from_url ) {
988
            settings.loaded_from_state = true;
992
            settings.loaded_from_state = true;
989
            return JSON.parse(atob(state_from_url));
993
            return JSON.parse(atob(state_from_url));
990
- 

Return to bug 33484