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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-7 / +8 lines)
Lines 1231-1247 Link Here
1231
        $(document).ready(function() {
1231
        $(document).ready(function() {
1232
            var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'basket', 'orders', 'json' ) | $raw %];
1232
            var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'basket', 'orders', 'json' ) | $raw %];
1233
            [% IF !(Koha.Preference('EDIFACT') && ediaccount) %]
1233
            [% IF !(Koha.Preference('EDIFACT') && ediaccount) %]
1234
                // FIXME This cannot work correctly without bKohaColumnsUseNames
1234
                table_settings['columns'].splice(18, 1);
1235
                table_settings['columns'].splice(18, 1);
1235
            [% END %]
1236
            [% END %]
1236
            KohaTable("orders", {
1237
            $("#orders").kohaTable({
1237
                "pagingType": "full",
1238
                pagingType: "full",
1238
                "autoWidth": false,
1239
                autoWidth: false,
1239
                "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18[% IF (Koha.Preference('EDIFACT') && ediaccount) %],19[% END %]],
1240
                exportColumns: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18[% IF (Koha.Preference('EDIFACT') && ediaccount) %],19[% END %]],
1240
            }, table_settings);
1241
            }, table_settings);
1241
1242
1242
            var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, {
1243
            $("#cancelledorderst").kohaTable({
1243
                "pagingType": "full"
1244
                pagingType: "full"
1244
            } ) );
1245
            });
