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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc (-2 / +19 lines)
Lines 35-40 function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { Link Here
35
        exportColumns = dt_parameters["exportColumns"];
35
        exportColumns = dt_parameters["exportColumns"];
36
    }
36
    }
37
37
38
    const export_format_spreadsheet = {
39
        body: function ( data, row, column, node ) {
40
            var newnode = $(node);
41
42
            if ( newnode.find(".noExport").length > 0 ) {
43
                newnode = newnode.clone();
44
                newnode.find(".noExport").remove();
45
            }
46
            let trimmed_str = newnode.text().replace( /\n/g, ' ' ).trim();
47
            const unsafeCharacters = /^[=+\-@\t\r]/;
48
            if ( unsafeCharacters.test(trimmed_str) ){
49
                trimmed_str = "'" + trimmed_str;
50
            }
51
            return trimmed_str;
52
        }
53
    }
54
38
    var export_format = {
55
    var export_format = {
39
        body: function ( data, row, column, node ) {
56
        body: function ( data, row, column, node ) {
40
            var newnode = $(node);
57
            var newnode = $(node);
Lines 69-75 function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { Link Here
69
            exportOptions: {
86
            exportOptions: {
70
                columns: exportColumns,
87
                columns: exportColumns,
71
                rows: exportRows,
88
                rows: exportRows,
72
                format:  export_format
89
                format:  export_format_spreadsheet
73
            },
90
            },
74
        },
91
        },
75
        {
92
        {
Lines 100-106 function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { Link Here
100
                exportOptions: {
117
                exportOptions: {
101
                    columns: exportColumns,
118
                    columns: exportColumns,
102
                    rows: exportRows,
119
                    rows: exportRows,
103
                    format:  export_format
120
                    format:  export_format_spreadsheet
104
                },
121
                },
105
            }
122
            }
106
        );
123
        );
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-3 / +19 lines)
Lines 670-675 function _dt_buttons(params){ Link Here
670
        exportColumns = settings["exportColumns"];
670
        exportColumns = settings["exportColumns"];
671
    }
671
    }
672
672
673
    const export_format_spreadsheet = {
674
        body: function ( data, row, column, node ) {
675
            var newnode = $(node);
676
677
            if ( newnode.find(".noExport").length > 0 ) {
678
                newnode = newnode.clone();
679
                newnode.find(".noExport").remove();
680
            }
681
            let trimmed_str = newnode.text().replace( /\n/g, ' ' ).trim();
682
            const unsafeCharacters = /^[=+\-@\t\r]/;
683
            if ( unsafeCharacters.test(trimmed_str) ){
684
                trimmed_str = "'" + trimmed_str;
685
            }
686
            return trimmed_str;
687
        }
688
    }
689
673
    var export_format = {
690
    var export_format = {
674
        body: function ( data, row, column, node ) {
691
        body: function ( data, row, column, node ) {
675
            var newnode = $(node);
692
            var newnode = $(node);
Lines 688-701 function _dt_buttons(params){ Link Here
688
            extend: 'excelHtml5',
705
            extend: 'excelHtml5',
689
            exportOptions: {
706
            exportOptions: {
690
                columns: exportColumns,
707
                columns: exportColumns,
691
                format:  export_format
708
                format:  export_format_spreadsheet
692
            },
709
            },
693
        },
710
        },
694
        {
711
        {
695
            extend: 'csvHtml5',
712
            extend: 'csvHtml5',
696
            exportOptions: {
713
            exportOptions: {
697
                columns: exportColumns,
714
                columns: exportColumns,
698
                format:  export_format
715
                format:  export_format_spreadsheet
699
            },
716
            },
700
        },
717
        },
701
        {
718
        {
702
- 

Return to bug 37727