1245
            $("#reopenform").on("submit",function(e){
1246
            $("#reopenform").on("submit",function(e){
1246
                var skip = [% IF ( skip_confirm_reopen ) %] 1 [% ELSE %] 0 [% END %];
1247
                var skip = [% IF ( skip_confirm_reopen ) %] 1 [% ELSE %] 0 [% END %];
1247
                var is_confirmed = skip || confirm(_("Are you sure you want to reopen this basket?"));
1248
                var is_confirmed = skip || confirm(_("Are you sure you want to reopen this basket?"));
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt (-27 / +25 lines)
Lines 423-456 Link Here
423
                $("#basket_groups a[href='#opened']").tab("show");
423
                $("#basket_groups a[href='#opened']").tab("show");
424
            [% END %]
424
            [% END %]
425
            [% UNLESS ( grouping ) %]
425
            [% UNLESS ( grouping ) %]
426
                $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
426
                let dt_params = {
427
                    "columnDefs": [
427
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
428
                        { "targets": [ -1 ], "orderable": false, "searchable":  false },
428
                    autoWidth: false,
429
                    ],
429
                    pagingType: "full",
430
                    "autoWidth": false,
430
                };
431
                    "pagingType": "full"
431
                $("#ungrouped").kohaTable(dt_params);
432
                } ));
432
                $("#grouped").kohaTable(dt_params);
433
                $("#basket_group_opened").kohaTable(dt_params);
434
                $("#basket_group_closed").kohaTable(dt_params);
433
            [% ELSE %]
435
            [% ELSE %]
434
                grouped = $("#grouped").DataTable($.extend(true, {}, dataTablesDefaults, {
436
                grouped = $("#grouped").kohaTable({
435
                    "dom": 't',
437
                    dom: "t",
436
                    "columnDefs": [
438
                    columnDefs: [{ sortable: false, targets: ["NoSort"] }],
437
                        { 'sortable': false, 'targets': [ 'NoSort' ] }
439
                    autoWidth: false,
438
                    ],
440
                    language: {
439
                    'autoWidth': false,
441
                        emptyTable: _("There are no baskets in this group"),
440
                    "language": {
442
                    },
441
                        "emptyTable": _("There are no baskets in this group")
443
                });
442
                    }
444
                ungrouped = $("#ungrouped").kohaTable({
443
                } ));
445
                    dom: "t",
444
                ungrouped = $("#ungrouped").DataTable($.extend(true, {}, dataTablesDefaults, {
446
                    columnDefs: [{ sortable: false, targets: ["NoSort"] }],
445
                    "dom": 't',
447
                    autoWidth: false,
446
                    "columnDefs": [
448
                    language: {
447
                        { 'sortable': false, 'targets': [ 'NoSort' ] }
449
                        emptyTable: _("There are no ungrouped baskets"),
448
                    ],
450
                    },
449
                    'autoWidth': false,
451
                });
450
                    "language": {
451
                        "emptyTable": _("There are no ungrouped baskets")
452
                    }
453
                } ));
454
            [% END %]
452
            [% END %]
455
453
456
            $("#basketgroupcolumns").on("click", ".addtogroup", function(){
454
            $("#basketgroupcolumns").on("click", ".addtogroup", function(){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt (-10 / +8 lines)
Lines 263-278 Link Here
263
    [% Asset.js("js/acq.js") | $raw %]
263
    [% Asset.js("js/acq.js") | $raw %]
264
    <script>
264
    <script>
265
        $(document).ready(function () {
265
        $(document).ready(function () {
266
            $("table.baskets").dataTable(
266
            $("table.baskets").kohaTable({
267
                $.extend(true, {}, dataTablesDefaults, {
267
                dom: "t",
268
                    dom: "t",
268
                paginate: false,
269
                    paginate: false,
269
                searching: false,
270
                    searching: false,
270
                info: false,
271
                    info: false,
271
                order: [[1, "asc"]],
272
                    order: [[1, "asc"]],
272
                columnDefs: [{ targets: [-1], orderable: false }],
273
                    columnDefs: [{ targets: [-1], orderable: false }],
273
            });
274
                })
275
            );
276
            $("#supplierlist").change(function () {
274
            $("#supplierlist").change(function () {
277
                var id = $(this).find("option:selected").val();
275
                var id = $(this).find("option:selected").val();
278
                window.location.href = "#vendor" + id;
276
                window.location.href = "#vendor" + id;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice-files.tt (-12 / +12 lines)
Lines 116-133 Link Here
116
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
116
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
117
    [% INCLUDE 'datatables.inc' %]
117
    [% INCLUDE 'datatables.inc' %]
118
    <script>
118
    <script>
119
        $(document).ready(function () {
119
        $(document).ready(function() {
120
            $("#invoice_files_details_table").dataTable(
120
            $("#invoice_files_details_table").kohaTable({
121
                $.extend(true, {}, dataTablesDefaults, {
121
                columnDefs: [
122
                    columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }],
122
                    { "targets": [ -1, -2 ], "orderable": false, "searchable":  false }
123
                    info: false,
123
                ],
124
                    paging: false,
124
                info: false,
125
                    searching: false,
125
                paging: false,
126
                    dom: "t",
126
                searching: false,
127
                })
127
                dom: "t"
128
            );
128
            }));
129
            $(".delete_file").click(function () {
129
            $(".delete_file").click(function(){
130
                return confirm(_("Are you sure you want to delete this file?"));
130
                return ( confirm( _("Are you sure you want to delete this file?") ) );
131
            });
131
            });
132
        });
132
        });
133
    </script>
133
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt (-15 / +13 lines)
Lines 560-581 Link Here
560
        }
560
        }
561
561
562
        $(document).ready(function() {
562
        $(document).ready(function() {
563
            $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
563
            $("#orderst").kohaTable({
564
                "info": false,
564
                info: false,
565
                "paging": false,
565
                paging: false,
566
                "searching": false,
566
                searching: false,
567
                "dom": "t",
567
                dom: "t",
568
                "columnDefs": [
568
                columnDefs: [{ type: "anti-the", targets: ["anti-the"] }],
569
                    { "type": "anti-the", "targets": [ "anti-the" ] }
569
            });
570
                ]
571
            }));
572
            [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
570
            [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
573
                $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, {
571
                $("#invoice_files_table").kohaTable({
574
                    "info": false,
572
                    info: false,
575
                    "paging": false,
573
                    paging: false,
576
                    "searching": false,
574
                    searching: false,
577
                    "dom": "t"
575
                    dom: "t",
578
                }));
576
                });
579
            [% END %]
577
            [% END %]
580
            $("#show_all_details").click(function(){
578
            $("#show_all_details").click(function(){
581
                updateColumnsVisibility( $(this).is(":checked") );
579
                updateColumnsVisibility( $(this).is(":checked") );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (-10 / +8 lines)
Lines 498-513 Link Here
498
                    });
498
                    });
499
            });
499
            });
500
500
501
            var resultst = $("table.result").dataTable(
501
            var resultst = $("table.result").kohaTable({
502
                $.extend(true, {}, dataTablesDefaults, {
502
                paging: false,
503
                    paging: false,
503
                columnDefs: [
504
                    columnDefs: [
504
                    { orderable: false, targets: [1, -1] },
505
                        { orderable: false, targets: [1, -1] },
505
                    { visible: false, targets: [0] },
506
                        { visible: false, targets: [0] },
506
                ],
507
                    ],
507
                autoWidth: false,
508
                    autoWidth: false,
508
            });
509
                })
510
            );
511
509
512
            $(".show_only_subscription").prop("checked", false);
510
            $(".show_only_subscription").prop("checked", false);
513
511
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt (-9 / +7 lines)
Lines 124-138 Link Here
124
        }
124
        }
125
125
126
        $(document).ready(function () {
126
        $(document).ready(function () {
127
            $("#srlt").dataTable(
127
            $("#srlt").kohaTable({
128
                $.extend(true, {}, dataTablesDefaults, {
128
                columnDefs: [
129
                    columnDefs: [
129
                    { orderable: false, searchable: false, targets: ["NoSort"] },
130
                        { orderable: false, searchable: false, targets: ["NoSort"] },
130
                    { type: "anti-the", targets: ["anti-the"] },
131
                        { type: "anti-the", targets: ["anti-the"] },
131
                ],
132
                    ],
132
                pagingType: "full",
133
                    pagingType: "full",
133
            });
134
                })
135
            );
136
134
137
            $("#show_only_renewed").click(function () {
135
            $("#show_only_renewed").click(function () {
138
                updateRowsVisibility($(this).is(":checked"));
136
                updateRowsVisibility($(this).is(":checked"));
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt (-6 / +6 lines)
Lines 118-130 Link Here
118
    [% INCLUDE 'calendar.inc' %]
118
    [% INCLUDE 'calendar.inc' %]
119
    <script>
119
    <script>
120
        $(document).ready(function() {
120
        $(document).ready(function() {
121
           var suggestionst = $("#suggestionst").dataTable($.extend(true, {}, dataTablesDefaults, {
121
           var suggestionst = $("#suggestionst").kohaTable({
122
               "columnDefs": [
122
               columnDefs: [
123
                   { "targets": [ 0 ],  "visible": false, "searchable":  true }, // must be searchable for filtering
123
                   { targets: [0], visible: false, searchable: true }, // must be searchable for filtering
124
                   { "targets": [ -1 ], "orderable": false, "searchable":  false },
124
                   { targets: [-1], orderable: false, searchable: false },
125
               ],
125
               ],
126
               "pagingType": "full"
126
               pagingType: "full",
127
           }));
127
           });
128
           let table_dt = suggestionst.DataTable();
128
           let table_dt = suggestionst.DataTable();
129
           $("#show_only_mine").on('click', function(e){
129
           $("#show_only_mine").on('click', function(e){
130
               e.preventDefault();
130
               e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt (-6 / +4 lines)
Lines 120-131 Link Here
120
    [% INCLUDE 'datatables.inc' %]
120
    [% INCLUDE 'datatables.inc' %]
121
    <script>
121
    <script>
122
        $(document).ready(function () {
122
        $(document).ready(function () {
123
            $("#spent").dataTable(
123
            $("#spent").kohaTable({
124
                $.extend(true, {}, dataTablesDefaults, {
124
                columnDefs: [{ type: "anti-the", targets: ["anti-the"] }],
125
                    columnDefs: [{ type: "anti-the", targets: ["anti-the"] }],
125
                pagingType: "full",
126
                    pagingType: "full",
126
            });
127
                })
128
            );
129
        });
127
        });
130
    </script>
128
    </script>
131
[% END %]
129
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-15 / +16 lines)
Lines 369-387 Link Here
369
            });
369
            });
370
370
371
            if ( $("#receivedt").length ) {
371
            if ( $("#receivedt").length ) {
372
                var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
372
                var receivedt = $("#receivedt").kohaTable({
373
                    "stateSave": true, // We do not have table settings on this table
373
                    stateSave: true, // We do not have table settings on this table
374
                    "pageLength": 10,
374
                    pageLength: 10,
375
                    "lengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]],
375
                    lengthMenu: [
376
                    "columnDefs": [
376
                        [5, 10, 20, 50, 100, -1],
377
                        { "targets": [ 5, -1 ], "orderable": false, "searchable":  false },
377
                        [5, 10, 20, 50, 100, _("All")],
378
                    ],
378
                    ],
379
                    "columns": [
379
                    columnDefs: [{ targets: [5, -1], orderable: false, searchable: false }],
380
                        { "type": "html" },
380
                    columns: [
381
                        { "type": "html" },
381
                        { type: "html" },
382
                        { "type": "html" },
382
                        { type: "html" },
383
                        { "type": "num-html" },
383
                        { type: "html" },
384
                        { "type": "anti-the" },
384
                        { type: "num-html" },
385
                        { type: "anti-the" },
386
                        null,
385
                        null,
387
                        null,
386
                        null,
388
                        null,
387
                        null,
389
                        null,
Lines 389-398 Link Here
389
                        null,
391
                        null,
390
                        null,
392
                        null,
391
                        null,
393
                        null,
392
                        null
393
                    ],
394
                    ],
394
                    "pagingType": "full"
395
                    pagingType: "full",
395
                }));
396
                });
396
            }
397
            }
397
398
398
            var options = {
399
            var options = {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt (-5 / +3 lines)
Lines 270-280 Link Here
270
    [% INCLUDE 'datatables.inc' %]
270
    [% INCLUDE 'datatables.inc' %]
271
    <script>
271
    <script>
272
        $(document).ready(function () {
272
        $(document).ready(function () {
273
            var parcelst = $("#parcelst").dataTable(
273
            $("#parcelst").kohaTable({
274
                $.extend(true, {}, dataTablesDefaults, {
274
                paginate: false,
275
                    paginate: false,
275
            });
276
                })
277
            );
278
276
279
            //keep a copy of all budgets before removing the inactives
277
            //keep a copy of all budgets before removing the inactives
280
            var budgetId = $("#shipmentcost_budgetid");
278
            var budgetId = $("#shipmentcost_budgetid");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt (-6 / +4 lines)
Lines 130-141 Link Here
130
    [% INCLUDE 'datatables.inc' %]
130
    [% INCLUDE 'datatables.inc' %]
131
    <script>
131
    <script>
132
        $(document).ready(function () {
132
        $(document).ready(function () {
133
            $("#spent").dataTable(
133
            $("#spent").kohaTable({
134
                $.extend(true, {}, dataTablesDefaults, {
134
                columnDefs: [{ type: "anti-the", targets: ["anti-the"] }],
135
                    columnDefs: [{ type: "anti-the", targets: ["anti-the"] }],
135
                pagingType: "full",
136
                    pagingType: "full",
136
            });
137
                })
138
            );
139
        });
137
        });
140
    </script>
138
    </script>
141
[% END %]
139
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt (-5 / +5 lines)
Lines 687-698 Link Here
687
        }
687
        }
688
688
689
         $(document).ready(function() {
689
         $(document).ready(function() {
690
            var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, {
690
            var contractst = $("#contractst").kohaTable({
691
                "columnDefs": [
691
                columnDefs: [
692
                    { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] }
692
                    { orderable: false, searchable:  false, targets: [ 'NoSort' ] }
693
                ],
693
                ],
694
                "dom": 't'
694
                dom: 't'
695
            } ) );
695
            } );
696
            $('body').on('click', '.delete-contact', null, delete_contact);
696
            $('body').on('click', '.delete-contact', null, delete_contact);
697
            $('#add-contact').click(add_contact);
697
            $('#add-contact').click(add_contact);
698
            $('body').on('click', '.contact_acqprimary', null, function () {
698
            $('body').on('click', '.contact_acqprimary', null, function () {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt (-6 / +4 lines)
Lines 191-202 Link Here
191
    [% INCLUDE 'datatables.inc' %]
191
    [% INCLUDE 'datatables.inc' %]
192
    <script>
192
    <script>
193
        $(document).ready(function () {
193
        $(document).ready(function () {
194
            var uncertainpricet = $("#uncertainpricet").dataTable(
194
            var uncertainpricet = $("#uncertainpricet").kohaTable({
195
                $.extend(true, {}, dataTablesDefaults, {
195
                columnDefs: [{ orderable: false, searchable: false, targets: ["NoSort"] }],
196
                    columnDefs: [{ orderable: false, searchable: false, targets: ["NoSort"] }],
196
                pagingType: "full",
197
                    pagingType: "full",
197
            });
198
                })
199
            );
200
            $(".check_uncertain").on("change", function () {
198
            $(".check_uncertain").on("change", function () {
201
                var form = document.getElementById("uncertainprices");
199
                var form = document.getElementById("uncertainprices");
202
                var ordernumber = $(this).data("ordernumber");
200
                var ordernumber = $(this).data("ordernumber");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt (-12 / +10 lines)
Lines 333-350 Link Here
333
    [% Asset.js("js/z3950_search.js") | $raw %]
333
    [% Asset.js("js/z3950_search.js") | $raw %]
334
    <script>
334
    <script>
335
        $(document).ready(function () {
335
        $(document).ready(function () {
336
            var resultst = $("#resultst").dataTable(
336
            var resultst = $("#resultst").kohaTable({
337
                $.extend(true, {}, dataTablesDefaults, {
337
                columnDefs: [
338
                    columnDefs: [
338
                    { targets: [-1, -2], orderable: false, searchable: false },
339
                        { targets: [-1, -2], orderable: false, searchable: false },
339
                    { targets: [1], type: "nsb-nse" },
340
                        { targets: [1], type: "nsb-nse" },
340
                ],
341
                    ],
341
                order: [[1, "asc"]],
342
                    order: [[1, "asc"]],
342
                paginate: false,
343
                    paginate: false,
343
                searching: false,
344
                    searching: false,
344
                info: false,
345
                    info: false,
345
            });
346
                })
347
            );
348
            InitLastAction();
346
            InitLastAction();
349
        });
347
        });
350
    </script>
348
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt (-13 / +11 lines)
Lines 308-326 Link Here
308
                $("#selecttable").submit();
308
                $("#selecttable").submit();
309
            });
309
            });
310
310
311
            $("#fieldst").dataTable(
311
            $("#fieldst").kohaTable({
312
                $.extend(true, {}, dataTablesDefaults, {
312
                autoWidth: false,
313
                    autoWidth: false,
313
                dom: 't<"bottom pager"ilpf>',
314
                    dom: 't<"bottom pager"ilpf>',
314
                pagingType: "full",
315
                    pagingType: "full",
315
                lengthMenu: [
316
                    lengthMenu: [
316
                    [10, 20, 50, 100, -1],
317
                        [10, 20, 50, 100, -1],
317
                    [10, 20, 50, 100, "All"],
318
                        [10, 20, 50, 100, "All"],
318
                ],
319
                    ],
319
                pageLength: 20,
320
                    pageLength: 20,
320
                order: [[0, "asc"]],
321
                    order: [[0, "asc"]],
321
            });
322
                })
323
            );
324
322
325
            $("#add_field").on("submit", function () {
323
            $("#add_field").on("submit", function () {
326
                if ($("#marcfield").length && $("select[name='authorised_value_category']").length) {
324
                if ($("#marcfield").length && $("select[name='authorised_value_category']").length) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt (-12 / +13 lines)
Lines 567-584 Link Here
567
                $("#budgetsTabs li:eq([% tab | html %]) a").tab("show");
567
                $("#budgetsTabs li:eq([% tab | html %]) a").tab("show");
568
            [% END %]
568
            [% END %]
569
569
570
            $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
570
            let dt_params = {
571
                "columnDefs": [
571
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
572
                    { "targets": [ -1 ], "orderable": false, "searchable":  false },
572
                pagingType: "full",
573
                ],
573
                autoWidth: false,
574
                "pagingType": "full",
574
            };
575
                "autoWidth": false
575
576
            } ) );
576
            $("#activeperiodst").kohaTable(dt_params);
577
            $("#inactiveperiodst").kohaTable(dt_params);
577
578
578
            [% IF close_form %]
579
            [% IF close_form %]
579
              $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
580
                $("#budgeth").kohaTable({
580
                "dom": "t"
581
                    dom: "t",
581
              }));
582
                });
582
              $("#move_form").submit(function(){
583
              $("#move_form").submit(function(){
583
                var budget_from = "[% budget_period_description | html %]";
584
                var budget_from = "[% budget_period_description | html %]";
584
                var budget_to = $("#to_budget_period_id").find("option:selected").html();
585
                var budget_to = $("#to_budget_period_id").find("option:selected").html();
Lines 588-594 Link Here
588
              });
589
              });
589
            [% END %]
590
            [% END %]
590
            [% IF closed %]
591
            [% IF closed %]
591
              var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
592
              var oTable = $("#closed_report").kohaTable({
592
                // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
593
                // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
593
                "drawCallback": function ( oSettings ) {
594
                "drawCallback": function ( oSettings ) {
594
                    if ( oSettings.aiDisplay.length == 0 )
595
                    if ( oSettings.aiDisplay.length == 0 )
Lines 624-630 Link Here
624
                "orderFixed": [[ 1, 'asc' ]],
625
                "orderFixed": [[ 1, 'asc' ]],
625
                "autoWidth": false,
626
                "autoWidth": false,
626
                "pagingType": "full_numbers"
627
                "pagingType": "full_numbers"
627
              }));
628
              });
628
            [% END %]
629
            [% END %]
629
            $("#add_modify_budget").validate({
630
            $("#add_modify_budget").validate({
630
                rules: {
631
                rules: {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt (-6 / +4 lines)
Lines 437-449 Link Here
437
    [% Asset.js("js/admin-menu.js") | $raw %]
437
    [% Asset.js("js/admin-menu.js") | $raw %]
438
    <script>
438
    <script>
439
        $(document).ready(function() {
439
        $(document).ready(function() {
440
            $("#table_authsubfieldstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
440
            $("#table_authsubfieldstructure").kohaTable({
441
                "columnDefs": [
441
                columnDefs: [{ sortable: false, targets: ["NoSort"] }],
442
                    { 'sortable': false, 'targets': [ 'NoSort' ] }
443
                ],
444
                aaSorting: [],
442
                aaSorting: [],
445
                paginate: false
443
                paginate: false,
446
            }));
444
            });
447
445
448
            if ($("#subfieldtabs").length > 0) {
446
            if ($("#subfieldtabs").length > 0) {
449
                [% IF ( tagsubfield && tagsubfield == "@") %]
447
                [% IF ( tagsubfield && tagsubfield == "@") %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt (-6 / +4 lines)
Lines 289-300 Link Here
289
    [% Asset.js("js/admin-menu.js") | $raw %]
289
    [% Asset.js("js/admin-menu.js") | $raw %]
290
    <script>
290
    <script>
291
        $(document).ready(function () {
291
        $(document).ready(function () {
292
            $("#table_authtagstructure").dataTable(
292
            $("#table_authtagstructure").kohaTable({
293
                $.extend(true, {}, dataTablesDefaults, {
293
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
294
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
294
                pagingType: "full",
295
                    pagingType: "full",
295
            });
296
                })
297
            );
298
        });
296
        });
299
    </script>
297
    </script>
300
[% END %]
298
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt (-20 / +21 lines)
Lines 135-188 Link Here
135
    [% Asset.js("js/admin-menu.js") | $raw %]
135
    [% Asset.js("js/admin-menu.js") | $raw %]
136
    [% INCLUDE 'datatables.inc' %]
136
    [% INCLUDE 'datatables.inc' %]
137
    <script>
137
    <script>
138
        $(document).ready(function () {
138
        $(document).ready(function(){
139
            $("#CheckAll").on("click", function (e) {
139
            $("#CheckAll").on("click", function(e){
140
                e.preventDefault();
140
                e.preventDefault();
141
                $(".cb").each(function () {
141
                $(".cb").each(function(){
142
                    $(this).prop("checked", true);
142
                    $(this).prop("checked", true);
143
                });
143
                });
144
            });
144
            });
145
145
146
            $("#UncheckAll").on("click", function (e) {
146
            $("#UncheckAll").on("click", function(e){
147
                e.preventDefault();
147
                e.preventDefault();
148
                $(".cb").each(function () {
148
                $(".cb").each(function(){
149
                    $(this).prop("checked", false);
149
                    $(this).prop("checked", false);
150
                });
150
                });
151
            });
151
            });
152
152
153
            if ($("#transferlimit_tabs .tab-pane.active").length < 1) {
153
            if( $("#transferlimit_tabs .tab-pane.active").length < 1 ){
154
                $("#transferlimit_tabs a:first").tab("show");
154
                  $("#transferlimit_tabs a:first").tab("show");
155
            }
155
            }
156
156
157
            $("#branchselect").change(function () {
157
             $('#branchselect').change(function() {
158
                $("#selectlibrary").submit();
158
                $('#selectlibrary').submit();
159
            });
159
             });
160
160
161
            var checkall = $(".checkall");
161
            var checkall = $(".checkall");
162
            var uncheckall = $(".uncheckall");
162
            var uncheckall = $(".uncheckall");
163
163
164
            $(checkall).on("click", function (e) {
164
            $(checkall).on("click", function(e){
165
                e.preventDefault();
165
                e.preventDefault();
166
                var tid = $(this).data("cb");
166
                var tid = $(this).data("cb");
167
                $(".cb" + tid).each(function () {
167
                $(".cb" + tid ).each(function(){
168
                    $(this).prop("checked", true);
168
                    $(this).prop("checked", true);
169
                });
169
                })
170
            });
170
            });
171
171
172
            $(uncheckall).on("click", function (e) {
172
            $(uncheckall).on("click", function(e){
173
                e.preventDefault();
173
                e.preventDefault();
174
                var tid = $(this).data("cb");
174
                var tid = $(this).data("cb");
175
                $(".cb" + tid).each(function () {
175
                $(".cb" + tid ).each(function(){
176
                    $(this).prop("checked", false);
176
                    $(this).prop("checked", false);
177
                });
177
                })
178
            });
178
            });
179
179
180
            $(".sorted").dataTable(
180
181
                $.extend(true, {}, dataTablesDefaults, {
181
            [% FOREACH codes_loo IN codes_loop %]
182
                $("#[% codes_loo.code | html %]table").kohaTable({
182
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
183
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
183
                    paginate: false,
184
                    paginate: false,
184
                })
185
                });
185
            );
186
            [% END %]
186
        });
187
        });
187
    </script>
188
    </script>
188
[% END %]
189
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt (-7 / +5 lines)
Lines 253-265 Link Here
253
        }
253
        }
254
254
255
        $(document).ready(function () {
255
        $(document).ready(function () {
256
            var crtable = $("#table_cash_registers").DataTable(
256
            var crtable = $("#table_cash_registers").kohaTable({
257
                $.extend(true, {}, dataTablesDefaults, {
257
                columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }],
258
                    columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }],
258
                order: [[1, "asc"]],
259
                    order: [[1, "asc"]],
259
                paginationType: "full",
260
                    paginationType: "full",
260
            });
261
                })
262
            );
263
261
264
            $("#branch_filter").on("change", function () {
262
            $("#branch_filter").on("change", function () {
265
                // Table must be filtered by the <option>'s text, not its value
263
                // Table must be filtered by the <option>'s text, not its value
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt (-15 / +13 lines)
Lines 241-261 Link Here
241
        $(document).ready(function () {
241
        $(document).ready(function () {
242
            var txtActivefilter = _("Filter system credit types");
242
            var txtActivefilter = _("Filter system credit types");
243
            var txtInactivefilter = _("Show all credit types");
243
            var txtInactivefilter = _("Show all credit types");
244
            var table_credit_types = $("#table_credit_types").dataTable(
244
            var table_credit_types = $("#table_credit_types").kohaTable({
245
                $.extend(true, {}, dataTablesDefaults, {
245
                columnDefs: [
246
                    columnDefs: [
246
                    { targets: [-1], orderable: false, searchable: false },
247
                        { targets: [-1], orderable: false, searchable: false },
247
                    { targets: [0, 1], orderable: false, visible: false },
248
                        { targets: [0, 1], orderable: false, visible: false },
248
                ],
249
                    ],
249
                order: [
250
                    order: [
250
                    [0, "asc"],
251
                        [0, "asc"],
251
                    [2, "asc"],
252
                        [2, "asc"],
252
                ],
253
                    ],
253
                dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>',
254
                    dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>',
254
                pageLength: 20,
255
                    pageLength: 20,
255
                pagingType: "full_numbers",
256
                    pagingType: "full_numbers",
256
            });
257
                })
258
            );
259
            $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> ' + txtActivefilter + "</a>");
257
            $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> ' + txtActivefilter + "</a>");
260
            $("#filter_system").click(function (e) {
258
            $("#filter_system").click(function (e) {
261
                e.preventDefault();
259
                e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt (-15 / +13 lines)
Lines 257-277 Link Here
257
        $(document).ready(function () {
257
        $(document).ready(function () {
258
            var txtActivefilter = _("Filter system debit types");
258
            var txtActivefilter = _("Filter system debit types");
259
            var txtInactivefilter = _("Show all debit types");
259
            var txtInactivefilter = _("Show all debit types");
260
            var table_debit_types = $("#table_debit_types").dataTable(
260
            var table_debit_types = $("#table_debit_types").kohaTable({
261
                $.extend(true, {}, dataTablesDefaults, {
261
                columnDefs: [
262
                    columnDefs: [
262
                    { targets: [-1], orderable: false, searchable: false },
263
                        { targets: [-1], orderable: false, searchable: false },
263
                    { targets: [0, 1], orderable: false, visible: false },
264
                        { targets: [0, 1], orderable: false, visible: false },
264
                ],
265
                    ],
265
                order: [
266
                    order: [
266
                    [0, "asc"],
267
                        [0, "asc"],
267
                    [2, "asc"],
268
                        [2, "asc"],
268
                ],
269
                    ],
269
                dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>',
270
                    dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>',
270
                pageLength: 20,
271
                    pageLength: 20,
271
                pagingType: "full_numbers",
272
                    pagingType: "full_numbers",
272
            });
273
                })
274
            );
275
            $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> ' + txtActivefilter + "</a>");
273
            $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> ' + txtActivefilter + "</a>");
276
            $("#filter_system").click(function (e) {
274
            $("#filter_system").click(function (e) {
277
                e.preventDefault();
275
                e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt (-6 / +4 lines)
Lines 108-119 Link Here
108
            }
108
            }
109
        }
109
        }
110
        $(document).ready(function () {
110
        $(document).ready(function () {
111
            $("#kohafields").dataTable(
111
            $("#kohafields").kohaTable({
112
                $.extend(true, {}, dataTablesDefaults, {
112
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
113
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
113
                paging: false,
114
                    paging: false,
114
            });
115
                })
116
            );
117
115
118
            $(".addfld").on("click", function (e) {
116
            $(".addfld").on("click", function (e) {
119
                e.preventDefault();
117
                e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt (-8 / +6 lines)
Lines 198-211 Link Here
198
        $(document).ready(function() {
198
        $(document).ready(function() {
199
            $(".dialog").hide();
199
            $(".dialog").hide();
200
200
201
            var table = $("#localization").DataTable($.extend(true, {}, dataTablesDefaults, {
201
            var table = $("#localization").kohaTable({
202
                "dom": 't',
202
                dom: "t",
203
                "columnDefs": [
203
                columnDefs: [{ sortable: false, targets: ["NoSort"] }],
204
                    { 'sortable': false, 'targets': [ 'NoSort' ] }
204
                paginate: false,
205
                ],
205
                autoWidth: false,
206
                "paginate": false,
206
            });
207
                'autoWidth': false,
208
            }));
209
207
210
            var languages_select = $('<select name="lang" id="lang"></select>');
208
            var languages_select = $('<select name="lang" id="lang"></select>');
211
            [% FOR language IN languages %]
209
            [% FOR language IN languages %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt (-2 / +2 lines)
Lines 393-399 Link Here
393
                    });
393
                    });
394
            }
394
            }
395
395
396
            $('#marc-overlay-rules').dataTable($.extend(true, {}, dataTablesDefaults, {
396
            $('#marc-overlay-rules').kohaTable({
397
                "columns": [
397
                "columns": [
398
                    {"searchable":  false, "orderable": false},
398
                    {"searchable":  false, "orderable": false},
399
                    {"orderDataType": "dom-input"},
399
                    {"orderDataType": "dom-input"},
Lines 408-414 Link Here
408
                    {"searchable":  false, "orderable": false}
408
                    {"searchable":  false, "orderable": false}
409
                ],
409
                ],
410
                "pagingType": "simple"
410
                "pagingType": "simple"
411
            }));
411
            });
412
412
413
            var overlay_rules_presets = {};
413
            var overlay_rules_presets = {};
414
            overlay_rules_presets["protect"] = {
414
            overlay_rules_presets["protect"] = {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt (-6 / +4 lines)
Lines 325-336 Link Here
325
    [% Asset.js("js/admin-menu.js") | $raw %]
325
    [% Asset.js("js/admin-menu.js") | $raw %]
326
    <script>
326
    <script>
327
        $(document).ready(function () {
327
        $(document).ready(function () {
328
            $("#table_marctagstructure").dataTable(
328
            $("#table_marctagstructure").kohaTable({
329
                $.extend(true, {}, dataTablesDefaults, {
329
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
330
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
330
                pagingType: "full",
331
                    pagingType: "full",
331
            });
332
                })
333
            );
334
            $("#select_display").on("change", function () {
332
            $("#select_display").on("change", function () {
335
                var checked = $(this).prop("checked") ? 1 : 0;
333
                var checked = $(this).prop("checked") ? 1 : 0;
336
                Cookies.set("marctagstructure_selectdisplay", checked, { sameSite: "Lax" });
334
                Cookies.set("marctagstructure_selectdisplay", checked, { sameSite: "Lax" });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_servers.tt (-6 / +4 lines)
Lines 212-223 Link Here
212
            });
212
            });
213
        [% ELSE %]
213
        [% ELSE %]
214
            $(document).ready(function() {
214
            $(document).ready(function() {
215
                $("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
215
                $("#serverst").kohaTable({
216
                    "columnDefs": [
216
                    columnDefs: [{ sortable: false, targets: ["NoSort"] }],
217
                        { 'sortable': false, 'targets': [ 'NoSort' ] }
217
                    pagingType: "full",
218
                    ],
218
                });
219
                    "pagingType": "full",
220
                }));
221
                $(".delete").on("click",function(e){
219
                $(".delete").on("click",function(e){
222
                    var servername = $(this).data("servername");
220
                    var servername = $(this).data("servername");
223
                    let formid = $(this).data("formid");
221
                    let formid = $(this).data("formid");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/overdrive.tt (-6 / +4 lines)
Lines 72-83 Link Here
72
    [% INCLUDE 'datatables.inc' %]
72
    [% INCLUDE 'datatables.inc' %]
73
    <script>
73
    <script>
74
        $(document).ready(function () {
74
        $(document).ready(function () {
75
            $("#od_info").dataTable(
75
            $("#od_info").kohaTable({
76
                $.extend(true, {}, dataTablesDefaults, {
76
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
77
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
77
                pagingType: "full",
78
                    pagingType: "full",
78
            });
79
                })
80
            );
81
        });
79
        });
82
    </script>
80
    </script>
83
[% END %]
81
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt (-7 / +7 lines)
Lines 495-507 Link Here
495
        [% INCLUDE 'datatables.inc' %]
495
        [% INCLUDE 'datatables.inc' %]
496
        <script>
496
        <script>
497
            $(document).ready(function() {
497
            $(document).ready(function() {
498
               [% IF ( loop ) %]$("#sysprefst").dataTable($.extend(true, {}, dataTablesDefaults, {
498
               [% IF ( loop ) %]
499
                   "dom": '<"top pager"ilf>t',
499
                   $("#sysprefst").kohaTable({
500
                   "columnDefs": [
500
                       dom: '<"top pager"ilf>t',
501
                       { "targets": [ -1, -2, -3 ], "orderable": false }
501
                       columnDefs: [{ targets: [-1, -2, -3], orderable: false }],
502
                   ],
502
                       paginate: false,
503
                   "paginate": false
503
                   });
504
               }));[% END %]
504
               [% END %]
505
            });
505
            });
506
        </script>
506
        </script>
507
    [% END %]
507
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt (-6 / +4 lines)
Lines 318-329 Link Here
318
            }
318
            }
319
        [% ELSE %]
319
        [% ELSE %]
320
            $(document).ready(function() {
320
            $(document).ready(function() {
321
                $("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
321
                $("#serverst").kohaTable({
322
                    "columnDefs": [
322
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
323
                        { "targets": [-1], "orderable": false, "searchable":  false },
323
                    pagingType: "full",
324
                    ],
324
                });
325
                    "pagingType": "full"
326
                }));
327
                $(".delete").on("click",function(e){
325
                $(".delete").on("click",function(e){
328
                    var servername = $(this).data("servername");
326
                    var servername = $(this).data("servername");
329
                    let formid = $(this).data("formid");
327
                    let formid = $(this).data("formid");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-6 / +6 lines)
Lines 2081-2093 Link Here
2081
            [% END %]
2081
            [% END %]
2082
2082
2083
            [% IF suggestions.count %]
2083
            [% IF suggestions.count %]
2084
                $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
2084
                $("#suggestions").kohaTable({
2085
                    "columnDefs": [
2085
                    columnDefs: [
2086
                        { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] },
2086
                        { orderable: false, searchable: false, targets: ["NoSort"] },
2087
                        { "type": "anti-the", "targets":  [ "anti-the" ] }
2087
                        { type: "anti-the", targets: ["anti-the"] },
2088
                    ],
2088
                    ],
2089
                    "pagingType": "full"
2089
                    pagingType: "full",
2090
                }));
2090
                });
2091
            [% END %]
2091
            [% END %]
2092
2092
2093
            [% IF ( reviews ) %]
2093
            [% IF ( reviews ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt (-9 / +7 lines)
Lines 222-234 Link Here
222
        $(document).ready(function () {
222
        $(document).ready(function () {
223
            // We show table ordered by descending dates by default
223
            // We show table ordered by descending dates by default
224
            // (so that the more recent query is shown first)
224
            // (so that the more recent query is shown first)
225
            $(".historyt").dataTable(
225
            $(".historyt").kohaTable({
226
                $.extend(true, {}, dataTablesDefaults, {
226
                order: [[1, "desc"]],
227
                    order: [[1, "desc"]],
227
                columnDefs: [{ targets: [0], orderable: false, searchable: false }],
228
                    columnDefs: [{ targets: [0], orderable: false, searchable: false }],
228
                pagingType: "full_numbers",
229
                    pagingType: "full_numbers",
229
            });
230
                })
231
            );
232
230
233
            // DataTables removes hidden rows from the DOM, so we can't expect a
231
            // DataTables removes hidden rows from the DOM, so we can't expect a
234
            // "regular" submit to work and we need to build another form containing
232
            // "regular" submit to work and we need to build another form containing
Lines 237-243 Link Here
237
                e.preventDefault();
235
                e.preventDefault();
238
236
239
                var form = $(this);
237
                var form = $(this);
240
                var table = form.find("table").dataTable();
238
                var table = form.find("table").kohaTable();
241
239
242
                var new_form = $("<form>").attr("action", form.attr("action")).attr("method", form.attr("method"));
240
                var new_form = $("<form>").attr("action", form.attr("action")).attr("method", form.attr("method"));
243
                form.find('input[type="hidden"]')
241
                form.find('input[type="hidden"]')
Lines 275-281 Link Here
275
            $(".action_delete").click(function (e) {
273
            $(".action_delete").click(function (e) {
276
                e.preventDefault();
274
                e.preventDefault();
277
                var form = $(this).parents("form").first();
275
                var form = $(this).parents("form").first();
278
                var table = form.find("table").dataTable();
276
                var table = form.find("table").kohaTable();
279
                var ids = $("input:checkbox:checked", table);
277
                var ids = $("input:checkbox:checked", table);
280
                if ($(ids).length < 1) {
278
                if ($(ids).length < 1) {
281
                    return false;
279
                    return false;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt (-8 / +6 lines)
Lines 265-278 Link Here
265
    [% Asset.js("js/z3950_search.js") | $raw %]
265
    [% Asset.js("js/z3950_search.js") | $raw %]
266
    <script>
266
    <script>
267
        $(document).ready(function () {
267
        $(document).ready(function () {
268
            $("#resultst").dataTable(
268
            $("#resultst").kohaTable({
269
                $.extend(true, {}, dataTablesDefaults, {
269
                dom: "t",
270
                    dom: "t",
270
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
271
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
271
                order: [[1, "asc"]],
272
                    order: [[1, "asc"]],
272
                paginate: false,
273
                    paginate: false,
273
            });
274
                })
275
            );
276
            InitLastAction();
274
            InitLastAction();
277
        });
275
        });
278
    </script>
276
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt (-16 / +9 lines)
Lines 574-595 Link Here
574
                if( link.length > 0 ) link[0].focus();
574
                if( link.length > 0 ) link[0].focus();
575
            });
575
            });
576
576
577
            requested_datatable = $("#article-requests-requested-table").DataTable($.extend(true, {}, dataTablesDefaults, {
577
            requested_datatable = $("#article-requests-requested-table").kohaTable({
578
                "columnDefs": [
578
                columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }],
579
                    { "targets": [0, -1], "orderable": false, "searchable":  false },
579
            });
580
                ],
580
            pending_datatable = $("#article-requests-pending-table").kohaTable({
581
            }));
581
                columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }],
582
582
            });
583
            pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, {
583
            processing_datatable = $("#article-requests-processing-table").kohaTable({
584
                "columnDefs": [
584
                columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }],
585
                    { "targets": [0, -1], "orderable": false, "searchable":  false },
585
            });
586
                ],
587
            }));
588
            processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, {
589
                "columnDefs": [
590
                    { "targets": [0, -1], "orderable": false, "searchable":  false },
591
                ],
592
            }));
593
            active_datatable = requested_datatable;
586
            active_datatable = requested_datatable;
594
            activateBatchActions( active_tab );
587
            activateBatchActions( active_tab );
595
        });
588
        });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt (-10 / +8 lines)
Lines 120-135 Link Here
120
    [% INCLUDE 'datatables.inc' %]
120
    [% INCLUDE 'datatables.inc' %]
121
    <script>
121
    <script>
122
        $(document).ready(function () {
122
        $(document).ready(function () {
123
            $("#notestable").dataTable(
123
            $("#notestable").kohaTable({
124
                $.extend(true, {}, dataTablesDefaults, {
124
                order: [[1, "asc"]],
125
                    order: [[1, "asc"]],
125
                columnDefs: [
126
                    columnDefs: [
126
                    { orderable: false, searchable: false, targets: ["NoSort"] },
127
                        { orderable: false, searchable: false, targets: ["NoSort"] },
127
                    { type: "anti-the", targets: ["anti-the"] },
128
                        { type: "anti-the", targets: ["anti-the"] },
128
                ],
129
                    ],
129
                pagingType: "full",
130
                    pagingType: "full",
130
            });
131
                })
132
            );
133
131
134
            $(".SelectAll").on("click", function () {
132
            $(".SelectAll").on("click", function () {
135
                $("input[name='issue_ids'][type='checkbox']").prop("checked", true);
133
                $("input[name='issue_ids'][type='checkbox']").prop("checked", true);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt (-8 / +8 lines)
Lines 359-373 Link Here
359
            } else if ($('#checkoutrenew').length) {
359
            } else if ($('#checkoutrenew').length) {
360
                $('#checkoutrenew').focus();
360
                $('#checkoutrenew').focus();
361
            }
361
            }
362
            $("#checkout_infos").dataTable($.extend(true, {}, dataTablesDefaults, {
362
            $("#checkout_infos").kohaTable({
363
                "dom": 't',
363
                dom: "t",
364
                "order": [],
364
                order: [],
365
                "columnDefs": [
365
                columnDefs: [
366
                    { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] },
366
                    { orderable: false, searchable: false, targets: ["NoSort"] },
367
                    { "type": "anti-the", "targets":  [ "anti-the" ] }
367
                    { type: "anti-the", targets: ["anti-the"] },
368
                ],
368
                ],
369
                "paginate": false
369
                paginate: false,
370
            }));
370
            });
371
        });
371
        });
372
        // On-site batch checkout
372
        // On-site batch checkout
373
        function toggle_onsite_checkout(){
373
        function toggle_onsite_checkout(){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/on-site_checkouts.tt (-1 / +1 lines)
Lines 80-86 Link Here
80
    <script>
80
    <script>
81
        $(document).ready(function () {
81
        $(document).ready(function () {
82
            if ($("#pending_onsite_checkout").length) {
82
            if ($("#pending_onsite_checkout").length) {
83
                $("#pending_onsite_checkout").dataTable($.extend(true, {}, dataTablesDefaults));
83
                $("#pending_onsite_checkout").kohaTable();
84
            }
84
            }
85
        });
85
        });
86
    </script>
86
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-6 / +9 lines)
Lines 1706-1717 Link Here
1706
                });
1706
                });
1707
            });
1707
            });
1708
1708
1709
            $('#items-bundle-contents-table').dataTable($.extend(true, {}, dataTablesDefaults, {
1709
            $("#items-bundle-contents-table").kohaTable({
1710
                "searching": false,
1710
                searching: false,
1711
                "paginate": false,
1711
                paginate: false,
1712
                "info": false,
1712
                info: false,
1713
                "order": [[ 1, 'asc' ], [ 0, 'asc' ]]
1713
                order: [
1714
            }));
1714
                    [1, "asc"],
1715
                    [0, "asc"],
1716
                ],
1717
            });
1715
1718
1716
            [% IF ( !(Koha.Preference('TransfersBlockCirc')) && Koha.Preference('AutomaticConfirmTransfer') ) %]
1719
            [% IF ( !(Koha.Preference('TransfersBlockCirc')) && Koha.Preference('AutomaticConfirmTransfer') ) %]
1717
                $("#wrong-transfer-modal").on('hidden.bs.modal',function(){
1720
                $("#wrong-transfer-modal").on('hidden.bs.modal',function(){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transfers_to_send.tt (-8 / +8 lines)
Lines 99-112 Link Here
99
    <script>
99
    <script>
100
        $(document).ready(function() {
100
        $(document).ready(function() {
101
            [% FOREACH library IN libraries %]
101
            [% FOREACH library IN libraries %]
102
            $("#transferst[% library.branchcode | html %]").dataTable($.extend(true, {}, dataTablesDefaults, {
102
                $("#transferst[% library.branchcode | html %]").kohaTable({
103
                "columnDefs": [
103
                    columnDefs: [
104
                    { "targets": [ -1 ], "orderable": false, "searchable":  false },
104
                        { targets: [-1], orderable: false, searchable: false },
105
                    { "type": "anti-the", "targets":  [ "anti-the" ] }
105
                        { type: "anti-the", targets: ["anti-the"] },
106
                ],
106
                    ],
107
                "dom": 't',
107
                    dom: "t",
108
                "paginate": false
108
                    paginate: false,
109
            }));
109
                });
110
            [% END %]
110
            [% END %]
111
        });
111
        });
112
    </script>
112
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt (-8 / +8 lines)
Lines 114-127 Link Here
114
    <script>
114
    <script>
115
        $(document).ready(function() {
115
        $(document).ready(function() {
116
            [% FOREACH branchesloo IN branchesloop %]
116
            [% FOREACH branchesloo IN branchesloop %]
117
            $("#transferst[% branchesloo.branchcode | html %]").dataTable($.extend(true, {}, dataTablesDefaults, {
117
                $("#transferst[% branchesloo.branchcode | html %]").kohaTable({
118
                "columnDefs": [
118
                    columnDefs: [
119
                    { "targets": [ -1 ], "orderable": false, "searchable":  false },
119
                        { targets: [-1], orderable: false, searchable: false },
120
                    { "type": "anti-the", "targets":  [ "anti-the" ] }
120
                        { type: "anti-the", targets: ["anti-the"] },
121
                ],
121
                    ],
122
                "dom": 't',
122
                    dom: "t",
123
                "paginate": false
123
                    paginate: false,
124
            }));
124
                });
125
            [% END %]
125
            [% END %]
126
        });
126
        });
127
    </script>
127
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt (-7 / +5 lines)
Lines 93-105 Link Here
93
    [% Asset.js("js/tools-menu.js") | $raw %]
93
    [% Asset.js("js/tools-menu.js") | $raw %]
94
    <script>
94
    <script>
95
        $(document).ready(function () {
95
        $(document).ready(function () {
96
            eTable = $("#enrollments-table").dataTable(
96
            eTable = $("#enrollments-table").kohaTable({
97
                $.extend(true, {}, dataTablesDefaults, {
97
                pagingType: "full",
98
                    pagingType: "full",
98
                dom: 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
99
                    dom: 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
99
                columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }],
100
                    columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }],
100
            });
101
                })
102
            );
103
        });
101
        });
104
    </script>
102
    </script>
105
[% END %]
103
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt (-15 / +11 lines)
Lines 148-168 Link Here
148
    [% Asset.js("js/tools-menu.js") | $raw %]
148
    [% Asset.js("js/tools-menu.js") | $raw %]
149
    <script>
149
    <script>
150
        $(document).ready(function () {
150
        $(document).ready(function () {
151
            tTable = $("#club-templates-table").dataTable(
151
            tTable = $("#club-templates-table").kohaTable({
152
                $.extend(true, {}, dataTablesDefaults, {
152
                pagingType: "full",
153
                    pagingType: "full",
153
                dom: 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
154
                    dom: 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
154
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
155
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
155
            });
156
                })
156
157
            );
157
            cTable = $("#clubs-table").kohaTable({
158
158
                pagingType: "full",
159
            cTable = $("#clubs-table").dataTable(
159
                dom: 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
160
                $.extend(true, {}, dataTablesDefaults, {
160
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
161
                    pagingType: "full",
161
            });
162
                    dom: 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
163
                    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
164
                })
165
            );
166
162
167
            $("body").on("click", ".delete_club", function (e) {
163
            $("body").on("click", ".delete_club", function (e) {
168
                e.preventDefault();
164
                e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt (-6 / +6 lines)
Lines 59-70 Link Here
59
    </table>
59
    </table>
60
[% END %]
60
[% END %]
61
<script>
61
<script>
62
    $("#table_clubnoenrollmemnts, #table_clubenrollments").dataTable($.extend(true, {}, dataTablesDefaults, {
62
    let dt_params = {
63
        "columnDefs": [
63
        columnDefs: [{ sortable: false, targets: ["NoSort"] }],
64
            { 'sortable': false, 'targets': [ 'NoSort' ] }
64
        paginate: true,
65
        ],
65
    };
66
        paginate: true
66
    $("#table_clubnoenrollmemnts").kohaTable(dt_params);
67
    }));
67
    $("#table_clubenrollments").kohaTable(dt_params);
68
68
69
    [% IF CAN_user_clubs_enroll %]
69
    [% IF CAN_user_clubs_enroll %]
70
    function loadEnrollmentForm( id, enrollent_id = 0 ) {
70
    function loadEnrollmentForm( id, enrollent_id = 0 ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt (-8 / +8 lines)
Lines 345-359 Link Here
345
            [% ELSE %]
345
            [% ELSE %]
346
                $("#description").hide();
346
                $("#description").hide();
347
            [% END %]
347
            [% END %]
348
            $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
348
            $("#batcht").kohaTable({
349
                "autoWidth": false,
349
                autoWidth: false,
350
                "columnDefs": [
350
                columnDefs: [
351
                    { "type": "anti-the", "targets":  [ "anti-the" ] },
351
                    { type: "anti-the", targets: ["anti-the"] },
352
                    { "targets": [ -1, -2 ], "orderable": false, "searchable":  false },
352
                    { targets: [-1, -2], orderable: false, searchable: false },
353
                ],
353
                ],
354
                "order": [[ 0, "asc" ]],
354
                order: [[0, "asc"]],
355
                "pagingType": "full"
355
                pagingType: "full",
356
            }));
356
            });
357
            $("#additems").click(function(){
357
            $("#additems").click(function(){
358
                Add();
358
                Add();
359
                return false;
359
                return false;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt (-7 / +5 lines)
Lines 216-228 Link Here
216
            $(".delete").on("click", function(){
216
            $(".delete").on("click", function(){
217
                return confirmDelete( _("Are you sure you want to delete this?") );
217
                return confirmDelete( _("Are you sure you want to delete this?") );
218
            });
218
            });
219
            $("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, {
219
            $("#labels-table").kohaTable({
220
                "pagingType": "full",
220
                pagingType: "full",
221
                "order": [[ 1, "asc" ]],
221
                order: [[1, "asc"]],
222
                "columnDefs": [
222
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
223
                    { "targets": [ -1 ], "orderable": false, "searchable":  false },
223
            });
224
                ]
225
            }));
226
        });
224
        });
227
    </script>
225
    </script>
228
[% END %]
226
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/alert-subscriptions.tt (-1 / +1 lines)
Lines 94-100 Link Here
94
    [% INCLUDE 'datatables.inc' %]
94
    [% INCLUDE 'datatables.inc' %]
95
    <script>
95
    <script>
96
        $(document).ready(function () {
96
        $(document).ready(function () {
97
            $("#subscriptions").dataTable($.extend(true, {}, dataTablesDefaults, {}));
97
            $("#subscriptions").kohaTable();
98
            $(".unsubscribe").submit(function () {
98
            $(".unsubscribe").submit(function () {
99
                var patron = $(this).data("patron");
99
                var patron = $(this).data("patron");
100
                var title = $(this).data("title");
100
                var title = $(this).data("title");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt (-10 / +10 lines)
Lines 71-86 Link Here
71
71
72
    [% INCLUDE 'datatables.inc' %]
72
    [% INCLUDE 'datatables.inc' %]
73
    <script>
73
    <script>
74
        $(document).ready(function () {
74
        $(document).ready(function() {
75
            $("#pending_updates table").DataTable(
75
            $('#pending_updates table').kohaTable({
76
                $.extend(true, {}, dataTablesDefaults, {
76
                paging: false,
77
                    paging: false,
77
                info: true,
78
                    info: true,
78
                searching: true,
79
                    searching: true,
79
                order: [[2, "asc"]],
80
                    order: [[2, "asc"]],
80
                columnDefs: [
81
                    columnDefs: [{ targets: -1, orderable: false }],
81
                    { targets: -1, orderable: false }
82
                })
82
                ],
83
            );
83
            ));
84
        });
84
        });
85
    </script>
85
    </script>
86
[% END %]
86
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt (-6 / +4 lines)
Lines 182-193 Link Here
182
    [% INCLUDE 'datatables.inc' %]
182
    [% INCLUDE 'datatables.inc' %]
183
    <script>
183
    <script>
184
        $(document).ready(function () {
184
        $(document).ready(function () {
185
            $("#noticestable").dataTable(
185
            $("#noticestable").kohaTable({
186
                $.extend(true, {}, dataTablesDefaults, {
186
                order: [[3, "desc"]],
187
                    order: [[3, "desc"]],
187
                pagingType: "full",
188
                    pagingType: "full",
188
            });
189
                })
190
            );
191
189
192
            $("#noticestable").on("click", ".notice-title", function (e) {
190
            $("#noticestable").on("click", ".notice-title", function (e) {
193
                e.preventDefault();
191
                e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt (-8 / +6 lines)
Lines 135-148 Link Here
135
    [% INCLUDE 'datatables.inc' %]
135
    [% INCLUDE 'datatables.inc' %]
136
    <script>
136
    <script>
137
        $(document).ready(function () {
137
        $(document).ready(function () {
138
            $("#suggestions").dataTable(
138
            $("#suggestions").kohaTable({
139
                $.extend(true, {}, dataTablesDefaults, {
139
                paginate: false,
140
                    paginate: false,
140
                searching: false,
141
                    searching: false,
141
                info: false,
142
                    info: false,
142
                dom: "t",
143
                    dom: "t",
143
            });
144
                })
145
            );
146
        });
144
        });
147
    </script>
145
    </script>
148
[% END %]
146
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt (-6 / +4 lines)
Lines 104-115 Link Here
104
    [% INCLUDE 'datatables.inc' %]
104
    [% INCLUDE 'datatables.inc' %]
105
    <script>
105
    <script>
106
        $(document).ready(function () {
106
        $(document).ready(function () {
107
            $("#statistics").dataTable(
107
            $("#statistics").kohaTable({
108
                $.extend(true, {}, dataTablesDefaults, {
108
                dom: "t",
109
                    dom: "t",
109
                paginate: false,
110
                    paginate: false,
110
            });
111
                })
112
            );
113
        });
111
        });
114
    </script>
112
    </script>
115
[% END %]
113
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt (-8 / +6 lines)
Lines 65-78 Link Here
65
    [% INCLUDE 'datatables.inc' %]
65
    [% INCLUDE 'datatables.inc' %]
66
    <script>
66
    <script>
67
        $(document).ready(function () {
67
        $(document).ready(function () {
68
            $("#catst").dataTable(
68
            $("#catst").kohaTable({
69
                $.extend(true, {}, dataTablesDefaults, {
69
                dom: "t",
70
                    dom: "t",
70
                order: [[2, "asc"]],
71
                    order: [[2, "asc"]],
71
                columnDefs: [{ targets: [0], orderable: false, searchable: false }],
72
                    columnDefs: [{ targets: [0], orderable: false, searchable: false }],
72
                paginate: false,
73
                    paginate: false,
73
            });
74
                })
75
            );
76
            $("#updatechildf").validate({
74
            $("#updatechildf").validate({
77
                rules: {
75
                rules: {
78
                    catcode: {
76
                    catcode: {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt (-7 / +5 lines)
Lines 148-160 Link Here
148
148
149
            let selectedPatronLists = new Array();
149
            let selectedPatronLists = new Array();
150
150
151
            $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, {
151
            $("#patron-lists-table").kohaTable({
152
                "autoWidth": false,
152
                autoWidth: false,
153
                "columnDefs": [
153
                columnDefs: [{ orderable: false, searchable: false, targets: ["NoSort"] }],
154
                    { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] }
154
                pagingType: "full",
155
                ],
155
            });
156
                "pagingType": "full"
157
            } ));
158
            $(".delete_patron").on("click", function(){
156
            $(".delete_patron").on("click", function(){
159
                $(".dropdown").removeClass("open");
157
                $(".dropdown").removeClass("open");
160
                var list = $(this).data("list-name");
158
                var list = $(this).data("list-name");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt (-6 / +6 lines)
Lines 111-122 Link Here
111
    </div>
111
    </div>
112
[% END %]
112
[% END %]
113
<script>
113
<script>
114
    $("#table_listnopatron, #table_inlists").dataTable($.extend(true, {}, dataTablesDefaults, {
114
    let dt_params = {
115
        "columnDefs": [
115
        columnDefs: [{ sortable: false, bSearchable: false, targets: ["NoSort"] }],
116
            { 'sortable': false, "bSearchable": false, 'targets': [ 'NoSort' ] }
116
        sPaginationType: "full",
117
        ],
117
    };
118
        "sPaginationType": "full"
118
    $("#table_listnopatron").kohaTable(dt_params);
119
    }));
119
    $("#table_inlists").kohaTable(dt_params);
120
120
121
    [% IF CAN_user_tools_manage_patron_lists %]
121
    [% IF CAN_user_tools_manage_patron_lists %]
122
        function addToList() {
122
        function addToList() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt (-10 / +8 lines)
Lines 308-323 Link Here
308
            [% ELSE %]
308
            [% ELSE %]
309
                $("#description").hide();
309
                $("#description").hide();
310
            [% END %]
310
            [% END %]
311
            $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
311
            $("#batcht").kohaTable({
312
                "columnDefs": [
312
                columnDefs: [{ targets: [-2, -1], orderable: false, searchable: false }],
313
                    { "targets": [ -2, -1 ], "orderable": false, "searchable":  false }
313
                order: [[0, "asc"]],
314
                ],
314
                pagingType: "full",
315
                "order": [[ 0, "asc" ]],
315
                lengthMenu: [aLengthMenu, aLengthMenuLabel],
316
                "pagingType": "full",
316
                pageLength: patronsPerPage,
317
                "lengthMenu": [aLengthMenu, aLengthMenuLabel],
317
                autoWidth: false,
318
                "pageLength": patronsPerPage,
318
            });
319
                "autoWidth": false
320
            }));
321
            $("#additems").click(function(){
319
            $("#additems").click(function(){
322
                return Add();
320
                return Add();
323
            });
321
            });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt (-2 / +2 lines)
Lines 336-342 Link Here
336
336
337
        $(document).ready(function() {
337
        $(document).ready(function() {
338
            const sale_table = document.getElementById('sale');
338
            const sale_table = document.getElementById('sale');
339
            const saleDataTable = $("#sale").DataTable($.extend(true, {}, dataTablesDefaults, {
339
            const saleDataTable = $("#sale").kohaTable({
340
                "paginate": false,
340
                "paginate": false,
341
                "searching": false,
341
                "searching": false,
342
                "info": false,
342
                "info": false,
Lines 385-391 Link Here
385
                    $('#paid').val(total_price).trigger('change');
385
                    $('#paid').val(total_price).trigger('change');
386
                },
386
                },
387
                "autoWidth": false
387
                "autoWidth": false
388
            }));
388
            });
389
389
390
            $("#sale").on("click", "button.drop", function(){
390
            $("#sale").on("click", "button.drop", function(){
391
                    saleDataTable.row($(this).parents('tr')).remove().draw(false);
391
                    saleDataTable.row($(this).parents('tr')).remove().draw(false);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt (-4 / +4 lines)
Lines 439-445 Link Here
439
    [% Asset.js("js/modal_printer.js") | $raw %]
439
    [% Asset.js("js/modal_printer.js") | $raw %]
440
    [% INCLUDE 'calendar.inc' %]
440
    [% INCLUDE 'calendar.inc' %]
441
    <script>
441
    <script>
442
        var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, {
442
        var sales_table = $("#sales").kohaTable({
443
            orderFixed: [ 0, 'asc'],
443
            orderFixed: [ 0, 'asc'],
444
            ordering: false,
444
            ordering: false,
445
            columnDefs: [ {
445
            columnDefs: [ {
Lines 464-472 Link Here
464
            initComplete: function() {
464
            initComplete: function() {
465
                $("#sales").show();
465
                $("#sales").show();
466
            }
466
            }
467
        }));
467
        });
468
468
469
        var past_sales_table = $("#past_sales").dataTable($.extend(true, {}, dataTablesDefaults, {
469
        var past_sales_table = $("#past_sales").kohaTable({
470
            orderFixed: [ 0, 'asc'],
470
            orderFixed: [ 0, 'asc'],
471
            ordering: false,
471
            ordering: false,
472
            columnDefs: [ {
472
            columnDefs: [ {
Lines 486-492 Link Here
486
                },
486
                },
487
                endRender: null,
487
                endRender: null,
488
            }
488
            }
489
        }));
489
        });
490
490
491
        $("#issueRefundModal").on("shown.bs.modal", function(e){
491
        $("#issueRefundModal").on("shown.bs.modal", function(e){
492
           var button = $(e.relatedTarget);
492
           var button = $(e.relatedTarget);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt (-4 / +4 lines)
Lines 215-224 Link Here
215
            $("#income").text('[% ctotal | $Price %] ([% cctotal | $Price %])');
215
            $("#income").text('[% ctotal | $Price %] ([% cctotal | $Price %])');
216
            $("#outgoing").text('[% dtotal | $Price %] ([% cdtotal | $Price %])');
216
            $("#outgoing").text('[% dtotal | $Price %] ([% cdtotal | $Price %])');
217
217
218
            var registers_table = $("#registers").dataTable($.extend(true, {}, dataTablesDefaults, {
218
            var registers_table = $("#registers").kohaTable({
219
                "searching": false,
219
                searching: false,
220
                "paginationType": "full"
220
                paginationType: "full",
221
            }));
221
            });
222
222
223
            $("#confirmCashupModal").on("shown.bs.modal", function(e){
223
            $("#confirmCashupModal").on("shown.bs.modal", function(e){
224
               var button = $(e.relatedTarget);
224
               var button = $(e.relatedTarget);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt (-10 / +8 lines)
Lines 152-167 Link Here
152
    [% INCLUDE 'columns_settings.inc' %]
152
    [% INCLUDE 'columns_settings.inc' %]
153
    <script>
153
    <script>
154
        $(document).ready(function () {
154
        $(document).ready(function () {
155
            $("#recalls-table").dataTable(
155
            $("#recalls-table").kohaTable({
156
                $.extend(true, {}, dataTablesDefaults, {
156
                columnDefs: [
157
                    columnDefs: [
157
                    { orderable: false, targets: ["nosort"] },
158
                        { orderable: false, targets: ["nosort"] },
158
                    { type: "title-string", targets: ["title-string"] },
159
                        { type: "title-string", targets: ["title-string"] },
159
                    { type: "anti-the", targets: ["anti-the"] },
160
                        { type: "anti-the", targets: ["anti-the"] },
160
                ],
161
                    ],
161
                pagingType: "full_numbers",
162
                    pagingType: "full_numbers",
162
            });
163
                })
164
            );
165
163
166
            $(".cancelreturn").click(function () {
164
            $(".cancelreturn").click(function () {
167
                return confirmDelete(_("Are you sure you want to remove this recall and return the item to its home library?"));
165
                return confirmDelete(_("Are you sure you want to remove this recall and return the item to its home library?"));
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt (-7 / +5 lines)
Lines 157-169 Link Here
157
    [% INCLUDE 'columns_settings.inc' %]
157
    [% INCLUDE 'columns_settings.inc' %]
158
    <script>
158
    <script>
159
        $(document).ready(function () {
159
        $(document).ready(function () {
160
            $("#recallswaiting-table, #recallsover-table").dataTable(
160
            $("#recallswaiting-table, #recallsover-table").kohaTable({
161
                $.extend(true, {}, dataTablesDefaults, {
161
                autoWidth: false,
162
                    autoWidth: false,
162
                columnDefs: [{ orderable: false, targets: ["nosort"] }],
163
                    columnDefs: [{ orderable: false, targets: ["nosort"] }],
163
                pagingType: "full_numbers",
164
                    pagingType: "full_numbers",
164
            });
165
                })
166
            );
167
165
168
            $(".revert_recall").click(function (e) {
166
            $(".revert_recall").click(function (e) {
169
                return confirmDelete(_("Are you sure you want to revert this recall's status from Waiting?"));
167
                return confirmDelete(_("Are you sure you want to revert this recall's status from Waiting?"));
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt (-6 / +4 lines)
Lines 204-215 Link Here
204
    <script>
204
    <script>
205
        actTotal = "";
205
        actTotal = "";
206
        $(document).ready(function () {
206
        $(document).ready(function () {
207
            $("#tbl_cash_register_stats").dataTable(
207
            $("#tbl_cash_register_stats").kohaTable({
208
                $.extend(true, {}, dataTablesDefaults, {
208
                pageLength: 50,
209
                    pageLength: 50,
209
                pagingType: "full_numbers",
210
                    pagingType: "full_numbers",
210
            });
211
                })
212
            );
213
211
214
            $("#branch").on("change", function () {
212
            $("#branch").on("change", function () {
215
                var selectedBranch = $("#branch").children("option:selected").val();
213
                var selectedBranch = $("#branch").children("option:selected").val();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-2 / +2 lines)
Lines 2539-2545 Link Here
2539
                        $(".mana_search_status").hide();
2539
                        $(".mana_search_status").hide();
2540
                        $("#mana_search_result_label").text(_("Results from Mana Knowledge Base"));
2540
                        $("#mana_search_result_label").text(_("Results from Mana Knowledge Base"));
2541
                        $("#mana-loading").hide();
2541
                        $("#mana-loading").hide();
2542
                        $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{
2542
                        $("#mana_results_datatable").kohaTable({
2543
                            "pagingType": "full",
2543
                            "pagingType": "full",
2544
                            "autoWidth": false,
2544
                            "autoWidth": false,
2545
                            "columnDefs": [
2545
                            "columnDefs": [
Lines 2549-2555 Link Here
2549
                                { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] },
2549
                                { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] },
2550
                                { "type": "anti-the", "targets":  [ 'anti-the'] }
2550
                                { "type": "anti-the", "targets":  [ 'anti-the'] }
2551
                            ]
2551
                            ]
2552
                        }));
2552
                        });
2553
2553
2554
                        $(".showbutton").on("click", function(e){
2554
                        $(".showbutton").on("click", function(e){
2555
                            e.preventDefault();
2555
                            e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt (-6 / +4 lines)
Lines 99-110 Link Here
99
        [% INCLUDE 'datatables.inc' %]
99
        [% INCLUDE 'datatables.inc' %]
100
        <script>
100
        <script>
101
            $(document).ready(function () {
101
            $(document).ready(function () {
102
                $("#itemtypest").dataTable(
102
                $("#itemtypest").kohaTable({
103
                    $.extend(true, {}, dataTablesDefaults, {
103
                    dom: "t",
104
                        dom: "t",
104
                    paginate: false,
105
                        paginate: false,
105
                });
106
                    })
107
                );
108
            });
106
            });
109
        </script>
107
        </script>
110
    [% END %]
108
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt (-5 / +3 lines)
Lines 147-157 Link Here
147
    [% INCLUDE 'datatables.inc' %]
147
    [% INCLUDE 'datatables.inc' %]
148
    <script>
148
    <script>
149
        $(document).ready(function () {
149
        $(document).ready(function () {
150
            $("#resulttable").dataTable(
150
            $("#resulttable").kohaTable({
151
                $.extend(true, {}, dataTablesDefaults, {
151
                paginate: false,
152
                    paginate: false,
152
            });
153
                })
154
            );
155
        });
153
        });
156
    </script>
154
    </script>
157
[% END %]
155
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-5 / +4 lines)
Lines 1508-1518 Link Here
1508
                });
1508
                });
1509
            [% END %]
1509
            [% END %]
1510
1510
1511
            var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1511
            var my_table = $("#requestspecific").kohaTable({
1512
                "paginate": false,
1512
                paginate: false,
1513
                "dom": '<"top pager"ilf>t',
1513
                dom: '<"top pager"ilf>t',
1514
            }));
1514
            });
1515
1516
1515
1517
            $("#club-request-form").on("submit", function() {
1516
            $("#club-request-form").on("submit", function() {
1518
                let $t = $(this);
1517
                let $t = $(this);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-10 / +8 lines)
Lines 217-232 Link Here
217
    <script>
217
    <script>
218
        var sTable;
218
        var sTable;
219
        $(document).ready(function () {
219
        $(document).ready(function () {
220
            sTable = $("#claimst").dataTable(
220
            sTable = $("#claimst").kohaTable({
221
                $.extend(true, {}, dataTablesDefaults, {
221
                dom: "t",
222
                    dom: "t",
222
                columnDefs: [
223
                    columnDefs: [
223
                    { targets: [0], orderable: false, searchable: false },
224
                        { targets: [0], orderable: false, searchable: false },
224
                    { type: "anti-the", targets: ["anti-the"] },
225
                        { type: "anti-the", targets: ["anti-the"] },
225
                ],
226
                    ],
226
                paginate: false,
227
                    paginate: false,
227
            });
228
                })
229
            );
230
            $("#supplierid").change(function () {
228
            $("#supplierid").change(function () {
231
                $("#claims").submit();
229
                $("#claims").submit();
232
            });
230
            });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt (-11 / +9 lines)
Lines 359-375 Link Here
359
            if( $("#subscription_years .tab-pane.active").length < 1 ){
359
            if( $("#subscription_years .tab-pane.active").length < 1 ){
360
                $("#subscription_years a:first").tab("show");
360
                $("#subscription_years a:first").tab("show");
361
            }
361
            }
362
            $(".subscription-year-table").dataTable($.extend(true, {}, dataTablesDefaults, {
362
            $(".subscription-year-table").kohaTable({
363
                "columnDefs": [
363
                columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }],
364
                    { "targets": [ 0,-1 ], "orderable": false, "searchable":  false }
364
                order: [[0, "desc"]],
365
                ],
365
                dom: "t",
366
                "order": [[0, 'desc']],
366
                autoWidth: false,
367
                "dom": 't',
367
                paginate: false,
368
                "autoWidth": false,
368
                info: false,
369
                "paginate": false,
369
                searching: false,
370
                "info": false,
370
            });
371
                "searching": false,
372
            } ));
373
371
374
            $(".CheckAll").on("click", function(e){
372
            $(".CheckAll").on("click", function(e){
375
                e.preventDefault();
373
                e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-23 / +23 lines)
Lines 334-365 Link Here
334
        }
334
        }
335
335
336
        $(document).ready(function() {
336
        $(document).ready(function() {
337
            var osrlt = $("#opened_panel table").dataTable($.extend(true, {}, dataTablesDefaults, {
337
            var osrlt = $("#opened_panel table").kohaTable({
338
                "pagingType": "full",
338
                pagingType: "full",
339
                "order": [[ 2, "asc" ]],
339
                order: [[2, "asc"]],
340
                "columnDefs": [
340
                columnDefs: [
341
                    { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] },
341
                    { orderable: false, searchable: false, targets: ["NoSort"] },
342
                    { "type": "anti-the", "targets":  [ 'anti-the'] }
342
                    { type: "anti-the", targets: ["anti-the"] },
343
                ]
343
                ],
344
            }));
344
            });
345
345
346
            var csrlt = $("#closed_panel table").dataTable($.extend(true, {}, dataTablesDefaults, {
346
            var csrlt = $("#closed_panel table").kohaTable({
347
                // FIXME sort function of additional_fields!
347
                // FIXME sort function of additional_fields!
348
                "order": [[ 2, "asc" ]],
348
                order: [[2, "asc"]],
349
                "pagingType": "full",
349
                pagingType: "full",
350
                "columnDefs": [
350
                columnDefs: [
351
                    { "orderable": false, "targets": [ 'NoSort' ] },
351
                    { orderable: false, targets: ["NoSort"] },
352
                    { "type": "anti-the", "targets":  [ 'anti-the'] }
352
                    { type: "anti-the", targets: ["anti-the"] },
353
                ]
353
                ],
354
            }));
354
            });
355
355
356
            var manarlt = $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults, {
356
            var manarlt = $("#mana_results_datatable").kohaTable({
357
                "pagingType": "full",
357
                pagingType: "full",
358
                "columnDefs": [
358
                columnDefs: [
359
                    { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] },
359
                    { orderable: false, searchable: false, targets: ["NoSort"] },
360
                    { "type": "anti-the", "targets":  [ 'anti-the'] }
360
                    { type: "anti-the", targets: ["anti-the"] },
361
                ]
361
                ],
362
            }));
362
            });
363
363
364
            $("#reopensub").click(function(){
364
            $("#reopensub").click(function(){
365
                return confirm(_("Are you sure you want to reopen this subscription?"));
365
                return confirm(_("Are you sure you want to reopen this subscription?"));
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt (-6 / +4 lines)
Lines 390-401 Link Here
390
        }
390
        }
391
        $(document).ready(function(){
391
        $(document).ready(function(){
392
392
393
            $("#numberpatternst").dataTable($.extend(true, {}, dataTablesDefaults, {
393
            $("#numberpatternst").kohaTable({
394
                "columnDefs": [
394
                columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
395
                    { "targets": [ -1 ], "orderable": false, "searchable":  false },
395
                pagingType: "full",
396
                ],
396
            });
397
                "pagingType": "full"
398
            }));
399
397
400
            $(".delete_pattern").on("click",function(){
398
            $(".delete_pattern").on("click",function(){
401
                return confirmDelete();
399
                return confirmDelete();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt (-7 / +5 lines)
Lines 159-171 Link Here
159
                    event.preventDefault();
159
                    event.preventDefault();
160
                }
160
                }
161
            });
161
            });
162
            $("#itemst").dataTable(
162
            $("#itemst").kohaTable({
163
                $.extend(true, {}, dataTablesDefaults, {
163
                columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }],
164
                    columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }],
164
                order: [[0, "asc"]],
165
                    order: [[0, "asc"]],
165
                pagingType: "full",
166
                    pagingType: "full",
166
            });
167
                })
168
            );
169
        });
167
        });
170
    </script>
168
    </script>
171
[% END %]
169
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt (-6 / +4 lines)
Lines 67-78 Link Here
67
    [% INCLUDE 'datatables.inc' %]
67
    [% INCLUDE 'datatables.inc' %]
68
    <script>
68
    <script>
69
        $(document).ready(function () {
69
        $(document).ready(function () {
70
            $("#files").dataTable(
70
            $("#files").kohaTable({
71
                $.extend(true, {}, dataTablesDefaults, {
71
                columnDefs: [{ targets: [-1], orderSequence: ["desc", "asc"], searchable: false }],
72
                    columnDefs: [{ targets: [-1], orderSequence: ["desc", "asc"], searchable: false }],
72
                paginate: false,
73
                    paginate: false,
73
            });
74
                })
75
            );
76
        });
74
        });
77
    </script>
75
    </script>
78
[% END %]
76
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-10 / +8 lines)
Lines 604-619 Link Here
604
            });
604
            });
605
605
606
            $(document).ready(function () {
606
            $(document).ready(function () {
607
                var table = $("#table_additional_contents").DataTable(
607
                var table = $("#table_additional_contents").kohaTable({
608
                    $.extend(true, {}, dataTablesDefaults, {
608
                    order: [[4, "desc"]],
609
                        order: [[4, "desc"]],
609
                    columnDefs: [
610
                        columnDefs: [
610
                        { sortable: false, searchable: false, targets: ["NoSort"] },
611
                            { sortable: false, searchable: false, targets: ["NoSort"] },
611
                        { type: "anti-the", targets: ["anti-the"] },
612
                            { type: "anti-the", targets: ["anti-the"] },
612
                    ],
613
                        ],
613
                    pagingType: "full_numbers",
614
                        pagingType: "full_numbers",
614
                });
615
                    })
616
                );
617
615
618
                $("#del_form").on("click", ".delete_news", function (e) {
616
                $("#del_form").on("click", ".delete_news", function (e) {
619
                    e.preventDefault();
617
                    e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt (-18 / +18 lines)
Lines 346-370 Link Here
346
            });
346
            });
347
          [% END %]
347
          [% END %]
348
348
349
          $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
349
          $("#biblios").kohaTable({
350
            "columnDefs": [
350
              columnDefs: [
351
              { "targets": [ 0 ], "orderable": false, "searchable":  false },
351
                  { targets: [0], orderable: false, searchable: false },
352
              { "targets": [ 3, 4 ], "type": "num-html" }
352
                  { targets: [3, 4], type: "num-html" },
353
            ],
353
              ],
354
            "dom": 't',
354
              dom: "t",
355
            "order": [],
355
              order: [],
356
            "paginate": false
356
              paginate: false,
357
          }));
357
          });
358
358
359
          $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
359
          $("#authorities").kohaTable({
360
            "columnDefs": [
360
              columnDefs: [
361
              { "targets": [ 0 ], "orderable": false, "searchable":  false },
361
                  { targets: [0], orderable: false, searchable: false },
362
              { "targets": [ 3 ], "type": "num-html" }
362
                  { targets: [3], type: "num-html" },
363
            ],
363
              ],
364
            "dom": 't',
364
              dom: "t",
365
            "order": [],
365
              order: [],
366
            "paginate": false
366
              paginate: false,
367
          }));
367
          });
368
368
369
          $("#selectrecords").on("submit",function(){
369
          $("#selectrecords").on("submit",function(){
370
            var nb_checked = $("#selectrecords").find("input[type='checkbox'][name='record_id']:checked").size();
370
            var nb_checked = $("#selectrecords").find("input[type='checkbox'][name='record_id']:checked").size();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt (-22 / +18 lines)
Lines 267-295 Link Here
267
267
268
            $("#selectall").click();
268
            $("#selectall").click();
269
269
270
            $("#checkouts").dataTable(
270
            $("#checkouts").kohaTable({
271
                $.extend(true, {}, dataTablesDefaults, {
271
                columnDefs: [
272
                    columnDefs: [
272
                    { targets: [0, 3], orderable: false, searchable: false },
273
                        { targets: [0, 3], orderable: false, searchable: false },
273
                    { targets: [1], type: "num-html" },
274
                        { targets: [1], type: "num-html" },
274
                ],
275
                    ],
275
                dom: "t",
276
                    dom: "t",
276
                order: [],
277
                    order: [],
277
                paginate: false,
278
                    paginate: false,
278
            });
279
                })
280
            );
281
279
282
            $("#checkouts_result").dataTable(
280
            $("#checkouts_result").kohaTable({
283
                $.extend(true, {}, dataTablesDefaults, {
281
                columnDefs: [
284
                    columnDefs: [
282
                    { targets: [0, 3], orderable: false, searchable: false },
285
                        { targets: [0, 3], orderable: false, searchable: false },
283
                    { targets: [1], type: "num-html" },
286
                        { targets: [1], type: "num-html" },
284
                ],
287
                    ],
285
                dom: "t",
288
                    dom: "t",
286
                order: [],
289
                    order: [],
287
                paginate: false,
290
                    paginate: false,
288
            });
291
                })
292
            );
293
289
294
            $("#extend_due_dates_form").on("submit", function (e) {
290
            $("#extend_due_dates_form").on("submit", function (e) {
295
                var new_hard_due_date = $("#new_hard_due_date").val();
291
                var new_hard_due_date = $("#new_hard_due_date").val();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt (-16 / +16 lines)
Lines 353-377 Link Here
353
353
354
            $("#selectall").click();
354
            $("#selectall").click();
355
355
356
            $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
356
            $("#biblios").kohaTable({
357
                "columnDefs": [
357
                columnDefs: [
358
                    { "targets": [0, 3], "orderable": false, "searchable":  false },
358
                    { targets: [0, 3], orderable: false, searchable: false },
359
                    { "targets": [1], "type": "num-html" }
359
                    { targets: [1], type: "num-html" },
360
                ],
360
                ],
361
                "dom": 't',
361
                dom: "t",
362
                "order": [],
362
                order: [],
363
                "paginate": false
363
                paginate: false,
364
            }));
364
            });
365
365
366
            $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
366
            $("#authorities").kohaTable({
367
                "columnDefs": [
367
                columnDefs: [
368
                    { "targets": [0, 3], "orderable": false, "searchable":  false },
368
                    { targets: [0, 3], orderable: false, searchable: false },
369
                    { "targets": [1], "type": "num-html" }
369
                    { targets: [1], type: "num-html" },
370
                ],
370
                ],
371
                "dom": 't',
371
                dom: "t",
372
                "order": [],
372
                order: [],
373
                "paginate": false
373
                paginate: false,
374
            }));
374
            });
375
375
376
            $("#mainformsubmit").click(function() {
376
            $("#mainformsubmit").click(function() {
377
                if ($("input[type=checkbox][name='record_id']:checked").length == 0) {
377
                if ($("input[type=checkbox][name='record_id']:checked").length == 0) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-11 / +15 lines)
Lines 608-627 Link Here
608
                var first_td = $(this).find('td').first();
608
                var first_td = $(this).find('td').first();
609
                first_td.html(weekdays[first_td.html()]);
609
                first_td.html(weekdays[first_td.html()]);
610
            });
610
            });
611
            $("#holidayweeklyrepeatable").dataTable($.extend(true, {}, dataTablesDefaults, {
611
            $("#holidayweeklyrepeatable").kohaTable({
612
                "dom": 't',
612
                dom: "t",
613
                "paginate": false
613
                paginate: false,
614
            }));
614
            });
615
            var tables = $("#holidayexceptions, #holidaysyearlyrepeatable, #holidaysunique").DataTable($.extend(true, {}, dataTablesDefaults, {
615
616
                "dom": 't',
616
            let dt_params = {
617
                "paginate": false,
617
                dom: "t",
618
                "createdRow": function( row, data, dataIndex ) {
618
                paginate: false,
619
                createdRow: function (row, data, dataIndex) {
619
                    var holiday = $(row).data("date");
620
                    var holiday = $(row).data("date");
620
                    if( holiday < datestring ){
621
                    if (holiday < datestring) {
621
                        $(row).addClass("date_past");
622
                        $(row).addClass("date_past");
622
                    }
623
                    }
623
                }
624
                },
624
            }));
625
            };
626
            $("#holidayexceptions").kohaTable(dt_params);
627
            $("#holidaysyearlyrepeatable").kohaTable(dt_params);
628
            $("#holidaysunique").kohaTable(dt_params);
625
629
626
            $(".show_past").on("change", function(){
630
            $(".show_past").on("change", function(){
627
                tables.draw();
631
                tables.draw();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt (-2 / +2 lines)
Lines 470-476 Link Here
470
            });
470
            });
471
471
472
            [% IF import_batch_id %]
472
            [% IF import_batch_id %]
473
                $("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, {
473
                $("#records-table").kohaTable({
474
                    "autoWidth": false,
474
                    "autoWidth": false,
475
                    "searching": false,
475
                    "searching": false,
476
                    "processing": true,
476
                    "processing": true,
Lines 596-602 Link Here
596
                            );
596
                            );
597
                        }
597
                        }
598
                    },
598
                    },
599
                }));
599
                });
600
                $("#revert_batch_form").on("submit", function() {
600
                $("#revert_batch_form").on("submit", function() {
601
                    return confirm(_("Are you sure you want to undo the import of this batch into the catalog?"));
601
                    return confirm(_("Are you sure you want to undo the import of this batch into the catalog?"));
602
                });
602
                });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt (-7 / +5 lines)
Lines 188-200 Link Here
188
            if ($("#rulestabs .tab-pane.active").length < 1) {
188
            if ($("#rulestabs .tab-pane.active").length < 1) {
189
                $("#rulestabs a:first").tab("show");
189
                $("#rulestabs a:first").tab("show");
190
            }
190
            }
191
            $(".overduerulest").dataTable(
191
            $(".overduerulest").kohaTable({
192
                $.extend(true, {}, dataTablesDefaults, {
192
                columnDefs: [{ targets: ["NoSort"], orderable: false, searchable: false }],
193
                    columnDefs: [{ targets: ["NoSort"], orderable: false, searchable: false }],
193
                dom: '<"top pager"f>rt<"clear">',
194
                    dom: '<"top pager"f>rt<"clear">',
194
                paginate: false,
195
                    paginate: false,
195
            });
196
                })
197
            );
198
196
199
            $("#overduerulesf").on("submit", function (e) {
197
            $("#overduerulesf").on("submit", function (e) {
200
                $(".overduerulest").DataTable().search("").draw();
198
                $(".overduerulest").DataTable().search("").draw();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/problem-reports.tt (-10 / +8 lines)
Lines 142-157 Link Here
142
    [% INCLUDE 'datatables.inc' %]
142
    [% INCLUDE 'datatables.inc' %]
143
    <script>
143
    <script>
144
        $(document).ready(function () {
144
        $(document).ready(function () {
145
            $("#problemreportstable").dataTable(
145
            $("#problemreportstable").kohaTable({
146
                $.extend(true, {}, dataTablesDefaults, {
146
                order: [[1, "asc"]],
147
                    order: [[1, "asc"]],
147
                columnDefs: [
148
                    columnDefs: [
148
                    { orderable: false, searchable: false, targets: ["NoSort"] },
149
                        { orderable: false, searchable: false, targets: ["NoSort"] },
149
                    { type: "anti-the", targets: ["anti-the"] },
150
                        { type: "anti-the", targets: ["anti-the"] },
150
                ],
151
                    ],
151
                pagingType: "full",
152
                    pagingType: "full",
152
            });
153
                })
154
            );
155
153
156
            $(".SelectAll").on("click", function () {
154
            $(".SelectAll").on("click", function () {
157
                $("input[name='report_ids'][type='checkbox']").prop("checked", true);
155
                $("input[name='report_ids'][type='checkbox']").prop("checked", true);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt (-1 / +1 lines)
Lines 242-248 Link Here
242
                $("#quotes_editor").show();
242
                $("#quotes_editor").show();
243
                $("#save_quotes").on("click", yuiGetData);
243
                $("#save_quotes").on("click", yuiGetData);
244
244
245
                let table = $("#quotes_editor").dataTable({
245
                let table = $("#quotes_editor").kohaTable({
246
                    autoWidth: false,
246
                    autoWidth: false,
247
                    paging: true,
247
                    paging: true,
248
                    ordering: false,
248
                    ordering: false,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-2 / +2 lines)
Lines 659-665 Link Here
659
                            'vs.lastmodified',
659
                            'vs.lastmodified',
660
                            ];
660
                            ];
661
661
662
                var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
662
                var dtListResults = $("#listresultst").kohaTable({
663
                    order: [[ 5, "asc" ]],
663
                    order: [[ 5, "asc" ]],
664
                    serverSide:  true,
664
                    serverSide:  true,
665
                    ajax:  {
665
                    ajax:  {
Lines 697-703 Link Here
697
                    "searching": false,
697
                    "searching": false,
698
                    "processing": true,
698
                    "processing": true,
699
                    "orderCellsTop":  true
699
                    "orderCellsTop":  true
700
                }));
700
                });
701
                _dt_add_delay_filters(dtListResults.api(), $("#listresultst"));
701
                _dt_add_delay_filters(dtListResults.api(), $("#listresultst"));
702
702
703
                /* Select correct tab based on URL parameter */
703
                /* Select correct tab based on URL parameter */
(-)a/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js (-11 / +9 lines)
Lines 1-17 Link Here
1
/* global dataTablesDefaults __ template_path */
1
/* global __ template_path */
2
2
3
$(document).ready(function () {
3
$(document).ready(function () {
4
    $("#Aform").preventDoubleFormSubmit();
4
    $("#Aform").preventDoubleFormSubmit();
5
    $("#files").dataTable(
5
    $("#files").kohaTable({
6
        $.extend(true, {}, dataTablesDefaults, {
6
        columnDefs: [
7
            columnDefs: [
7
            { orderable: false, searchable: false, targets: ["NoSort"] },
8
                { orderable: false, searchable: false, targets: ["NoSort"] },
8
            { type: "anti-the", targets: ["anti-the"] },
9
                { type: "anti-the", targets: ["anti-the"] },
9
        ],
10
            ],
10
        pagingType: "full",
11
            pagingType: "full",
11
        order: [],
12
            order: [],
12
    });
13
        })
14
    );
15
13
16
    checkOrderBudgets();
14
    checkOrderBudgets();
17
    var all_budget_id = $("#all_budget_id");
15
    var all_budget_id = $("#all_budget_id");
(-)a/koha-tmpl/intranet-tmpl/prog/js/authtype.js (-10 / +8 lines)
Lines 3-18 Link Here
3
var importing = false;
3
var importing = false;
4
4
5
$(document).ready(function () {
5
$(document).ready(function () {
6
    $("#authtypes").dataTable(
6
    $("#authtypes").kohaTable({
7
        $.extend(true, {}, dataTablesDefaults, {
7
        columnDefs: [
8
            columnDefs: [
8
            { targets: [-1], orderable: false, searchable: false },
9
                { targets: [-1], orderable: false, searchable: false },
9
            { targets: [0, 1], type: "natural" },
10
                { targets: [0, 1], type: "natural" },
10
        ],
11
            ],
11
        ordering: true,
12
            ordering: true,
12
        pagingType: "full",
13
            pagingType: "full",
13
    });
14
        })
15
    );
16
14
17
    $("body").css("cursor", "auto");
15
    $("body").css("cursor", "auto");
18
    $(".import_export_options").hide();
16
    $(".import_export_options").hide();
(-)a/koha-tmpl/intranet-tmpl/prog/js/biblio_framework.js (-10 / +8 lines)
Lines 4-19 Link Here
4
var importing = false;
4
var importing = false;
5
5
6
$(document).ready(function () {
6
$(document).ready(function () {
7
    $("#table_biblio_frameworks").dataTable(
7
    $("#table_biblio_frameworks").kohaTable({
8
        $.extend(true, {}, dataTablesDefaults, {
8
        columnDefs: [
9
            columnDefs: [
9
            { targets: [-1], orderable: false, searchable: false },
10
                { targets: [-1], orderable: false, searchable: false },
10
            { targets: [0, 1], type: "natural" },
11
                { targets: [0, 1], type: "natural" },
11
        ],
12
            ],
12
        ordering: true,
13
            ordering: true,
13
        pagingType: "full",
14
            pagingType: "full",
14
    });
15
        })
16
    );
17
15
18
    $("body").css("cursor", "auto");
16
    $("body").css("cursor", "auto");
19
    $(".import_export_options").hide();
17
    $(".import_export_options").hide();
(-)a/koha-tmpl/intranet-tmpl/prog/js/cart.js (-13 / +11 lines)
Lines 1-4 Link Here
1
/* global __ dataTablesDefaults showMore showLess delSelRecords addSelToShelf sendBasket printBasket delBasket openBiblio selRecord */
1
/* global __ showMore showLess delSelRecords addSelToShelf sendBasket printBasket delBasket openBiblio selRecord */
2
2
3
function placeHold() {
3
function placeHold() {
4
    var checkedItems = $("input:checkbox:checked");
4
    var checkedItems = $("input:checkbox:checked");
Lines 94-111 $(document).ready(function () { Link Here
94
    $(".hold").text(__("Place hold"));
94
    $(".hold").text(__("Place hold"));
95
    $("#downloadcartc").empty();
95
    $("#downloadcartc").empty();
96
96
97
    $("#itemst").dataTable(
97
    $("#itemst").kohaTable({
98
        $.extend(true, {}, dataTablesDefaults, {
98
        dom: "t",
99
            dom: "t",
99
        columnDefs: [
100
            columnDefs: [
100
            { orderable: false, searchable: false, targets: ["NoSort"] },
101
                { orderable: false, searchable: false, targets: ["NoSort"] },
101
            { type: "anti-the", targets: ["anti-the"] },
102
                { type: "anti-the", targets: ["anti-the"] },
102
            { type: "callnumbers", targets: ["callnumbers"] },
103
                { type: "callnumbers", targets: ["callnumbers"] },
103
        ],
104
            ],
104
        order: [[1, "asc"]],
105
            order: [[1, "asc"]],
105
        paging: false,
106
            paging: false,
106
    });
107
        })
108
    );
109
107
110
    $(".showdetails").on("click", function (e) {
108
    $(".showdetails").on("click", function (e) {
111
        e.preventDefault();
109
        e.preventDefault();
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-1 / +1 lines)
Lines 1380-1386 $(document).ready(function () { Link Here
1380
    }
1380
    }
1381
    function loadReturnClaimsTable() {
1381
    function loadReturnClaimsTable() {
1382
        if (!returnClaimsTable) {
1382
        if (!returnClaimsTable) {
1383
            returnClaimsTable = $("#return-claims-table").dataTable({
1383
            returnClaimsTable = $("#return-claims-table").kohaTable({
1384
                autoWidth: false,
1384
                autoWidth: false,
1385
                dom: "rt",
1385
                dom: "rt",
1386
                order: [],
1386
                order: [],
(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-4 / +11 lines)
Lines 1260-1281 function _dt_save_restore_state(table_settings, external_filter_nodes = {}) { Link Here
1260
                };
1260
                };
1261
            }
1261
            }
1262
1262
1263
            if (options.ajax) {
1264
                options.ajax = Object.assign(
1265
                    {},
1266
                    options.ajax,
1267
                    _dt_default_ajax({ default_filters, options })
1268
                );
1269
                options.serverSide = true;
1270
                options.processing = true;
1271
                options.pagingType = "full_numbers";
1272
            }
1273
1263
            settings = $.extend(
1274
            settings = $.extend(
1264
                true,
1275
                true,
1265
                {},
1276
                {},
1266
                dataTablesDefaults,
1277
                dataTablesDefaults,
1267
                {
1278
                {
1268
                    paging: true,
1279
                    paging: true,
1269
                    serverSide: true,
1270
                    searching: true,
1280
                    searching: true,
1271
                    pagingType: "full_numbers",
1272
                    processing: true,
1273
                    language: {
1281
                    language: {
1274
                        emptyTable: options.emptyTable
1282
                        emptyTable: options.emptyTable
1275
                            ? options.emptyTable
1283
                            ? options.emptyTable
1276
                            : __("No data available in table"),
1284
                            : __("No data available in table"),
1277
                    },
1285
                    },
1278
                    ajax: _dt_default_ajax({ default_filters, options }),
1279
                },
1286
                },
1280
                options
1287
                options
1281
            );
1288
            );
(-)a/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js (-11 / +8 lines)
Lines 1-4 Link Here
1
/* global __ dataTablesDefaults */
1
/* global __ */
2
2
3
function clean_line(line) {
3
function clean_line(line) {
4
    $(line).find('input[type="text"]').val("");
4
    $(line).find('input[type="text"]').val("");
Lines 52-67 function tableInit(oldtabid, newtabid) { Link Here
52
        oldTableId.DataTable().destroy();
52
        oldTableId.DataTable().destroy();
53
    }
53
    }
54
54
55
    var newTableId = $("#" + newtabid + "_table");
55
    $("#" + newtabid + "_table").kohaTable({
56
    newTableId.DataTable(
56
        columnDefs: [
57
        $.extend(true, {}, dataTablesDefaults, {
57
            { orderable: false, searchable: false, targets: ["NoSort"] },
58
            columnDefs: [
58
        ],
59
                { orderable: false, searchable: false, targets: ["NoSort"] },
59
        paging: false,
60
            ],
60
        autoWidth: false,
61
            paging: false,
61
    });
62
            autoWidth: false,
63
        })
64
    );
65
}
62
}
66
63
67
$(document).ready(function () {
64
$(document).ready(function () {
(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (-1 / +1 lines)
Lines 105-111 function display_pickup_location(state) { Link Here
105
    };
105
    };
106
})(jQuery);
106
})(jQuery);
107
107
108
/* global __ dataTablesDefaults borrowernumber SuspendHoldsIntranet */
108
/* global __ borrowernumber SuspendHoldsIntranet */
109
$(document).ready(function () {
109
$(document).ready(function () {
110
    function suspend_hold(hold_id, end_date) {
110
    function suspend_hold(hold_id, end_date) {
111
        var params;
111
        var params;
(-)a/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js (-8 / +6 lines)
Lines 1-4 Link Here
1
/* global dataTablesDefaults tagsubfield selectBsTabByHash */
1
/* global tagsubfield selectBsTabByHash */
2
$(document).ready(function () {
2
$(document).ready(function () {
3
    if (tagsubfield && tagsubfield == "@") {
3
    if (tagsubfield && tagsubfield == "@") {
4
        $("#subfieldtabs a[href='#AT_panel']").tab("show");
4
        $("#subfieldtabs a[href='#AT_panel']").tab("show");
Lines 29-41 $(document).ready(function () { Link Here
29
    $("input[id^='hidden-']").each(function () {
29
    $("input[id^='hidden-']").each(function () {
30
        populateHiddenCheckboxes($(this).attr("id").split("-")[1]);
30
        populateHiddenCheckboxes($(this).attr("id").split("-")[1]);
31
    });
31
    });
32
    $("#table_marcsubfieldstructure").dataTable(
32
    $("#table_marcsubfieldstructure").kohaTable({
33
        $.extend(true, {}, dataTablesDefaults, {
33
        columnDefs: [{ sortable: false, targets: ["NoSort"] }],
34
            columnDefs: [{ sortable: false, targets: ["NoSort"] }],
34
        order: [],
35
            order: [],
35
        paginate: false,
36
            paginate: false,
36
    });
37
        })
38
    );
39
37
40
    selectBsTabByHash("subfieldtabs");
38
    selectBsTabByHash("subfieldtabs");
41
});
39
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-9 / +8 lines)
Lines 1-4 Link Here
1
/* global KOHA CodeMirror to_highlight search_jumped humanMsg dataTablesDefaults themelang */
1
/* keep tidy */
2
/* global KOHA CodeMirror to_highlight search_jumped humanMsg themelang */
2
// We can assume 'KOHA' exists, as we depend on KOHA.AJAX
3
// We can assume 'KOHA' exists, as we depend on KOHA.AJAX
3
4
4
KOHA.Preferences = {
5
KOHA.Preferences = {
Lines 207-220 function addConsentDeleteHandler() { Link Here
207
    });
208
    });
208
}
209
}
209
210
210
$("table.preferences").dataTable(
211
$("table.preferences").kohaTable({
211
    $.extend(true, {}, dataTablesDefaults, {
212
    dom: "t",
212
        dom: "t",
213
    columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
213
        columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
214
    paging: false,
214
        paging: false,
215
    fixedHeader: false,
215
        fixedHeader: false,
216
});
216
    })
217
);
218
217
219
$(".prefs-tab")
218
$(".prefs-tab")
220
    .find("input.preference, textarea.preference")
219
    .find("input.preference, textarea.preference")
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js (-10 / +8 lines)
Lines 74-89 var success_test_call = function () { Link Here
74
};
74
};
75
75
76
$(document).ready(function () {
76
$(document).ready(function () {
77
    $("#tagst").dataTable(
77
    $("#tagst").kohaTable({
78
        $.extend(true, {}, dataTablesDefaults, {
78
        columnDefs: [
79
            columnDefs: [
79
            { orderable: false, searchable: false, targets: ["NoSort"] },
80
                { orderable: false, searchable: false, targets: ["NoSort"] },
80
            { type: "anti-the", targets: ["anti-the"] },
81
                { type: "anti-the", targets: ["anti-the"] },
81
        ],
82
            ],
82
        order: [[2, "desc"]],
83
            order: [[2, "desc"]],
83
        pagingType: "full",
84
            pagingType: "full",
84
    });
85
        })
86
    );
87
    $(".ajax_buttons").css({ visibility: "visible" });
85
    $(".ajax_buttons").css({ visibility: "visible" });
88
    $("p.check").html(
86
    $("p.check").html(
89
        '<div id="searchheader"><a id="CheckAll" href="/cgi-bin/koha/tags/review.pl"><i class="fa fa-check" aria-hidden="false"><\/i> ' +
87
        '<div id="searchheader"><a id="CheckAll" href="/cgi-bin/koha/tags/review.pl"><i class="fa fa-check" aria-hidden="false"><\/i> ' +
(-)a/koha-tmpl/intranet-tmpl/prog/js/recalls.js (-10 / +8 lines)
Lines 127-142 $(document).ready(function () { Link Here
127
        }
127
        }
128
    });
128
    });
129
129
130
    $("#recalls-table").dataTable(
130
    $("#recalls-table").kohaTable({
131
        $.extend(true, {}, dataTablesDefaults, {
131
        columnDefs: [
132
            columnDefs: [
132
            { orderable: false, targets: ["nosort"] },
133
                { orderable: false, targets: ["nosort"] },
133
            { type: "title-string", targets: ["title-string"] },
134
                { type: "title-string", targets: ["title-string"] },
134
            { type: "anti-the", targets: ["anti-the"] },
135
                { type: "anti-the", targets: ["anti-the"] },
135
        ],
136
            ],
136
        pagingType: "full_numbers",
137
            pagingType: "full_numbers",
137
    });
138
        })
139
    );
140
138
141
    $("#cancel_selected").click(function (e) {
139
    $("#cancel_selected").click(function (e) {
142
        if ($("input[name='recall_ids']:checked").length > 0) {
140
        if ($("input[name='recall_ids']:checked").length > 0) {
(-)a/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js (-10 / +8 lines)
Lines 1-4 Link Here
1
/* global _ dataTablesDefaults */
1
/* global _ */
2
2
3
$(document).ready(function () {
3
$(document).ready(function () {
4
    $("#barcode").focus();
4
    $("#barcode").focus();
Lines 21-34 $(document).ready(function () { Link Here
21
    });
21
    });
22
22
23
    if ($("#rotating-collections-table").length > 0) {
23
    if ($("#rotating-collections-table").length > 0) {
24
        $("#rotating-collections-table").dataTable(
24
        $("#rotating-collections-table").kohaTable({
25
            $.extend(true, {}, dataTablesDefaults, {
25
            autoWidth: false,
26
                autoWidth: false,
26
            columnDefs: [
27
                columnDefs: [
27
                { targets: [-1], orderable: false, searchable: false },
28
                    { targets: [-1], orderable: false, searchable: false },
28
            ],
29
                ],
29
            pagingType: "full",
30
                pagingType: "full",
30
        });
31
            })
32
        );
33
    }
31
    }
34
});
32
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js (-19 / +13 lines)
Lines 556-580 function mana_search() { Link Here
556
        $("#mana_search_result_label").text(
556
        $("#mana_search_result_label").text(
557
            __("Results from Mana Knowledge Base")
557
            __("Results from Mana Knowledge Base")
558
        );
558
        );
559
        $("#mana_results_datatable").dataTable(
559
        $("#mana_results_datatable").kohaTable({
560
            $.extend(true, {}, dataTablesDefaults, {
560
            pagingType: "full",
561
                pagingType: "full",
561
            order: [
562
                order: [
562
                [4, "desc"],
563
                    [4, "desc"],
563
                [5, "desc"],
564
                    [5, "desc"],
564
            ],
565
                ],
565
            autoWidth: false,
566
                autoWidth: false,
566
            columnDefs: [{ width: "35%", targets: 1 }],
567
                columnDefs: [{ width: "35%", targets: 1 }],
567
            columnDefs: [
568
                columnDefs: [
568
                { orderable: false, searchable: false, targets: ["NoSort"] },
569
                    {
569
                { type: "anti-the", targets: ["anti-the"] },
570
                        orderable: false,
570
            ],
571
                        searchable: false,
571
        });
572
                        targets: ["NoSort"],
573
                    },
574
                    { type: "anti-the", targets: ["anti-the"] },
575
                ],
576
            })
577
        );
578
        if (
572
        if (
579
            $("#mana_results_datatable").length &&
573
            $("#mana_results_datatable").length &&
580
            $("td.dataTables_empty").length == 0
574
            $("td.dataTables_empty").length == 0
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlePackagesList.vue (-86 / +78 lines)
Lines 89-185 export default { Link Here
89
            $.fn.dataTable.ext.search = $.fn.dataTable.ext.search.filter(
89
            $.fn.dataTable.ext.search = $.fn.dataTable.ext.search.filter(
90
                search => search.name != "apply_filter"
90
                search => search.name != "apply_filter"
91
            );
91
            );
92
            $("#" + table_id).dataTable({
92
            $("#" + table_id).kohaTable({
93
                ...dataTablesDefaults,
93
                data: resources,
94
                ...{
94
                embed: ["package.name"],
95
                    data: resources,
95
                ordering: false,
96
                    embed: ["package.name"],
96
                dom: '<"top pager"<"table_entries"ilp>>tr<"bottom pager"ip>',
97
                    ordering: false,
97
                lengthMenu: [
98
                    dom: '<"top pager"<"table_entries"ilp>>tr<"bottom pager"ip>',
98
                    [10, 20, 50, 100],
99
                    lengthMenu: [
99
                    [10, 20, 50, 100],
100
                        [10, 20, 50, 100],
100
                ],
101
                        [10, 20, 50, 100],
101
                autoWidth: false,
102
                    ],
102
                columns: [
103
                    autoWidth: false,
103
                    {
104
                    columns: [
104
                        title: __("Name"),
105
                        {
105
                        data: "package.name",
106
                            title: __("Name"),
106
                        searchable: false,
107
                            data: "package.name",
107
                        orderable: false,
108
                            searchable: false,
108
                        render: function (data, type, row, meta) {
109
                            orderable: false,
109
                            // Rendering done in drawCallback
110
                            render: function (data, type, row, meta) {
110
                            return "";
111
                                // Rendering done in drawCallback
112
                                return "";
113
                            },
114
                            width: "100%",
115
                        },
111
                        },
116
                    ],
112
                        width: "100%",
117
                    drawCallback: function (settings) {
113
                    },
118
                        var api = new $.fn.dataTable.Api(settings);
114
                ],
115
                drawCallback: function (settings) {
116
                    var api = new $.fn.dataTable.Api(settings);
119
117
120
                        if (!api.rows({ search: "applied" }).count()) return;
118
                    if (!api.rows({ search: "applied" }).count()) return;
121
119
122
                        $.each(
120
                    $.each(
123
                            $(this).find("tbody tr td:first-child"),
121
                        $(this).find("tbody tr td:first-child"),
124
                            function (index, e) {
122
                        function (index, e) {
125
                                let tr = $(this).parent();
123
                            let tr = $(this).parent();
126
                                let row = api.row(tr).data();
124
                            let row = api.row(tr).data();
127
                                if (!row) return; // Happen if the table is empty
125
                            if (!row) return; // Happen if the table is empty
128
                                let { href } = router.resolve({
126
                            let { href } = router.resolve({
129
                                    name: "EHoldingsEBSCOResourcesShow",
127
                                name: "EHoldingsEBSCOResourcesShow",
130
                                    params: { resource_id: row.resource_id },
128
                                params: { resource_id: row.resource_id },
131
                                });
129
                            });
132
                                let n = createVNode(
130
                            let n = createVNode(
133
                                    "a",
131
                                "a",
134
                                    {
132
                                {
135
                                        role: "button",
133
                                    role: "button",
136
                                        href,
134
                                    href,
137
                                        onClick: e => {
135
                                    onClick: e => {
138
                                            e.preventDefault();
136
                                        e.preventDefault();
139
                                            show_resource(row.resource_id);
137
                                        show_resource(row.resource_id);
140
                                        },
141
                                    },
138
                                    },
142
                                    `${row.package.name}`
139
                                },
143
                                );
140
                                `${row.package.name}`
144
                                if (row.is_selected) {
141
                            );
145
                                    n = createVNode("span", {}, [
142
                            if (row.is_selected) {
146
                                        n,
143
                                n = createVNode("span", {}, [
147
                                        " ",
144
                                    n,
148
                                        createVNode("i", {
145
                                    " ",
149
                                            class: "fa fa-check-square",
146
                                    createVNode("i", {
150
                                            style: {
147
                                        class: "fa fa-check-square",
151
                                                color: "green",
148
                                        style: {
152
                                                float: "right",
149
                                            color: "green",
153
                                            },
150
                                            float: "right",
154
                                            title: __("Is selected"),
151
                                        },
155
                                        }),
152
                                        title: __("Is selected"),
156
                                    ]);
153
                                    }),
157
                                }
154
                                ]);
158
                                render(n, e);
159
                            }
160
                        );
161
                    },
162
                    initComplete: function () {
163
                        $.fn.dataTable.ext.search.push(
164
                            function apply_filter(
165
                                settings,
166
                                data,
167
                                dataIndex,
168
                                row
169
                            ) {
170
                                return (
171
                                    row.package.name.match(
172
                                        new RegExp(filters.package_name, "i")
173
                                    ) &&
174
                                    (filters.selection_type == 0 ||
175
                                        (filters.selection_type == 1 &&
176
                                            row.is_selected) ||
177
                                        (filters.selection_type == 2 &&
178
                                            !row.is_selected))
179
                                );
180
                            }
155
                            }
181
                        );
156
                            render(n, e);
182
                    },
157
                        }
158
                    );
159
                },
160
                initComplete: function () {
161
                    $.fn.dataTable.ext.search.push(
162
                        function apply_filter(settings, data, dataIndex, row) {
163
                            return (
164
                                row.package.name.match(
165
                                    new RegExp(filters.package_name, "i")
166
                                ) &&
167
                                (filters.selection_type == 0 ||
168
                                    (filters.selection_type == 1 &&
169
                                        row.is_selected) ||
170
                                    (filters.selection_type == 2 &&
171
                                        !row.is_selected))
172
                            );
173
                        }
174
                    );
183
                },
175
                },
184
            });
176
            });
185
        },
177
        },
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue (-27 / +26 lines)
Lines 5-40 Link Here
5
</template>
5
</template>
6
6
7
<script>
7
<script>
8
import { createVNode, render } from "vue";
8
import { createVNode, render } from "vue"
9
import { useDataTable } from "../../composables/datatables";
9
import { useDataTable } from "../../composables/datatables"
10
10
11
export default {
11
export default {
12
    setup() {
12
    setup() {
13
        const table_id = "package_list";
13
        const table_id = "package_list"
14
        useDataTable(table_id);
14
        useDataTable(table_id)
15
15
16
        return {
16
        return {
17
            table_id,
17
            table_id,
18
        };
18
        }
19
    },
19
    },
20
    data() {
20
    data() {
21
        return {};
21
        return {}
22
    },
22
    },
23
    methods: {
23
    methods: {
24
        show_resource: function (resource_id) {
24
        show_resource: function (resource_id) {
25
            this.$router.push({
25
            this.$router.push({
26
                name: "EHoldingsLocalResourcesShow",
26
                name: "EHoldingsLocalResourcesShow",
27
                params: { resource_id },
27
                params: { resource_id },
28
            });
28
            })
29
        },
29
        },
30
        build_datatable: function () {
30
        build_datatable: function () {
31
            let show_resource = this.show_resource;
31
            let show_resource = this.show_resource
32
            let router = this.$router;
32
            let router = this.$router
33
            let resources = this.resources;
33
            let resources = this.resources
34
            let table_id = this.table_id;
34
            let table_id = this.table_id
35
35
36
            $("#" + table_id).dataTable(
36
            $("#" + table_id).kohaTable({
37
                $.extend(true, {}, dataTablesDefaults, {
38
                    data: resources,
37
                    data: resources,
39
                    embed: ["package.name"],
38
                    embed: ["package.name"],
40
                    order: [[0, "asc"]],
39
                    order: [[0, "asc"]],
Lines 47-98 export default { Link Here
47
                            orderable: true,
46
                            orderable: true,
48
                            render: function (data, type, row, meta) {
47
                            render: function (data, type, row, meta) {
49
                                // Rendering done in drawCallback
48
                                // Rendering done in drawCallback
50
                                return "";
49
                                return ""
51
                            },
50
                            },
52
                            width: "100%",
51
                            width: "100%",
53
                        },
52
                        },
54
                    ],
53
                    ],
55
                    drawCallback: function (settings) {
54
                    drawCallback: function (settings) {
56
                        var api = new $.fn.dataTable.Api(settings);
55
                        var api = new $.fn.dataTable.Api(settings)
57
56
58
                        $.each(
57
                        $.each(
59
                            $(this).find("tbody tr td:first-child"),
58
                            $(this).find("tbody tr td:first-child"),
60
                            function (index, e) {
59
                            function (index, e) {
61
                                let tr = $(this).parent();
60
                                let tr = $(this).parent()
62
                                let row = api.row(tr).data();
61
                                let row = api.row(tr).data()
63
                                if (!row) return; // Happen if the table is empty
62
                                if (!row) return // Happen if the table is empty
64
                                let { href } = router.resolve({
63
                                let { href } = router.resolve({
65
                                    name: "EHoldingsLocalResourcesShow",
64
                                    name: "EHoldingsLocalResourcesShow",
66
                                    params: { resource_id: row.resource_id },
65
                                    params: { resource_id: row.resource_id },
67
                                });
66
                                })
68
                                let n = createVNode(
67
                                let n = createVNode(
69
                                    "a",
68
                                    "a",
70
                                    {
69
                                    {
71
                                        role: "button",
70
                                        role: "button",
72
                                        href,
71
                                        href,
73
                                        onClick: e => {
72
                                        onClick: e => {
74
                                            e.preventDefault();
73
                                            e.preventDefault()
75
                                            show_resource(row.resource_id);
74
                                            show_resource(row.resource_id)
76
                                        },
75
                                        },
77
                                    },
76
                                    },
78
                                    `${row.package.name}`
77
                                    `${row.package.name}`
79
                                );
78
                                )
80
                                render(n, e);
79
                                render(n, e)
81
                            }
80
                            }
82
                        );
81
                        )
83
                    },
82
                    },
84
                })
83
                })
85
            );
84
            )
86
        },
85
        },
87
    },
86
    },
88
    mounted() {
87
    mounted() {
89
        this.build_datatable();
88
        this.build_datatable()
90
    },
89
    },
91
    props: {
90
    props: {
92
        resources: Array,
91
        resources: Array,
93
    },
92
    },
94
    name: "EHoldingsLocalTitlePackagesList",
93
    name: "EHoldingsLocalTitlePackagesList",
95
};
94
}
96
</script>
95
</script>
97
96
98
<style scoped>
97
<style scoped>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormImport.vue (-61 / +52 lines)
Lines 82-151 export default { Link Here
82
            let lists = this.logged_in_user_lists;
82
            let lists = this.logged_in_user_lists;
83
            let table_id = this.table_id;
83
            let table_id = this.table_id;
84
            let import_from_list = this.import_from_list;
84
            let import_from_list = this.import_from_list;
85
            $("#" + table_id).dataTable(
85
            $("#" + table_id).kohaTable({
86
                $.extend(true, {}, dataTablesDefaults, {
86
                data: lists,
87
                    data: lists,
87
                order: [[0, "asc"]],
88
                    order: [[0, "asc"]],
88
                autoWidth: false,
89
                    autoWidth: false,
89
                columns: [
90
                    columns: [
90
                    {
91
                        {
91
                        title: __("Name"),
92
                            title: __("Name"),
92
                        data: "shelfname",
93
                            data: "shelfname",
93
                        searchable: true,
94
                            searchable: true,
94
                        orderable: true,
95
                            orderable: true,
95
                        width: "100%",
96
                            width: "100%",
96
                        render: function (data, type, row, meta) {
97
                            render: function (data, type, row, meta) {
97
                            return (
98
                                return (
98
                                row.shelfname + " (#" + row.shelfnumber + ")"
99
                                    row.shelfname +
99
                            );
100
                                    " (#" +
101
                                    row.shelfnumber +
102
                                    ")"
103
                                );
104
                            },
105
                        },
100
                        },
106
                        {
101
                    },
107
                            title: __("Actions"),
102
                    {
108
                            data: function (row, type, val, meta) {
103
                        title: __("Actions"),
109
                                return '<div class="actions"></div>';
104
                        data: function (row, type, val, meta) {
110
                            },
105
                            return '<div class="actions"></div>';
111
                            className: "actions noExport",
112
                            searchable: false,
113
                            orderable: false,
114
                        },
106
                        },
115
                    ],
107
                        className: "actions noExport",
116
                    drawCallback: function (settings) {
108
                        searchable: false,
117
                        var api = new $.fn.dataTable.Api(settings);
109
                        orderable: false,
118
110
                    },
119
                        $.each(
111
                ],
120
                            $(this).find("td .actions"),
112
                drawCallback: function (settings) {
121
                            function (index, e) {
113
                    var api = new $.fn.dataTable.Api(settings);
122
                                let tr = $(this).parent().parent();
123
                                let list_id = api.row(tr).data().shelfnumber;
124
                                let importButton = createVNode(
125
                                    "a",
126
                                    {
127
                                        class: "btn btn-default btn-xs",
128
                                        role: "button",
129
                                        onClick: () => {
130
                                            import_from_list(list_id);
131
                                        },
132
                                    },
133
                                    [
134
                                        createVNode("i", {
135
                                            class: "fa fa-download",
136
                                            "aria-hidden": "true",
137
                                        }),
138
                                        __("Import"),
139
                                    ]
140
                                );
141
114
142
                                let n = createVNode("span", {}, [importButton]);
115
                    $.each($(this).find("td .actions"), function (index, e) {
143
                                render(n, e);
116
                        let tr = $(this).parent().parent();
144
                            }
117
                        let list_id = api.row(tr).data().shelfnumber;
118
                        let importButton = createVNode(
119
                            "a",
120
                            {
121
                                class: "btn btn-default btn-xs",
122
                                role: "button",
123
                                onClick: () => {
124
                                    import_from_list(list_id);
125
                                },
126
                            },
127
                            [
128
                                createVNode("i", {
129
                                    class: "fa fa-download",
130
                                    "aria-hidden": "true",
131
                                }),
132
                                __("Import"),
133
                            ]
145
                        );
134
                        );
146
                    },
135
147
                })
136
                        let n = createVNode("span", {}, [importButton]);
148
            );
137
                        render(n, e);
138
                    });
139
                },
140
            });
149
        },
141
        },
150
    },
142
    },
151
    mounted() {
143
    mounted() {
152
- 

Return to bug 38255