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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt (-63 / +57 lines)
Lines 86-197 Link Here
86
    <script>
86
    <script>
87
        const ENABLE_OPAC_PAYMENTS = [% ENABLE_OPAC_PAYMENTS ? 1 : 0 | html %];
87
        const ENABLE_OPAC_PAYMENTS = [% ENABLE_OPAC_PAYMENTS ? 1 : 0 | html %];
88
    </script>
88
    </script>
89
90
    <script>
89
    <script>
91
        $( document ).ready(function() {
90
        $(document).ready(function () {
92
93
            var txtActivefilter = _("Filter paid transactions");
91
            var txtActivefilter = _("Filter paid transactions");
94
            var txtInactivefilter = _("Show all transactions");
92
            var txtInactivefilter = _("Show all transactions");
95
93
96
            var fines_table = $("#finestable").kohaTable({
94
            var fines_table = $("#finestable").kohaTable({
97
                ...(ENABLE_OPAC_PAYMENTS
95
                ...(ENABLE_OPAC_PAYMENTS ? { order: [[1, "desc"]] } : { order: [[0, "desc"]] }),
98
                    ? {order: [[ 1, "desc" ]]}
96
                dom: '<"#filter_p">',
99
                    : {order: [[ 0, "desc" ]]}
97
                responsive: {
100
                ),
98
                    details: { type: "column", target: -1 },
101
                 dom: '<"#filter_p">',
99
                },
102
                 responsive: {
100
                columnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }],
103
                    details: { "type": 'column',"target": -1 }
101
                drawCallback: function () {
104
                 },
102
                    show_hiddentfoot("#finestable");
105
                 columnDefs: [
103
                },
106
                    { className: 'dtr-control', orderable: false, targets: -1 }
104
            });
107
                 ],
108
                 drawCallback: function() {
109
                    show_hiddentfoot('#finestable');
110
                 }
111
            } );
112
105
113
            $('table[id^="finestable-"]').kohaTable({
106
            $('table[id^="finestable-"]').kohaTable({
114
                 responsive: {
107
                responsive: {
115
                    details: { "type": 'column',"target": -1 }
108
                    details: { type: "column", target: -1 },
116
                 },
109
                },
117
                 columnDefs: [
110
                columnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }],
118
                    { className: 'dtr-control', orderable: false, targets: -1 }
111
                drawCallback: function () {
119
                 ],
120
                 drawCallback: function() {
121
                    show_hiddentfoot('table[id^="finestable-"]');
112
                    show_hiddentfoot('table[id^="finestable-"]');
122
                 }
113
                },
123
            });
114
            });
124
115
125
            function show_hiddentfoot(selector) {
116
            function show_hiddentfoot(selector) {
126
                $('.finestable tfoot .sum').show();
117
                $(".finestable tfoot .sum").show();
127
                if ($(".finestable tfoot td.dtr-hidden").length > 0) {
118
                if ($(".finestable tfoot td.dtr-hidden").length > 0) {
128
                    $(selector+" tfoot th").removeAttr( "colspan" );
119
                    $(selector + " tfoot th").removeAttr("colspan");
129
                    $(".finestable tfoot .dtr-control").hide();
120
                    $(".finestable tfoot .dtr-control").hide();
130
                }
121
                }
131
            }
122
            }
132
            $("#filter_p").html('<p><a href="#" id="filter_paid"><i class="fa fa-filter" aria-hidden="true"></i> '+txtActivefilter+'</a>');
123
            $("#filter_p").html('<p><a href="#" id="filter_paid"><i class="fa fa-filter" aria-hidden="true"></i> ' + txtActivefilter + "</a>");
133
            $('#filter_paid').click(function(e) {
124
            $("#filter_paid").click(function (e) {
134
                e.preventDefault();
125
                e.preventDefault();
135
                let filteredValue = '';
126
                let filteredValue = "";
136
                if ($(this).hasClass('filtered')) {
127
                if ($(this).hasClass("filtered")) {
137
                    $(this).html('<i class="fa fa-filter" aria-hidden="true"></i> '+txtActivefilter);
128
                    $(this).html('<i class="fa fa-filter" aria-hidden="true"></i> ' + txtActivefilter);
138
                } else { //Not filtered. Let's do it!
129
                } else {
139
                    filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408
130
                    //Not filtered. Let's do it!
140
                    $(this).html('<i class="fa fa-filter" aria-hidden="true"></i> '+txtInactivefilter);
131
                    filteredValue = "^((?!0.00).*)$"; //Filter not matching 0.00 http://stackoverflow.com/a/406408
132
                    $(this).html('<i class="fa fa-filter" aria-hidden="true"></i> ' + txtInactivefilter);
141
                }
133
                }
142
                fines_table.DataTable().columns(-2).search(filteredValue, {regex: true}).draw();
134
                fines_table.DataTable().columns(-2).search(filteredValue, { regex: true }).draw();
143
                $(this).toggleClass('filtered');
135
                $(this).toggleClass("filtered");
144
            });
136
            });
145
137
146
            //Start filtered
138
            //Start filtered
147
            $('#filter_paid').click();
139
            $("#filter_paid").click();
148
140
149
            $(".pay-online").removeClass("hidden");
141
            $(".pay-online").removeClass("hidden");
150
142
151
            $("#amount-to-pay-label").hide();
143
            $("#amount-to-pay-label").hide();
152
144
153
            $(".checkbox-pay, input[name='payment_method']").change( function() {
145
            $(".checkbox-pay, input[name='payment_method']").change(function () {
154
                // Disable the pay button if no fees are selected
146
                // Disable the pay button if no fees are selected
155
                //$("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length );
147
                //$("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length );
156
148
157
                // Calculate the total amount to be paid based on selected fees
149
                // Calculate the total amount to be paid based on selected fees
158
                var total = 0;
150
                var total = 0;
159
                $(".checkbox-pay").each( function() {
151
                $(".checkbox-pay").each(function () {
160
                    if ( $(this).is(":checked") ) {
152
                    if ($(this).is(":checked")) {
161
                        var id = this.id.split("checkbox-pay-")[1];
153
                        var id = this.id.split("checkbox-pay-")[1];
162
                        total += parseFloat( $("#amount-" + id).val() );
154
                        total += parseFloat($("#amount-" + id).val());
163
                    }
155
                    }
164
                });
156
                });
165
157
166
                var p = Promise.resolve();
158
                var p = Promise.resolve();
167
                if ( total ) {
159
                if (total) {
168
                    p = Promise.all(
160
                    p = Promise.all(
169
                        $('input[name="payment_method"]').map(function() {
161
                        $('input[name="payment_method"]')
170
                            var self = this;
162
                            .map(function () {
171
                            return new Promise(function(resolve, reject) {
163
                                var self = this;
172
                                var threshold = $(self).data('threshold');
164
                                return new Promise(function (resolve, reject) {
173
                                var help = $(self).parent().siblings('.help-block');
165
                                    var threshold = $(self).data("threshold");
174
                                if(!threshold || threshold == '' || threshold <= total) {
166
                                    var help = $(self).parent().siblings(".help-block");
175
                                    $(self).prop('disabled', false);
167
                                    if (!threshold || threshold == "" || threshold <= total) {
176
                                    help.addClass('hide');
168
                                        $(self).prop("disabled", false);
177
                                } else {
169
                                        help.addClass("hide");
178
                                    $(self).prop('disabled', true);
170
                                    } else {
179
                                    help.html( _("Minimum amount needed by this service is %s").format(parseInt(threshold,10).toFixed(2)) ).removeClass('hide');
171
                                        $(self).prop("disabled", true);
180
                                }
172
                                        help.html(_("Minimum amount needed by this service is %s").format(parseInt(threshold, 10).toFixed(2))).removeClass("hide");
181
                                resolve();
173
                                    }
174
                                    resolve();
175
                                });
182
                            })
176
                            })
183
                        }).toArray()
177
                            .toArray()
184
                    );
178
                    );
185
179
186
                    $("#amount-to-pay").html( total.toFixed(2) );
180
                    $("#amount-to-pay").html(total.toFixed(2));
187
                    $("#amount-to-pay-label").show();
181
                    $("#amount-to-pay-label").show();
188
                } else {
182
                } else {
189
                    $('input[name="payment_method"]').prop('disabled', false).parent().siblings('.help-block').addClass('hide');
183
                    $('input[name="payment_method"]').prop("disabled", false).parent().siblings(".help-block").addClass("hide");
190
                    $("#amount-to-pay-label").hide();
184
                    $("#amount-to-pay-label").hide();
191
                }
185
                }
192
                p.then(function() {
186
                p.then(function () {
193
                    $("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length || ! $('input[name="payment_method"]:checked:not(:disabled)').length);
187
                    $("#submit-pay").prop("disabled", !$(".checkbox-pay:checked").length || !$('input[name="payment_method"]:checked:not(:disabled)').length);
194
                })
188
                });
195
            });
189
            });
196
        });
190
        });
197
    </script>
191
    </script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt (-39 / +37 lines)
Lines 419-431 Link Here
419
    [% IF ( TagsInputEnabled && loggedinusername ) %]
419
    [% IF ( TagsInputEnabled && loggedinusername ) %]
420
        <script>
420
        <script>
421
            function tagSelected() {
421
            function tagSelected() {
422
                var bibs = document.getElementById('records').value;
422
                var bibs = document.getElementById("records").value;
423
                if (bibs) {
423
                if (bibs) {
424
                    $("#tagsel_tag").hide();
424
                    $("#tagsel_tag").hide();
425
                    $("#tag_hides").hide();
425
                    $("#tag_hides").hide();
426
                    $("#tagsel_form").show();
426
                    $("#tagsel_form").show();
427
                } else {
427
                } else {
428
                    alert( _("No item was selected") );
428
                    alert(_("No item was selected"));
429
                }
429
                }
430
            }
430
            }
431
431
Lines 440-452 Link Here
440
            function tagAdded() {
440
            function tagAdded() {
441
                var checkedBoxes = $("input:checkbox:checked");
441
                var checkedBoxes = $("input:checkbox:checked");
442
                if (!$(checkedBoxes).size()) {
442
                if (!$(checkedBoxes).size()) {
443
                    alert( _("No item was selected") );
443
                    alert(_("No item was selected"));
444
                    return false;
444
                    return false;
445
                }
445
                }
446
446
447
                var tag = $("#tagsel_new").val();
447
                var tag = $("#tagsel_new").val();
448
                if (!tag || (tag == "")) {
448
                if (!tag || tag == "") {
449
                    alert( _("No tag was specified.") );
449
                    alert(_("No tag was specified."));
450
                    return false;
450
                    return false;
451
                }
451
                }
452
452
Lines 461-580 Link Here
461
            }
461
            }
462
        </script>
462
        </script>
463
    [% END # / TagsInputEnabled && loggedinusername %]
463
    [% END # / TagsInputEnabled && loggedinusername %]
464
465
    <script>
464
    <script>
466
        $(document).ready(function(){
465
        $(document).ready(function () {
467
            $("a.bib_opener").on('click',function(){
466
            $("a.bib_opener").on("click", function () {
468
                let link = this.dataset.link;
467
                let link = this.dataset.link;
469
                let biblionumber = this.dataset.biblionumber;
468
                let biblionumber = this.dataset.biblionumber;
470
                openBiblio(link,biblionumber)
469
                openBiblio(link, biblionumber);
471
            });
470
            });
472
471
473
            $(".brief").click(function(e){
472
            $(".brief").click(function (e) {
474
                e.preventDefault();
473
                e.preventDefault();
475
                showLess();
474
                showLess();
476
            });
475
            });
477
476
478
            $(".detail").click(function(e){
477
            $(".detail").click(function (e) {
479
                e.preventDefault();
478
                e.preventDefault();
480
                showMore();
479
                showMore();
481
            });
480
            });
482
481
483
            $(".send").click(function(e){
482
            $(".send").click(function (e) {
484
                e.preventDefault();
483
                e.preventDefault();
485
                sendBasket();
484
                sendBasket();
486
            });
485
            });
487
486
488
            $(".download-cart").on("click", function(e){
487
            $(".download-cart").on("click", function (e) {
489
                e.preventDefault();
488
                e.preventDefault();
490
                var format = $(this).data("format");
489
                var format = $(this).data("format");
491
                $("#download_format").val( format );
490
                $("#download_format").val(format);
492
                $("#download_cart").submit();
491
                $("#download_cart").submit();
493
            });
492
            });
494
493
495
            $(".empty").click(function(e){
494
            $(".empty").click(function (e) {
496
                e.preventDefault();
495
                e.preventDefault();
497
                delBasket();
496
                delBasket();
498
            });
497
            });
499
498
500
            $(".deleteshelf").click(function(e){
499
            $(".deleteshelf").click(function (e) {
501
                e.preventDefault();
500
                e.preventDefault();
502
                delSelRecords();
501
                delSelRecords();
503
            });
502
            });
504
503
505
            $(".newshelf").click(function(e){
504
            $(".newshelf").click(function (e) {
506
                e.preventDefault();
505
                e.preventDefault();
507
                addSelToShelf();
506
                addSelToShelf();
508
            });
507
            });
509
508
510
            $(".hold").click(function(e){
509
            $(".hold").click(function (e) {
511
                e.preventDefault();
510
                e.preventDefault();
512
                holdSel();
511
                holdSel();
513
            });
512
            });
514
513
515
            $("#tagsel_tag").click(function(e){
514
            $("#tagsel_tag").click(function (e) {
516
                e.preventDefault();
515
                e.preventDefault();
517
                tagSelected();
516
                tagSelected();
518
            });
517
            });
519
518
520
            $("#tagsel_button").click(function(e){
519
            $("#tagsel_button").click(function (e) {
521
                e.preventDefault();
520
                e.preventDefault();
522
                tagAdded();
521
                tagAdded();
523
            });
522
            });
524
523
525
            $("#tagsel_cancel").click(function(e){
524
            $("#tagsel_cancel").click(function (e) {
526
                e.preventDefault();
525
                e.preventDefault();
527
                tagCanceled();
526
                tagCanceled();
528
            });
527
            });
529
528
530
            $("#CheckAll").click(function(e){
529
            $("#CheckAll").click(function (e) {
531
                e.preventDefault();
530
                e.preventDefault();
532
                $(".cb").each(function(){
531
                $(".cb").each(function () {
533
                    $(this).prop("checked", true);
532
                    $(this).prop("checked", true);
534
                    selRecord(this.value, true);
533
                    selRecord(this.value, true);
535
                });
534
                });
536
                enableCheckboxActions();
535
                enableCheckboxActions();
537
            });
536
            });
538
537
539
            $("#CheckNone").click(function(e){
538
            $("#CheckNone").click(function (e) {
540
                e.preventDefault();
539
                e.preventDefault();
541
                $(".cb").each(function(){
540
                $(".cb").each(function () {
542
                    $(this).prop("checked", false);
541
                    $(this).prop("checked", false);
543
                    selRecord(this.value, false);
542
                    selRecord(this.value, false);
544
                });
543
                });
545
                enableCheckboxActions();
544
                enableCheckboxActions();
546
            });
545
            });
547
546
548
            if( $("#itemst").length > 0 ){
547
            if ($("#itemst").length > 0) {
549
                var itemst = $("#itemst").kohaTable({
548
                var itemst = $("#itemst").kohaTable({
550
                    order: [[1, "asc"]],
549
                    order: [[1, "asc"]],
551
                });
550
                });
552
551
553
                var buttons = new $.fn.dataTable.Buttons(itemst, {
552
                var buttons = new $.fn.dataTable.Buttons(itemst, {
554
                     buttons: [
553
                    buttons: ["print"],
555
                        'print'
554
                })
556
                    ]
555
                    .container()
557
                }).container().appendTo($('#toolbar'));
556
                    .appendTo($("#toolbar"));
558
            }
557
            }
559
558
560
            $(".cb").change(function(){
559
            $(".cb").change(function () {
561
                selRecord( $(this).val(), $(this).prop("checked") );
560
                selRecord($(this).val(), $(this).prop("checked"));
562
                enableCheckboxActions();
561
                enableCheckboxActions();
563
                return false;
562
                return false;
564
            });
563
            });
565
            enableCheckboxActions();
564
            enableCheckboxActions();
566
567
        });
565
        });
568
566
569
        function enableCheckboxActions(){
567
        function enableCheckboxActions() {
570
            // Enable/disable controls if checkboxes are checked
568
            // Enable/disable controls if checkboxes are checked
571
            var checkedBoxes = $(".cb:checked");
569
            var checkedBoxes = $(".cb:checked");
572
            if ( checkedBoxes.length ) {
570
            if (checkedBoxes.length) {
573
              $(".selections").html(_("With selected titles: "));
571
                $(".selections").html(_("With selected titles: "));
574
              $(".selections-toolbar .links a").removeClass("disabled").attr("aria-disabled", "false");
572
                $(".selections-toolbar .links a").removeClass("disabled").attr("aria-disabled", "false");
575
            } else {
573
            } else {
576
              $(".selections").html(_("Select titles to: "));
574
                $(".selections").html(_("Select titles to: "));
577
              $(".selections-toolbar .links a").addClass("disabled").attr("aria-disabled", "true");
575
                $(".selections-toolbar .links a").addClass("disabled").attr("aria-disabled", "true");
578
            }
576
            }
579
        }
577
        }
580
    </script>
578
    </script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt (-5 / +2 lines)
Lines 141-149 Link Here
141
    <script>
141
    <script>
142
        table_settings = [% TablesSettings.GetTableSettings( 'opac', 'course_items', 'course-items-table', 'json' ) | $raw %];
142
        table_settings = [% TablesSettings.GetTableSettings( 'opac', 'course_items', 'course-items-table', 'json' ) | $raw %];
143
    </script>
143
    </script>
144
145
    <script>
144
    <script>
146
        $(document).ready(function() {
145
        $(document).ready(function () {
147
            $("#course-items-table").kohaTable(
146
            $("#course-items-table").kohaTable(
148
                {
147
                {
149
                    dom: '<"top"<"table_controls"f>>rt<"clear">',
148
                    dom: '<"top"<"table_controls"f>>rt<"clear">',
Lines 155-163 Link Here
155
                    responsive: {
154
                    responsive: {
156
                        details: { type: "column", target: -1 },
155
                        details: { type: "column", target: -1 },
157
                    },
156
                    },
158
                    columnDefs: [
157
                    columnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }],
159
                        { className: "dtr-control", orderable: false, targets: -1 },
160
                    ],
161
                },
158
                },
162
                table_settings
159
                table_settings
163
            );
160
            );
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt (-5 / +2 lines)
Lines 86-94 Link Here
86
    <script>
86
    <script>
87
        table_settings = [% TablesSettings.GetTableSettings( 'opac', 'course_list', 'course_reserves_table', 'json' ) | $raw %]
87
        table_settings = [% TablesSettings.GetTableSettings( 'opac', 'course_list', 'course_reserves_table', 'json' ) | $raw %]
88
    </script>
88
    </script>
89
90
    <script>
89
    <script>
91
        $(document).ready(function() {
90
        $(document).ready(function () {
92
            $("#course_reserves_table").kohaTable(
91
            $("#course_reserves_table").kohaTable(
93
                {
92
                {
94
                    dom: '<"top"<"table_controls"f>>rt<"clear">',
93
                    dom: '<"top"<"table_controls"f>>rt<"clear">',
Lines 101-109 Link Here
101
                    responsive: {
100
                    responsive: {
102
                        details: { type: "column", target: -1 },
101
                        details: { type: "column", target: -1 },
103
                    },
102
                    },
104
                    cColumnDefs: [
103
                    cColumnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }],
105
                        { className: "dtr-control", orderable: false, targets: -1 },
106
                    ],
107
                },
104
                },
108
                table_settings
105
                table_settings
109
            );
106
            );
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-curbside-pickups.tt (-93 / +97 lines)
Lines 322-339 Link Here
322
            [% END %]
322
            [% END %]
323
        [% END %]
323
        [% END %]
324
    </script>
324
    </script>
325
326
    <script>
325
    <script>
327
        let existingPickupMoments = [];
326
        let existingPickupMoments = [];
328
        pickups.forEach(function(pickup){
327
        pickups.forEach(function (pickup) {
329
            let scheduled_pickup_datetime = pickup.scheduled_pickup_datetime;
328
            let scheduled_pickup_datetime = pickup.scheduled_pickup_datetime;
330
            let pickupMoment = dayjs(scheduled_pickup_datetime);
329
            let pickupMoment = dayjs(scheduled_pickup_datetime);
331
330
332
            if(!existingPickupMoments[pickup.branchcode]) existingPickupMoments[pickup.branchcode] = [];
331
            if (!existingPickupMoments[pickup.branchcode]) existingPickupMoments[pickup.branchcode] = [];
333
            existingPickupMoments[pickup.branchcode].push(pickupMoment);
332
            existingPickupMoments[pickup.branchcode].push(pickupMoment);
334
        });
333
        });
335
334
336
        $(document).ready(function() {
335
        $(document).ready(function () {
337
            $("#pickups-table").kohaTable({
336
            $("#pickups-table").kohaTable({
338
                searching: false,
337
                searching: false,
339
                paging: false,
338
                paging: false,
Lines 343-350 Link Here
343
                },
342
                },
344
                columnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }],
343
                columnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }],
345
            });
344
            });
346
            $("#pickup-branch option").each(function(){
345
            $("#pickup-branch option").each(function () {
347
                if ( $(this).val() != "" && !policies[$(this).val()].enabled ) {
346
                if ($(this).val() != "" && !policies[$(this).val()].enabled) {
348
                    $(this).prop("disabled", "disabled");
347
                    $(this).prop("disabled", "disabled");
349
                    $(this).attr("title", _("You don't have waiting holds at this library"));
348
                    $(this).attr("title", _("You don't have waiting holds at this library"));
350
                }
349
                }
Lines 352-386 Link Here
352
351
353
            const pickupDate_fp = document.getElementById("pickup-date")._flatpickr;
352
            const pickupDate_fp = document.getElementById("pickup-date")._flatpickr;
354
353
355
            $('#pickup-branch').on('change', function() {
354
            $("#pickup-branch").on("change", function () {
356
                let branchcode = $(this).val();
355
                let branchcode = $(this).val();
357
356
358
                let existing_pickup = pickup_exists_in.indexOf(branchcode) != -1;
357
                let existing_pickup = pickup_exists_in.indexOf(branchcode) != -1;
359
358
360
                $('#pickup-date').val("");
359
                $("#pickup-date").val("");
361
                $('#pickup-time').val("");
360
                $("#pickup-time").val("");
362
                $('#pickup-times').hide();
361
                $("#pickup-times").hide();
363
                $('#schedule-pickup-button').prop('disabled', true);
362
                $("#schedule-pickup-button").prop("disabled", true);
364
363
365
                if (existing_pickup) {
364
                if (existing_pickup) {
366
                    $('#existing-pickup-warning').show();
365
                    $("#existing-pickup-warning").show();
367
                    $("#pickup-date,#pickup_date_item,#pickup_notes_item").hide();
366
                    $("#pickup-date,#pickup_date_item,#pickup_notes_item").hide();
368
                } else {
367
                } else {
369
                    $('#existing-pickup-warning').hide();
368
                    $("#existing-pickup-warning").hide();
370
                    $("#pickup-date,#pickup_date_item").show();
369
                    $("#pickup-date,#pickup_date_item").show();
371
                }
370
                }
372
371
373
                pickupDate_fp.set('disable', [function(date) {
372
                pickupDate_fp.set("disable", [
374
                    return !policies[branchcode].slots_per_day.hasOwnProperty(date.getDay());
373
                    function (date) {
375
                }]);
374
                        return !policies[branchcode].slots_per_day.hasOwnProperty(date.getDay());
376
375
                    },
376
                ]);
377
            });
377
            });
378
378
379
            pickupDate_fp.config.onClose.push(function( selectedDates, dateStr, instance ){
379
            pickupDate_fp.config.onClose.push(function (selectedDates, dateStr, instance) {
380
                /* Here we add an onClose event to the existing flatpickr instance */
380
                /* Here we add an onClose event to the existing flatpickr instance */
381
                /* It fires after the user has selected a date from the calendar popup */
381
                /* It fires after the user has selected a date from the calendar popup */
382
                $('#pickup-times').html("<label>" + _("Select a time") + ":</label><div id=\"pickup-time-slots\"></div>");
382
                $("#pickup-times").html("<label>" + _("Select a time") + ':</label><div id="pickup-time-slots"></div>');
383
                $('#schedule-pickup-button').prop( 'disabled', 1 );
383
                $("#schedule-pickup-button").prop("disabled", 1);
384
384
385
                var currentDate = dateStr;
385
                var currentDate = dateStr;
386
                let branchcode = $("#pickup-branch").val();
386
                let branchcode = $("#pickup-branch").val();
Lines 391-472 Link Here
391
                let pickupSlots = [];
391
                let pickupSlots = [];
392
                let available_count = 0;
392
                let available_count = 0;
393
                let dow = selectedDate.day(); // Sunday is 0 (at least for now)
393
                let dow = selectedDate.day(); // Sunday is 0 (at least for now)
394
                if (!policy.slots_per_day[dow]){
394
                if (!policy.slots_per_day[dow]) {
395
                    $('#pickup-times').html("<div>"+_("No pickup time defined for this day.")+"</div>");
395
                    $("#pickup-times").html("<div>" + _("No pickup time defined for this day.") + "</div>");
396
                    return;
396
                    return;
397
                }
397
                }
398
398
399
                policy.slots_per_day[dow].sort((a, b) => a.start_hour - b.start_hour).forEach(function(slot){
399
                policy.slots_per_day[dow]
400
                    let pickup_interval = policy.pickup_interval;
400
                    .sort((a, b) => a.start_hour - b.start_hour)
401
                    if (!pickup_interval) {
401
                    .forEach(function (slot) {
402
                        $('#pickup-times').html("<div>"+_("No pickup time defined for this day.")+"</div>");
402
                        let pickup_interval = policy.pickup_interval;
403
                        return;
403
                        if (!pickup_interval) {
404
                    }
404
                            $("#pickup-times").html("<div>" + _("No pickup time defined for this day.") + "</div>");
405
405
                            return;
406
                    let listStartMoment = selectedDate.hour(slot.start_hour).minute(slot.start_minute);
407
                    let listEndMoment = selectedDate.hour(slot.end_hour).minute(slot.end_minute);
408
409
                    let keep_going = true;
410
                    let now = dayjs();
411
412
                    // Initialize pickup slots starting at opening time
413
                    let pickupIntervalStartMoment = listStartMoment;
414
                    let pickupIntervalEndMoment   = listStartMoment.add(pickup_interval, 'minutes');
415
                    while (keep_going) {
416
                        let available = true;
417
                        let display_slot = true;
418
419
                        if (pickupIntervalStartMoment.isBefore(now)) {
420
                            // Slots in the past are unavailable
421
                            available = false;
422
                            display_slot = false;
423
                        }
424
425
                        if (pickupIntervalEndMoment.isAfter(listEndMoment)) {
426
                            // Slots after the end of pickup times for the day are unavailable
427
                            available = false;
428
                        }
429
430
                        let pickups_scheduled = 0;
431
432
                        if (existingPickupMoments[branchcode]){
433
                            existingPickupMoments[branchcode].forEach(function(pickupMoment){
434
                                // An existing pickup time
435
                                if (pickupMoment.isSameOrAfter(pickupIntervalStartMoment) && pickupMoment.isBefore(pickupIntervalEndMoment)) {
436
                                    // This calculated pickup is in use by another scheduled pickup
437
                                    pickups_scheduled++;
438
                                }
439
                            });
440
                        }
441
442
                        if (pickups_scheduled >= policy.patrons_per_interval) {
443
                            available = false;
444
                        }
445
446
                        if ( display_slot ) {
447
                            pickupSlots.push(
448
                                {
449
                                    "available": available,
450
                                    "moment": pickupIntervalStartMoment,
451
                                    "pickups_scheduled": pickups_scheduled
452
                                }
453
                            );
454
                        }
455
456
                        if ( available ) {
457
                            available_count++;
458
                        }
406
                        }
459
407
460
                        pickupIntervalStartMoment = pickupIntervalEndMoment;
408
                        let listStartMoment = selectedDate.hour(slot.start_hour).minute(slot.start_minute);
461
                        pickupIntervalEndMoment = pickupIntervalStartMoment.add(pickup_interval, 'minutes');
409
                        let listEndMoment = selectedDate.hour(slot.end_hour).minute(slot.end_minute);
462
                        if (pickupIntervalEndMoment.isAfter(listEndMoment)) {
410
463
                            // This latest slot is after the end of pickup times for the day, so we can stop
411
                        let keep_going = true;
464
                            keep_going = false;
412
                        let now = dayjs();
413
414
                        // Initialize pickup slots starting at opening time
415
                        let pickupIntervalStartMoment = listStartMoment;
416
                        let pickupIntervalEndMoment = listStartMoment.add(pickup_interval, "minutes");
417
                        while (keep_going) {
418
                            let available = true;
419
                            let display_slot = true;
420
421
                            if (pickupIntervalStartMoment.isBefore(now)) {
422
                                // Slots in the past are unavailable
423
                                available = false;
424
                                display_slot = false;
425
                            }
426
427
                            if (pickupIntervalEndMoment.isAfter(listEndMoment)) {
428
                                // Slots after the end of pickup times for the day are unavailable
429
                                available = false;
430
                            }
431
432
                            let pickups_scheduled = 0;
433
434
                            if (existingPickupMoments[branchcode]) {
435
                                existingPickupMoments[branchcode].forEach(function (pickupMoment) {
436
                                    // An existing pickup time
437
                                    if (pickupMoment.isSameOrAfter(pickupIntervalStartMoment) && pickupMoment.isBefore(pickupIntervalEndMoment)) {
438
                                        // This calculated pickup is in use by another scheduled pickup
439
                                        pickups_scheduled++;
440
                                    }
441
                                });
442
                            }
443
444
                            if (pickups_scheduled >= policy.patrons_per_interval) {
445
                                available = false;
446
                            }
447
448
                            if (display_slot) {
449
                                pickupSlots.push({
450
                                    available: available,
451
                                    moment: pickupIntervalStartMoment,
452
                                    pickups_scheduled: pickups_scheduled,
453
                                });
454
                            }
455
456
                            if (available) {
457
                                available_count++;
458
                            }
459
460
                            pickupIntervalStartMoment = pickupIntervalEndMoment;
461
                            pickupIntervalEndMoment = pickupIntervalStartMoment.add(pickup_interval, "minutes");
462
                            if (pickupIntervalEndMoment.isAfter(listEndMoment)) {
463
                                // This latest slot is after the end of pickup times for the day, so we can stop
464
                                keep_going = false;
465
                            }
465
                        }
466
                        }
466
                    }
467
467
468
                    $('#schedule-pickup-button').prop( 'disabled', available_count <= 0 );
468
                        $("#schedule-pickup-button").prop("disabled", available_count <= 0);
469
                });
469
                    });
470
470
471
                for (let i = 0; i < pickupSlots.length; i++) {
471
                for (let i = 0; i < pickupSlots.length; i++) {
472
                    let pickupSlot = pickupSlots[i];
472
                    let pickupSlot = pickupSlots[i];
Lines 475-481 Link Here
475
                    let pickups_scheduled = pickupSlot.pickups_scheduled;
475
                    let pickups_scheduled = pickupSlot.pickups_scheduled;
476
                    let pickups_available = policy.patrons_per_interval - pickups_scheduled;
476
                    let pickups_available = policy.patrons_per_interval - pickups_scheduled;
477
                    let disabled = pickupSlot.available ? "" : "disabled";
477
                    let disabled = pickupSlot.available ? "" : "disabled";
478
                    $("#pickup-time-slots").append(`<span class="pickup_time"><input type="radio" id="slot_${i}" name="pickup_time" value="${optValue}" ${disabled} /> <label class="pickup_select" for="slot_${i}" data-bs-toggle="tooltip" title="` + _("Appointments available: ") + `${pickups_available}">${optText} <span class="pickups_available">${pickups_available}</span></label></span>`);
478
                    $("#pickup-time-slots").append(
479
                        `<span class="pickup_time"><input type="radio" id="slot_${i}" name="pickup_time" value="${optValue}" ${disabled} /> <label class="pickup_select" for="slot_${i}" data-bs-toggle="tooltip" title="` +
480
                            _("Appointments available: ") +
481
                            `${pickups_available}">${optText} <span class="pickups_available">${pickups_available}</span></label></span>`
482
                    );
479
                }
483
                }
480
484
481
                $("#pickup_notes_item,#pickup-times").show();
485
                $("#pickup_notes_item,#pickup-times").show();
Lines 483-497 Link Here
483
487
484
            $("#pickup_date_item,#pickup_notes_item,#pickup-times").hide();
488
            $("#pickup_date_item,#pickup_notes_item,#pickup-times").hide();
485
489
486
            $("#create-pickup").on('submit', function(){
490
            $("#create-pickup").on("submit", function () {
487
                if ( ! $("input[type='radio']:checked").length ) {
491
                if (!$("input[type='radio']:checked").length) {
488
                    alert(_("Please select a date and a pickup time"));
492
                    alert(_("Please select a date and a pickup time"));
489
                    return false;
493
                    return false;
490
                }
494
                }
491
                return true;
495
                return true;
492
            });
496
            });
493
            $("#pickup-times").tooltip({
497
            $("#pickup-times").tooltip({
494
                selector: ".pickup_select"
498
                selector: ".pickup_select",
495
            });
499
            });
496
        });
500
        });
497
    </script>
501
    </script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-3 lines)
Lines 1699-1705 Link Here
1699
1699
1700
        const defaulttab = "[% defaulttab | html %]";
1700
        const defaulttab = "[% defaulttab | html %]";
1701
    </script>
1701
    </script>
1702
1703
    <script>
1702
    <script>
1704
        window.emojiPicker = new EmojiPicker({
1703
        window.emojiPicker = new EmojiPicker({
1705
        emojiable_selector: '[data-emojiable=true]',
1704
        emojiable_selector: '[data-emojiable=true]',
Lines 2246-2252 Link Here
2246
2245
2247
        }
2246
        }
2248
    </script>
2247
    </script>
2249
2250
    [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
2248
    [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
2251
        <script>
2249
        <script>
2252
            $(document).ready(function() {
2250
            $(document).ready(function() {
Lines 2267-2271 Link Here
2267
            });
2265
            });
2268
        </script>
2266
        </script>
2269
    [% END %]
2267
    [% END %]
2270
2271
[% END %]
2268
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt (-53 / +56 lines)
Lines 193-222 Link Here
193
    <script>
193
    <script>
194
        const min_year = "[% yearmin | html %]";
194
        const min_year = "[% yearmin | html %]";
195
    </script>
195
    </script>
196
197
    <script>
196
    <script>
198
        $(document).ready(function(){
197
        $(document).ready(function () {
199
            showlayer(min_year);
198
            showlayer(min_year);
200
            $("a.tabsubs:first").addClass("currentsubtab");
199
            $("a.tabsubs:first").addClass("currentsubtab");
201
            $("#filterform").submit(function(){
200
            $("#filterform").submit(function () {
202
                filterByLibrary();
201
                filterByLibrary();
203
                return false;
202
                return false;
204
            });
203
            });
205
            $("#libraryfilter").change(function(){
204
            $("#libraryfilter").change(function () {
206
                filterByLibrary();
205
                filterByLibrary();
207
            });
206
            });
208
            $("#subscriptionidfilter").change(function(){
207
            $("#subscriptionidfilter").change(function () {
209
                filterBySubscriptionId();
208
                filterBySubscriptionId();
210
            });
209
            });
211
            $("#reset").click(function(){
210
            $("#reset").click(function () {
212
                clearFilters();
211
                clearFilters();
213
            });
212
            });
214
            $("a.tabsubs").on("click", function(e){
213
            $("a.tabsubs").on("click", function (e) {
215
                e.preventDefault();
214
                e.preventDefault();
216
                let year = $(this).data("year");
215
                let year = $(this).data("year");
217
                $("a.tabsubs").removeClass("currentsubtab");
216
                $("a.tabsubs").removeClass("currentsubtab");
218
                $(this).addClass("currentsubtab");
217
                $(this).addClass("currentsubtab");
219
                showlayer( year );
218
                showlayer(year);
220
            });
219
            });
221
            $(".subscriptionstclass").kohaTable({
220
            $(".subscriptionstclass").kohaTable({
222
                order: [[0, "desc"]],
221
                order: [[0, "desc"]],
Lines 230-302 Link Here
230
229
231
            // Getting each branchcode from the currently displayed tab
230
            // Getting each branchcode from the currently displayed tab
232
            var subarray = [];
231
            var subarray = [];
233
            $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.libraryfilterclass").each(function() {
232
            $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.libraryfilterclass").each(function () {
234
                if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
233
                if (subarray.indexOf($(this).text()) == -1) {
234
                    subarray.push($(this).text());
235
                }
235
            });
236
            });
236
237
237
            // Setting the option values with branchcodes
238
            // Setting the option values with branchcodes
238
            $("#libraryfilter").append('<option value="all">'+_("(All)")+'</option>');
239
            $("#libraryfilter").append('<option value="all">' + _("(All)") + "</option>");
239
            for (var i = 0; i < subarray.length; i++) {
240
            for (var i = 0; i < subarray.length; i++) {
240
                $("#libraryfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
241
                $("#libraryfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + "</option>");
241
            }
242
            }
242
        }
243
        }
243
244
244
        // Filter by Library
245
        // Filter by Library
245
        function filterByLibrary() {
246
        function filterByLibrary() {
246
247
            selectedStatus = $("#libraryfilter").val();
247
            selectedStatus = $("#libraryfilter").val();
248
248
249
            // Reset the filters but keeps the selected library
249
            // Reset the filters but keeps the selected library
250
            clearFilters(true);
250
            clearFilters(true);
251
251
252
            if (selectedStatus != 'all') {
252
            if (selectedStatus != "all") {
253
254
                // We hide everything
253
                // We hide everything
255
            $("table.subscriptionstclass tbody tr").hide();
254
                $("table.subscriptionstclass tbody tr").hide();
256
255
257
            // Then show the lines that match the currently selected library
256
                // Then show the lines that match the currently selected library
258
            $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedStatus + ")").parent().show();
257
                $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedStatus + ")")
258
                    .parent()
259
                    .show();
259
260
261
                // We then prepare the subscription filter :
260
262
261
            // We then prepare the subscription filter :
263
                // Getting subscription id's for the selected library
262
264
                var subarray = [];
263
            // Getting subscription id's for the selected library
265
                $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.subscriptionidfilterclass").each(function () {
264
            var subarray = [];
266
                    if (subarray.indexOf($(this).text()) == -1) {
265
            $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.subscriptionidfilterclass").each(function() {
267
                        subarray.push($(this).text());
266
                if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
268
                    }
267
            });
269
                });
268
            // Setting the option values with subscription id's
270
                // Setting the option values with subscription id's
269
            $("#subscriptionidfilter").append('<option value="all">'+_("(All)")+'</option>');
271
                $("#subscriptionidfilter").append('<option value="all">' + _("(All)") + "</option>");
270
            for (var i = 0; i < subarray.length; i++) {
272
                for (var i = 0; i < subarray.length; i++) {
271
                $("#subscriptionidfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
273
                    $("#subscriptionidfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + "</option>");
272
            }
274
                }
273
275
274
            // Subscription filtering is now ready
276
                // Subscription filtering is now ready
275
            $("#subscriptionidfilter").removeAttr("disabled");
277
                $("#subscriptionidfilter").removeAttr("disabled");
276
            }
278
            }
277
        }
279
        }
278
280
279
        // Filter by subscription id
281
        // Filter by subscription id
280
        function filterBySubscriptionId() {
282
        function filterBySubscriptionId() {
281
282
            selectedSubscription = $("#subscriptionidfilter").val();
283
            selectedSubscription = $("#subscriptionidfilter").val();
283
            selectedLibrary      = $("#libraryfilter").val();
284
            selectedLibrary = $("#libraryfilter").val();
284
285
285
            if (selectedSubscription == "all") {
286
            if (selectedSubscription == "all") {
286
            clearFilters(true);
287
                clearFilters(true);
287
            filterByLibrary();
288
                filterByLibrary();
288
            } else {
289
            } else {
290
                // We hide everything
291
                $("table.subscriptionstclass tbody tr").hide();
289
292
290
            // We hide everything
293
                // Then show the lines that match the currently selected library
291
            $("table.subscriptionstclass tbody tr").hide();
294
                $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedLibrary + ")")
292
295
                    .parent()
293
            // Then show the lines that match the currently selected library
296
                    .show();
294
            $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedLibrary + ")").parent().show();
295
297
296
            // Then hide the lines where the subscription id does not match the selected one
298
                // Then hide the lines where the subscription id does not match the selected one
297
            $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass").not(
299
                $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass")
298
                $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass:contains(" + selectedSubscription + ")")
300
                    .not($("table.subscriptionstclass tbody tr td.subscriptionidfilterclass:contains(" + selectedSubscription + ")"))
299
            ).parent().hide();
301
                    .parent()
302
                    .hide();
300
            }
303
            }
301
        }
304
        }
302
305
Lines 308-330 Link Here
308
311
309
            // Remove old subscription options
312
            // Remove old subscription options
310
            $("#subscriptionidfilter option").remove();
313
            $("#subscriptionidfilter option").remove();
311
            $("#subscriptionidfilter option").append('<option value="all">'+_("(All)")+'</option>');
314
            $("#subscriptionidfilter option").append('<option value="all">' + _("(All)") + "</option>");
312
            $("#subscriptionidfilter").attr("disabled", "disabled");
315
            $("#subscriptionidfilter").attr("disabled", "disabled");
313
316
314
            if (keeplibrary != true) {
317
            if (keeplibrary != true) {
315
            // Reinit library options
318
                // Reinit library options
316
            initFilters();
319
                initFilters();
317
            $("#libraryfilter option[value=all]").attr("selected", "selected");
320
                $("#libraryfilter option[value=all]").attr("selected", "selected");
318
            }
321
            }
319
        }
322
        }
320
323
321
        function showlayer(numlayer){
324
        function showlayer(numlayer) {
322
            $(".yeardata").each(function(){
325
            $(".yeardata").each(function () {
323
                ong = $(this).attr("id");
326
                ong = $(this).attr("id");
324
                if(ong == "show"+numlayer){
327
                if (ong == "show" + numlayer) {
325
                    $(this).show();
328
                    $(this).show();
326
                    currentYear = ong;
329
                    currentYear = ong;
327
                } else  {
330
                } else {
328
                    $(this).hide();
331
                    $(this).hide();
329
                }
332
                }
330
            });
333
            });
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-36 / +33 lines)
Lines 422-523 Link Here
422
            var metadata = "[% metadata | $raw %]";
422
            var metadata = "[% metadata | $raw %]";
423
        [% END %]
423
        [% END %]
424
    </script>
424
    </script>
425
426
    <script>
425
    <script>
427
        function display_extended_attribute(row, type) {
426
        function display_extended_attribute(row, type) {
428
            var arr = $.grep(row.extended_attributes, ( x => x.type === type ));
427
            var arr = $.grep(row.extended_attributes, x => x.type === type);
429
            if (arr.length > 0) {
428
            if (arr.length > 0) {
430
                return escape_str(arr[0].value);
429
                return escape_str(arr[0].value);
431
            }
430
            }
432
431
433
            return '';
432
            return "";
434
        }
433
        }
435
434
436
        function display_request_status(row) {
435
        function display_request_status(row) {
437
            let status       = row._strings.status.str;
436
            let status = row._strings.status.str;
438
            let status_alias = row._strings.status_av ?
437
            let status_alias = row._strings.status_av ? (row._strings.status_av.str ? row._strings.status_av.str : row._strings.status_av.code) : null;
439
                                    row._strings.status_av.str ?
440
                                        row._strings.status_av.str :
441
                                    row._strings.status_av.code :
442
                               null;
443
438
444
            let status_label = status + (status_alias ? " <i><strong>"+status_alias+"</strong></i>" : "");
439
            let status_label = status + (status_alias ? " <i><strong>" + status_alias + "</strong></i>" : "");
445
440
446
            return status_label;
441
            return status_label;
447
        }
442
        }
448
        $("#illrequestlist").kohaTable({
443
        $("#illrequestlist").kohaTable({
449
            order: [[ 0, "desc" ]],
444
            order: [[0, "desc"]],
450
            dom: '<"dt-info"i><"top pager"<"table_entries"lp>t<"bottom pager"pi>',
445
            dom: '<"dt-info"i><"top pager"<"table_entries"lp>t<"bottom pager"pi>',
451
            paging: true,
446
            paging: true,
452
            embed: ['+strings','extended_attributes'],
447
            embed: ["+strings", "extended_attributes"],
453
            ajax: { url: `/api/v1/public/patrons/${logged_in_user_borrowernumber}/ill/requests` },
448
            ajax: { url: `/api/v1/public/patrons/${logged_in_user_borrowernumber}/ill/requests` },
454
            columnDefs: [ {
449
            columnDefs: [
455
                render: function (data, type, row, meta) {
450
                {
456
                    if ( data && type == 'display' ) {
451
                    render: function (data, type, row, meta) {
457
                        return data.escapeHtml();
452
                        if (data && type == "display") {
458
                    }
453
                            return data.escapeHtml();
459
                    return data;
454
                        }
460
                }
455
                        return data;
461
            } ],
456
                    },
457
                },
458
            ],
462
            columns: [
459
            columns: [
463
                {
460
                {
464
                    data: 'ill_request_id',
461
                    data: "ill_request_id",
465
                    sortable: true
462
                    sortable: true,
466
                },
463
                },
467
                {
464
                {
468
                    data: 'author',
465
                    data: "author",
469
                    sortable: false,
466
                    sortable: false,
470
                    render: (data, type, row, meta) => {
467
                    render: (data, type, row, meta) => {
471
                        return display_extended_attribute(row, 'author');
468
                        return display_extended_attribute(row, "author");
472
                    },
469
                    },
473
                },
470
                },
474
                {
471
                {
475
                    data: 'title',
472
                    data: "title",
476
                    sortable: false,
473
                    sortable: false,
477
                    render: (data, type, row, meta) => {
474
                    render: (data, type, row, meta) => {
478
                        return display_extended_attribute(row, 'title');
475
                        return display_extended_attribute(row, "title");
479
                    },
476
                    },
480
                },
477
                },
481
                {
478
                {
482
                    data: 'ill_backend_id',
479
                    data: "ill_backend_id",
483
                    sortable: true
480
                    sortable: true,
484
                },
481
                },
485
                {
482
                {
486
                    data: 'type',
483
                    data: "type",
487
                    sortable: false,
484
                    sortable: false,
488
                    render: (data, type, row, meta) => {
485
                    render: (data, type, row, meta) => {
489
                        return display_extended_attribute(row, 'type');
486
                        return display_extended_attribute(row, "type");
490
                    },
487
                    },
491
                },
488
                },
492
                {
489
                {
493
                    data: 'status',
490
                    data: "status",
494
                    sortable: true,
491
                    sortable: true,
495
                    render: (data, type, row, meta) => {
492
                    render: (data, type, row, meta) => {
496
                        return display_request_status(row);
493
                        return display_request_status(row);
497
                    },
494
                    },
498
                },
495
                },
499
                {
496
                {
500
                    data: 'requested_date',
497
                    data: "requested_date",
501
                    sortable: true,
498
                    sortable: true,
502
                    render: (data, type, row, meta) => {
499
                    render: (data, type, row, meta) => {
503
                        return $date(data);
500
                        return $date(data);
504
                    },
501
                    },
505
                },
502
                },
506
                {
503
                {
507
                    data: 'timestamp',
504
                    data: "timestamp",
508
                    sortable: true,
505
                    sortable: true,
509
                    render: (data, type, row, meta) => {
506
                    render: (data, type, row, meta) => {
510
                        return $date(data);
507
                        return $date(data);
511
                    },
508
                    },
512
                },
509
                },
513
                {
510
                {
514
                    data: '',
511
                    data: "",
515
                    sortable: false,
512
                    sortable: false,
516
                    render: (data, type, row, meta) => {
513
                    render: (data, type, row, meta) => {
517
                        return `<a href="/cgi-bin/koha/opac-illrequests.pl?op=view&amp;illrequest_id=${row.ill_request_id}" class="btn btn-primary btn-sm">View</a>`;
514
                        return `<a href="/cgi-bin/koha/opac-illrequests.pl?op=view&amp;illrequest_id=${row.ill_request_id}" class="btn btn-primary btn-sm">View</a>`;
518
                    },
515
                    },
519
                }
516
                },
520
            ]
517
            ],
521
        });
518
        });
522
        $("#backend-dropdown-options").removeClass("nojs");
519
        $("#backend-dropdown-options").removeClass("nojs");
523
    </script>
520
    </script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-23 / +25 lines)
Lines 367-422 Link Here
367
            TalkingTechItivaPhoneNotification: [% Koha.Preference('TalkingTechItivaPhoneNotification') ? 1 : 0 | html %],
367
            TalkingTechItivaPhoneNotification: [% Koha.Preference('TalkingTechItivaPhoneNotification') ? 1 : 0 | html %],
368
        });
368
        });
369
    </script>
369
    </script>
370
371
    <script>
370
    <script>
372
        $(document).ready(function(){
371
        $(document).ready(function () {
373
            function toggle_digest(id){
372
            function toggle_digest(id) {
374
                let phone_checked = prefs.TalkingTechItivaPhoneNotification ? false : prefs.PhoneNotification ? $("#phone"+id).prop("checked") : false;
373
                let phone_checked = prefs.TalkingTechItivaPhoneNotification ? false : prefs.PhoneNotification ? $("#phone" + id).prop("checked") : false;
375
374
376
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") || phone_checked ) {
375
                if ($("#email" + id).prop("checked") || $("#sms" + id).prop("checked") || phone_checked) {
377
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
376
                    $("#digest" + id)
377
                        .attr("disabled", false)
378
                        .tooltip("disable");
378
                } else {
379
                } else {
379
                    $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
380
                    $("#digest" + id)
381
                        .attr("disabled", true)
382
                        .prop("checked", false)
383
                        .tooltip("enable");
380
                }
384
                }
381
382
            }
385
            }
383
            // At load time, we want digest disabled if no digest using transport is enabled
386
            // At load time, we want digest disabled if no digest using transport is enabled
384
            $(".pmp_email").each(function(){
387
            $(".pmp_email").each(function () {
385
                toggle_digest(Number($(this).attr("id").replace("email", "")));
388
                toggle_digest(Number($(this).attr("id").replace("email", "")));
386
            });
389
            });
387
390
388
            // If user clears all digest using transports for a notice, disable digest checkbox
391
            // If user clears all digest using transports for a notice, disable digest checkbox
389
            $(".pmp_email").click(function(){
392
            $(".pmp_email").click(function () {
390
                toggle_digest(Number($(this).attr("id").replace("email", "")));
393
                toggle_digest(Number($(this).attr("id").replace("email", "")));
391
            });
394
            });
392
            $(".pmp_sms").click(function(){
395
            $(".pmp_sms").click(function () {
393
                toggle_digest(Number($(this).attr("id").replace("sms", "")));
396
                toggle_digest(Number($(this).attr("id").replace("sms", "")));
394
            });
397
            });
395
            $(".pmp_phone").click(function(){
398
            $(".pmp_phone").click(function () {
396
                toggle_digest(Number($(this).attr("id").replace("phone", "")));
399
                toggle_digest(Number($(this).attr("id").replace("phone", "")));
397
            });
400
            });
398
399
        });
401
        });
400
402
401
        function normalizeSMS(value){
403
        function normalizeSMS(value) {
402
            let has_plus = value.charAt(0) === '+';
404
            let has_plus = value.charAt(0) === "+";
403
            let new_value = value.replace(/\D/g,'');
405
            let new_value = value.replace(/\D/g, "");
404
            if ( has_plus ) new_value = '+' + new_value;
406
            if (has_plus) new_value = "+" + new_value;
405
            return new_value;
407
            return new_value;
406
        }
408
        }
407
409
408
        var sms_input = document.getElementById('SMSnumber');
410
        var sms_input = document.getElementById("SMSnumber");
409
411
410
        if (typeof sms_input !== 'undefined' && sms_input !== null) {
412
        if (typeof sms_input !== "undefined" && sms_input !== null) {
411
            sms_input.addEventListener('keyup', function(){
413
            sms_input.addEventListener("keyup", function () {
412
                var field = sms_input.value;
414
                var field = sms_input.value;
413
                sms_input.value = normalizeSMS(field);
415
                sms_input.value = normalizeSMS(field);
414
            });
416
            });
415
417
416
            sms_input.addEventListener('paste', function(event) {
418
            sms_input.addEventListener("paste", function (event) {
417
                let paste = (event.clipboardData || window.clipboardData).getData('text');
419
                let paste = (event.clipboardData || window.clipboardData).getData("text");
418
                setTimeout(function () {
420
                setTimeout(function () {
419
                sms_input.value = normalizeSMS(paste);
421
                    sms_input.value = normalizeSMS(paste);
420
                }, 100);
422
                }, 100);
421
            });
423
            });
422
        }
424
        }
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt (-22 / +19 lines)
Lines 233-273 Link Here
233
            GoogleJackets: [% Koha.Preference('GoogleJackets') ? 1 : 0 | html %],
233
            GoogleJackets: [% Koha.Preference('GoogleJackets') ? 1 : 0 | html %],
234
        });
234
        });
235
    </script>
235
    </script>
236
237
    <script>
236
    <script>
238
        $(document).ready(function(){
237
        $(document).ready(function () {
239
            if ( prefs.GoogleJackets ){
238
            if (prefs.GoogleJackets) {
240
                KOHA.Google.GetCoverFromIsbn();
239
                KOHA.Google.GetCoverFromIsbn();
241
            }
240
            }
242
            $('#order').change(function() {
241
            $("#order").change(function () {
243
                $('#sortform').submit();
242
                $("#sortform").submit();
244
            });
243
            });
245
244
246
            var table = $("#readingrec").kohaTable(
245
            var table = $("#readingrec").kohaTable({
247
                {
246
                dom: '<"top"<"table_entries"i><"table_controls"fB>>t',
248
                    dom: '<"top"<"table_entries"i><"table_controls"fB>>t',
247
                language: {
249
                    language: {
248
                    search: "_INPUT_",
250
                        search: "_INPUT_",
249
                    searchPlaceholder: _("Search"),
251
                        searchPlaceholder: _("Search"),
250
                },
252
                    },
251
                responsive: {
253
                    responsive: {
252
                    details: { type: "column", target: -1 },
254
                        details: { type: "column", target: -1 },
255
                    },
256
                    columnDefs: [
257
                        { className: "dtr-control", orderable: false, targets: [-1] },
258
                        { visible: false, targets: [0] },
259
                    ],
260
                },
253
                },
261
            );
254
                columnDefs: [
255
                    { className: "dtr-control", orderable: false, targets: [-1] },
256
                    { visible: false, targets: [0] },
257
                ],
258
            });
262
259
263
            let table_dt = table.DataTable();
260
            let table_dt = table.DataTable();
264
261
265
            $("#tabs a[data-bs-toggle='tab']").on("shown.bs.tab", function (e) {
262
            $("#tabs a[data-bs-toggle='tab']").on("shown.bs.tab", function (e) {
266
                var id = e.target.id;
263
                var id = e.target.id;
267
                let pattern = "";
264
                let pattern = "";
268
                if ( id == "checkout-tab" ) {
265
                if (id == "checkout-tab") {
269
                    pattern = "standard_checkout";
266
                    pattern = "standard_checkout";
270
                } else if ( id == "onsite_checkout-tab" ) {
267
                } else if (id == "onsite_checkout-tab") {
271
                    pattern = "onsite_checkout";
268
                    pattern = "onsite_checkout";
272
                }
269
                }
273
                table_dt.columns(0).search(pattern).draw();
270
                table_dt.columns(0).search(pattern).draw();
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-78 / +74 lines)
Lines 572-589 Link Here
572
    <script>
572
    <script>
573
        const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %];
573
        const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %];
574
    </script>
574
    </script>
575
576
    [% IF ( loggedinusername ) %]
575
    [% IF ( loggedinusername ) %]
577
        <script>
576
        <script>
578
            function enableCheckboxActions(){
577
            function enableCheckboxActions() {
579
                // Enable/disable controls if checkboxes are checked
578
                // Enable/disable controls if checkboxes are checked
580
                var checkedBoxes = $(".cb:checked");
579
                var checkedBoxes = $(".cb:checked");
581
                if ($(checkedBoxes).size()) {
580
                if ($(checkedBoxes).size()) {
582
                  $(".selections").html(_("With selected suggestions: "));
581
                    $(".selections").html(_("With selected suggestions: "));
583
                  $(".selections-toolbar .links a").removeClass("disabled");
582
                    $(".selections-toolbar .links a").removeClass("disabled");
584
                } else {
583
                } else {
585
                  $(".selections").html(_("Select suggestions to: "));
584
                    $(".selections").html(_("Select suggestions to: "));
586
                  $(".selections-toolbar .links a").addClass("disabled");
585
                    $(".selections-toolbar .links a").addClass("disabled");
587
                }
586
                }
588
            }
587
            }
589
        </script>
588
        </script>
Lines 591-682 Link Here
591
590
592
    [% IF Koha.Preference( 'OPACSuggestionAutoFill' ) %]
591
    [% IF Koha.Preference( 'OPACSuggestionAutoFill' ) %]
593
        <script>
592
        <script>
594
        $(function() {
593
            $(function () {
595
            $('#isbn').autofill({
594
                $("#isbn").autofill({
596
                'volumeInfo.title': {target: 'title', effect: 'flash'},
595
                    "volumeInfo.title": { target: "title", effect: "flash" },
597
                'volumeInfo.authors': {target: 'author', effect: 'flash'},
596
                    "volumeInfo.authors": { target: "author", effect: "flash" },
598
                'volumeInfo.publisher': {target: 'publishercode', effect: 'flash'},
597
                    "volumeInfo.publisher": { target: "publishercode", effect: "flash" },
599
                'volumeInfo.publishedDate': {target: 'copyrightdate', effect: 'flash'},
598
                    "volumeInfo.publishedDate": { target: "copyrightdate", effect: "flash" },
600
                /* google books api seem to only have books, so if we got a result
599
                    /* google books api seem to only have books, so if we got a result
601
                 * item, type will be a book, so set to BK (book). */
600
                     * item, type will be a book, so set to BK (book). */
602
                'kind': {target: 'itemtype', handle: function(t,v) { t.val('BK'); },},
601
                    kind: {
602
                        target: "itemtype",
603
                        handle: function (t, v) {
604
                            t.val("BK");
605
                        },
606
                    },
607
                });
603
            });
608
            });
604
        });
605
        </script>
609
        </script>
606
    [% END %]
610
    [% END %]
607
608
    <script>
611
    <script>
609
        $(function() {
612
        $(function () {
610
            $("#suggestt").kohaTable({
613
            $("#suggestt").kohaTable({
611
                order: [[ 1, "asc" ]],
614
                order: [[1, "asc"]],
612
                columnDefs: [
615
                columnDefs: [...(loggedinusername ? [{ targets: [0], orderable: false, searchable: false }] : []), { className: "dtr-control", orderable: false, targets: -1 }, { responsivePriority: 1, targets: 1 }],
613
                    ...( loggedinusername
614
                        ? [{ targets: [ 0 ], orderable: false, searchable: false }]
615
                        : []
616
                    ),
617
                    { className: 'dtr-control', orderable: false, targets: -1 },
618
                    { responsivePriority: 1, targets: 1 }
619
                ],
620
                responsive: {
616
                responsive: {
621
                    details: {
617
                    details: {
622
                        type: 'column',
618
                        type: "column",
623
                        target: -1
619
                        target: -1,
624
                    }
620
                    },
625
                },
621
                },
626
            });
622
            });
627
            if (loggedinusername){
623
            if (loggedinusername) {
628
            $("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Clear all")+"<\/a>");
624
                $("span.clearall").html('<a id="CheckNone" class="btn btn-link btn-sm" href="#">' + _("Clear all") + "<\/a>");
629
            $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Select all")+"<\/a>");
625
                $("span.checkall").html('<a id="CheckAll" class="btn btn-link btn-sm" href="#">' + _("Select all") + "<\/a>");
630
            $("#CheckAll").on("click",function(e){
626
                $("#CheckAll").on("click", function (e) {
631
                e.preventDefault();
627
                    e.preventDefault();
632
                $(".cb").prop("checked", true);
628
                    $(".cb").prop("checked", true);
633
                enableCheckboxActions();
629
                    enableCheckboxActions();
634
            });
630
                });
635
            $("#CheckNone").on("click",function(e){
631
                $("#CheckNone").on("click", function (e) {
636
                e.preventDefault();
632
                    e.preventDefault();
637
                $(".cb").prop("checked", false);
633
                    $(".cb").prop("checked", false);
638
                enableCheckboxActions();
634
                    enableCheckboxActions();
639
            });
635
                });
640
            $(".cb").click(function(){
636
                $(".cb").click(function () {
641
              enableCheckboxActions();
637
                    enableCheckboxActions();
642
            });
638
                });
643
639
644
            enableCheckboxActions();
640
                enableCheckboxActions();
645
641
646
            $(".removeitems").on("click", function(e) {
642
                $(".removeitems").on("click", function (e) {
647
                e.preventDefault();
643
                    e.preventDefault();
648
                var selected_titles = $("input:checked");
644
                    var selected_titles = $("input:checked");
649
                var title;
645
                    var title;
650
                var yes_label;
646
                    var yes_label;
651
                var no_label;
647
                    var no_label;
652
                var message = "";
648
                    var message = "";
653
                if ( selected_titles.size() < 1 ) {
649
                    if (selected_titles.size() < 1) {
654
                    alert( _("No suggestion was selected") );
650
                        alert(_("No suggestion was selected"));
655
                    return false;
651
                        return false;
656
                } else {
657
                    if( selected_titles.size() > 1 ){
658
                        message = $("<ul></ul>");
659
                        title = _("Are you sure you want to delete these suggestions?");
660
                        yes_label = _("Yes, delete suggestions");
661
                        no_label = _("No, do not delete suggestions");
662
                        selected_titles.each(function(){
663
                            message.append( "<li>" +  $(this).data("title") + "</li>" );
664
                        });
665
                    } else {
652
                    } else {
666
                        title = _("Are you sure you want to delete this suggestion?");
653
                        if (selected_titles.size() > 1) {
667
                        yes_label = _("Yes, delete suggestion");
654
                            message = $("<ul></ul>");
668
                        no_label = _("No, do not delete suggestion");
655
                            title = _("Are you sure you want to delete these suggestions?");
669
                        selected_titles.each(function(){
656
                            yes_label = _("Yes, delete suggestions");
670
                            message += $(this).data("title");
657
                            no_label = _("No, do not delete suggestions");
658
                            selected_titles.each(function () {
659
                                message.append("<li>" + $(this).data("title") + "</li>");
660
                            });
661
                        } else {
662
                            title = _("Are you sure you want to delete this suggestion?");
663
                            yes_label = _("Yes, delete suggestion");
664
                            no_label = _("No, do not delete suggestion");
665
                            selected_titles.each(function () {
666
                                message += $(this).data("title");
667
                            });
668
                        }
669
                        confirmModal(message, title, yes_label, no_label, function (result) {
670
                            if (result) {
671
                                $("#delete_suggestions").submit();
672
                            }
671
                        });
673
                        });
672
                    }
674
                    }
673
                    confirmModal( message, title, yes_label, no_label, function( result ){
675
                });
674
                        if( result ){
675
                            $("#delete_suggestions").submit();
676
                        }
677
                    });
678
                }
679
            });
680
            }
676
            }
681
        });
677
        });
682
    </script>
678
    </script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-192 / +193 lines)
Lines 1062-1239 Link Here
1062
        const is_debarred = [% userdebarred ? 1 : 0 | html %];
1062
        const is_debarred = [% userdebarred ? 1 : 0 | html %];
1063
        const current_article_requests_size = [% current_article_requests.size || 0 | html %];
1063
        const current_article_requests_size = [% current_article_requests.size || 0 | html %];
1064
    </script>
1064
    </script>
1065
1066
    <script>
1065
    <script>
1067
        var AR_CAPTION_COUNT = _("(%s total)");
1066
        var AR_CAPTION_COUNT = _("(%s total)");
1068
1067
1069
1068
        function tableInit(tableId) {
1070
        function tableInit( tableId ){
1069
            if (tableId == "checkoutst") {
1071
            if( tableId == "checkoutst" ){
1070
                $(".dt-buttons").append('<button type="button" class="dt-button buttons-ical" id="buttons-ics">iCal</button> ');
1072
                $(".dt-buttons").append("<button type=\"button\" class=\"dt-button buttons-ical\" id=\"buttons-ics\">iCal</button> ");
1071
                if (prefs.OpacRenewalAllowed && can_renew && !is_debarred) {
1073
                if (prefs.OpacRenewalAllowed && can_renew && !is_debarred){
1072
                    $(".dt-buttons").append(
1074
                    $(".dt-buttons").append("<button id=\"renewselected_link\" class=\"dt-button buttons-renew\"><i class=\"fa fa-check\" aria-hidden=\"true\"></i> "+_("Renew selected")+"</button> <button id=\"renewall_link\" class=\"dt-button buttons-renewall\"><span class=\"fa-stack\"><i class=\"fa fa-check fa-stack-1x\" aria-hidden=\"true\"></i><i class=\"fa fa-check fa-stack-1x\" aria-hidden=\"true\"></i></span> "+_("Renew all")+"</button>");
1073
                        '<button id="renewselected_link" class="dt-button buttons-renew"><i class="fa fa-check" aria-hidden="true"></i> ' +
1074
                            _("Renew selected") +
1075
                            '</button> <button id="renewall_link" class="dt-button buttons-renewall"><span class="fa-stack"><i class="fa fa-check fa-stack-1x" aria-hidden="true"></i><i class="fa fa-check fa-stack-1x" aria-hidden="true"></i></span> ' +
1076
                            _("Renew all") +
1077
                            "</button>"
1078
                    );
1075
                }
1079
                }
1076
            }
1080
            }
1077
        }
1081
        }
1078
        $(document).ready(function(){
1082
        $(document).ready(function () {
1079
            if (tab){
1083
            if (tab) {
1080
                $(`#opac-user-views a[href='#${tab}_panel']`).tab("show");
1084
                $(`#opac-user-views a[href='#${tab}_panel']`).tab("show");
1081
            }
1085
            }
1082
            if( $("#opac-user-views .tab-pane.active").length < 1 ){
1086
            if ($("#opac-user-views .tab-pane.active").length < 1) {
1083
                $("#opac-user-views a:first").tab("show");
1087
                $("#opac-user-views a:first").tab("show");
1084
            }
1088
            }
1085
1089
1086
            $('#article-requests-table caption .count').html(AR_CAPTION_COUNT.format(current_article_requests_size));
1090
            $("#article-requests-table caption .count").html(AR_CAPTION_COUNT.format(current_article_requests_size));
1087
1091
1088
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
1092
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
1089
1093
1090
            $(".btn-delete-hold").on("click", function(e){
1094
            $(".btn-delete-hold").on("click", function (e) {
1091
                e.preventDefault();
1095
                e.preventDefault();
1092
                var hold_title = $(this).data("title");
1096
                var hold_title = $(this).data("title");
1093
                var reserve_id = $(this).data("reserve_id");
1097
                var reserve_id = $(this).data("reserve_id");
1094
                confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){
1098
                confirmModal(hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function (result) {
1095
                        if( result ){
1099
                    if (result) {
1096
                            $("#delete_hold_" + reserve_id ).submit();
1100
                        $("#delete_hold_" + reserve_id).submit();
1097
                        }
1098
                    }
1101
                    }
1099
                );
1102
                });
1100
            });
1103
            });
1101
1104
1102
            $(".btn-req-delete-hold").on("click", function(e){
1105
            $(".btn-req-delete-hold").on("click", function (e) {
1103
                e.preventDefault();
1106
                e.preventDefault();
1104
                var hold_title = $(this).data("title");
1107
                var hold_title = $(this).data("title");
1105
                var reserve_id = $(this).data("reserve_id");
1108
                var reserve_id = $(this).data("reserve_id");
1106
                confirmModal( hold_title, _("Are you sure you want to request cancelling this hold?"), _("Yes"), _("No"), function( result ){
1109
                confirmModal(hold_title, _("Are you sure you want to request cancelling this hold?"), _("Yes"), _("No"), function (result) {
1107
                        if( result ){
1110
                    if (result) {
1108
                            $("#req_cancel_hold_" + reserve_id ).submit();
1111
                        $("#req_cancel_hold_" + reserve_id).submit();
1109
                        }
1110
                    }
1112
                    }
1111
                );
1113
                });
1112
            });
1114
            });
1113
1115
1114
            $("#article-requests-table").on("click", ".btn-delete-article-request", function(e){
1116
            $("#article-requests-table").on("click", ".btn-delete-article-request", function (e) {
1115
                e.preventDefault();
1117
                e.preventDefault();
1116
                var article_request = $(this).data("title");
1118
                var article_request = $(this).data("title");
1117
                var article_request_id = $(this).data("article-request_id");
1119
                var article_request_id = $(this).data("article-request_id");
1118
                (function(row){
1120
                (function (row) {
1119
                    var doCancel = function( result ){
1121
                    var doCancel = function (result) {
1120
                        if( result ){
1122
                        if (result) {
1121
                            $.ajax({
1123
                            $.ajax({
1122
                                type: "DELETE",
1124
                                type: "DELETE",
1123
                                url: `/api/v1/public/patrons/${logged_in_user_borrowernumber}/article_requests/${article_request_id}?cancellation_reason=OPAC`,
1125
                                url: `/api/v1/public/patrons/${logged_in_user_borrowernumber}/article_requests/${article_request_id}?cancellation_reason=OPAC`,
1124
                                success: function( data ) {
1126
                                success: function (data) {
1125
                                    $("#article_" + article_request_id ).hide({
1127
                                    $("#article_" + article_request_id).hide({
1126
                                        duration: 'slow',
1128
                                        duration: "slow",
1127
                                        complete: function() {
1129
                                        complete: function () {
1128
                                            $(this).siblings(".child").hide();
1130
                                            $(this).siblings(".child").hide();
1129
                                            var ar_tab = $('a[href="#opac-user-article-requests_panel"');
1131
                                            var ar_tab = $('a[href="#opac-user-article-requests_panel"');
1130
                                            var ar_table = $('#article-requests-table');
1132
                                            var ar_table = $("#article-requests-table");
1131
                                            var ar_length = $('tbody tr:visible', ar_table).length;
1133
                                            var ar_length = $("tbody tr:visible", ar_table).length;
1132
                                            var ar_count = $('caption .count', ar_table);
1134
                                            var ar_count = $("caption .count", ar_table);
1133
1135
1134
                                            ar_tab.html(ar_tab.html().replace(/\(\d+\)/, '('+ar_length+')'));
1136
                                            ar_tab.html(ar_tab.html().replace(/\(\d+\)/, "(" + ar_length + ")"));
1135
                                            ar_count.html(AR_CAPTION_COUNT.format(ar_length));
1137
                                            ar_count.html(AR_CAPTION_COUNT.format(ar_length));
1136
1138
                                        },
1137
                                        }
1138
                                    });
1139
                                    });
1139
                                }
1140
                                },
1140
                            });
1141
                            });
1141
                        }
1142
                        }
1142
                    };
1143
                    };
1143
                    confirmModal( article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), doCancel);
1144
                    confirmModal(article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), doCancel);
1144
                })($(this))
1145
                })($(this));
1145
            });
1146
            });
1146
1147
1147
            /* We initiate this flatpickr instance here so that we can use the variable later */
1148
            /* We initiate this flatpickr instance here so that we can use the variable later */
1148
            var suspend_until_date = $("#suspend_untilDate").flatpickr({
1149
            var suspend_until_date = $("#suspend_untilDate").flatpickr({
1149
                minDate: "today"
1150
                minDate: "today",
1150
            });
1151
            });
1151
1152
1152
            $(document).on("click", ".suspend_hold", function(e){
1153
            $(document).on("click", ".suspend_hold", function (e) {
1153
                e.preventDefault();
1154
                e.preventDefault();
1154
                var title = $(this).data("title");
1155
                var title = $(this).data("title");
1155
                var reserve_id = $(this).data("reserve_id");
1156
                var reserve_id = $(this).data("reserve_id");
1156
                $("#suspendHoldReserveId").val( reserve_id );
1157
                $("#suspendHoldReserveId").val(reserve_id);
1157
                $("#suspendHoldTitle").html( "<em>" + title + "</em>" );
1158
                $("#suspendHoldTitle").html("<em>" + title + "</em>");
1158
                $("#suspendHoldModal").modal("show");
1159
                $("#suspendHoldModal").modal("show");
1159
            });
1160
            });
1160
1161
1161
            $("#suspendHoldModal").on("hidden.bs.modal", function(){
1162
            $("#suspendHoldModal").on("hidden.bs.modal", function () {
1162
                $("#suspendHoldTitle").html("");
1163
                $("#suspendHoldTitle").html("");
1163
                $("#suspendHoldReserveId").val("");
1164
                $("#suspendHoldReserveId").val("");
1164
                suspend_until_date.clear();
1165
                suspend_until_date.clear();
1165
            });
1166
            });
1166
1167
1167
            $("#suspend_all_submit").on("click", function(e){
1168
            $("#suspend_all_submit").on("click", function (e) {
1168
                e.preventDefault();
1169
                e.preventDefault();
1169
                var title = _("Are you sure you want to suspend all holds?");
1170
                var title = _("Are you sure you want to suspend all holds?");
1170
                var body = _("All holds will be suspended.");
1171
                var body = _("All holds will be suspended.");
1171
                confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){
1172
                confirmModal(body, title, _("Yes, suspend all holds"), "", function (result) {
1172
                        if( result ){
1173
                    if (result) {
1173
                            $("#suspend_all_holds").submit();
1174
                        $("#suspend_all_holds").submit();
1174
                        }
1175
                    }
1175
                    }
1176
                );
1176
                });
1177
            });
1177
            });
1178
1178
1179
            $("#resume_all_submit").on("click", function(e){
1179
            $("#resume_all_submit").on("click", function (e) {
1180
                e.preventDefault();
1180
                e.preventDefault();
1181
                var title = _("Are you sure you want to resume all suspended holds?");
1181
                var title = _("Are you sure you want to resume all suspended holds?");
1182
                var body = _("All holds will resume.");
1182
                var body = _("All holds will resume.");
1183
                confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){
1183
                confirmModal(body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function (result) {
1184
                        if( result ){
1184
                    if (result) {
1185
                            $("#resume_all_holds").submit();
1185
                        $("#resume_all_holds").submit();
1186
                        }
1187
                    }
1186
                    }
1188
                );
1187
                });
1189
            });
1188
            });
1190
1189
1191
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1190
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1192
            dTables.each(function(){
1191
            dTables.each(function () {
1193
                var thIndex = $(this).find("th.psort").index();
1192
                var thIndex = $(this).find("th.psort").index();
1194
                $(this).on("init.dt", function() {
1193
                $(this)
1195
                        tableInit( $(this).attr("id") );
1194
                    .on("init.dt", function () {
1195
                        tableInit($(this).attr("id"));
1196
                    })
1196
                    })
1197
                    .kohaTable({
1197
                    .kohaTable({
1198
                    order: [[ thIndex, 'asc' ]],
1198
                        order: [[thIndex, "asc"]],
1199
                    dom: '<"top"<"table_entries"><"table_controls"fB>>t',
1199
                        dom: '<"top"<"table_entries"><"table_controls"fB>>t',
1200
                    columnDefs: [
1200
                        columnDefs: [
1201
                        { visible: false, "targets" : [ "hidden" ] },
1201
                            { visible: false, targets: ["hidden"] },
1202
                        { className: 'dtr-control', orderable: false, targets: -1 }
1202
                            { className: "dtr-control", orderable: false, targets: -1 },
1203
                    ],
1203
                        ],
1204
                    language: {
1204
                        language: {
1205
                        search: "_INPUT_",
1205
                            search: "_INPUT_",
1206
                        searchPlaceholder: _("Search")
1206
                            searchPlaceholder: _("Search"),
1207
                    },
1208
                    responsive: {
1209
                        details: {
1210
                            type: 'column',
1211
                            target: -1
1212
                        }
1213
                    },
1214
                    buttons: [
1215
                        /* Override default button set so that we can extend the options of print and csv */
1216
                        'clearFilter', 'copy',
1217
                        {
1218
                            extend: "print",
1219
                            exportOptions: {
1220
                                /* Print view should show all columns (even invisible ones) unless they are .no-export */
1221
                                columns: ":not(.no-export)"
1222
                            }
1223
                        },
1207
                        },
1224
                        {
1208
                        responsive: {
1225
                            extend: "csv",
1209
                            details: {
1226
                            exportOptions: {
1210
                                type: "column",
1227
                                /* CSV export should include all columns (even invisible ones) unless they are .no-export */
1211
                                target: -1,
1228
                                columns: ":not(.no-export)"
1212
                            },
1229
                            }
1213
                        },
1230
                        }
1214
                        buttons: [
1231
                    ]
1215
                            /* Override default button set so that we can extend the options of print and csv */
1232
                });
1216
                            "clearFilter",
1217
                            "copy",
1218
                            {
1219
                                extend: "print",
1220
                                exportOptions: {
1221
                                    /* Print view should show all columns (even invisible ones) unless they are .no-export */
1222
                                    columns: ":not(.no-export)",
1223
                                },
1224
                            },
1225
                            {
1226
                                extend: "csv",
1227
                                exportOptions: {
1228
                                    /* CSV export should include all columns (even invisible ones) unless they are .no-export */
1229
                                    columns: ":not(.no-export)",
1230
                                },
1231
                            },
1232
                        ],
1233
                    });
1233
            });
1234
            });
1234
1235
1235
            var dataTables = $("#recalls-table,#article-requests-table");
1236
            var dataTables = $("#recalls-table,#article-requests-table");
1236
            dataTables.each(function(){
1237
            dataTables.each(function () {
1237
                $(this).kohaTable({
1238
                $(this).kohaTable({
1238
                    searching: false,
1239
                    searching: false,
1239
                    paging: false,
1240
                    paging: false,
Lines 1244-1306 Link Here
1244
                    columnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }],
1245
                    columnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }],
1245
                });
1246
                });
1246
            });
1247
            });
1247
            $('a[data-bs-toggle="tab"]').on('shown.bs.tab', function (event) {
1248
            $('a[data-bs-toggle="tab"]').on("shown.bs.tab", function (event) {
1248
                dTables.DataTable().responsive.recalc();
1249
                dTables.DataTable().responsive.recalc();
1249
                dataTables.DataTable().responsive.recalc();
1250
                dataTables.DataTable().responsive.recalc();
1250
            } );
1251
            });
1251
1252
1252
            $("body").on("click", "#buttons-ics", function(){
1253
            $("body").on("click", "#buttons-ics", function () {
1253
                location.href="/cgi-bin/koha/opac-ics.pl";
1254
                location.href = "/cgi-bin/koha/opac-ics.pl";
1254
            });
1255
            });
1255
1256
1256
            if (prefs.GoogleJackets){
1257
            if (prefs.GoogleJackets) {
1257
                KOHA.Google.GetCoverFromIsbn();
1258
                KOHA.Google.GetCoverFromIsbn();
1258
            }
1259
            }
1259
            if (prefs.OpacRenewalAllowed && can_renew && !is_debarred){
1260
            if (prefs.OpacRenewalAllowed && can_renew && !is_debarred) {
1260
                $("#renewselected").submit(function(){
1261
                $("#renewselected").submit(function () {
1261
                    valid = false;
1262
                    valid = false;
1262
                    $("input[type=checkbox]").each(function(){
1263
                    $("input[type=checkbox]").each(function () {
1263
                        if($(this).is(':checked')){
1264
                        if ($(this).is(":checked")) {
1264
                            valid = true;
1265
                            valid = true;
1265
                        }
1266
                        }
1266
                    });
1267
                    });
1267
                    if(!valid){
1268
                    if (!valid) {
1268
                        alert(_("Nothing has been selected. Check the box for each item you want to renew"));
1269
                        alert(_("Nothing has been selected. Check the box for each item you want to renew"));
1269
                    }
1270
                    }
1270
                    return valid;
1271
                    return valid;
1271
                });
1272
                });
1272
                $("body").on("click","#renewselected_link",function(e){
1273
                $("body").on("click", "#renewselected_link", function (e) {
1273
                    e.preventDefault();
1274
                    e.preventDefault();
1274
                    $("#renewselected").submit();
1275
                    $("#renewselected").submit();
1275
                });
1276
                });
1276
                $("body").on("click","#renewall_link, #renewall_js",function(e){
1277
                $("body").on("click", "#renewall_link, #renewall_js", function (e) {
1277
                    e.preventDefault();
1278
                    e.preventDefault();
1278
                    $("#renewall").submit();
1279
                    $("#renewall").submit();
1279
                });
1280
                });
1280
            }
1281
            }
1281
1282
1282
            if (prefs.AllowCheckoutNotes){
1283
            if (prefs.AllowCheckoutNotes) {
1283
1284
                /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */
1284
                /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */
1285
                $(".nonjs_submitnote").hide();
1285
                $(".nonjs_submitnote").hide();
1286
1286
1287
                $("input[name='note']").prop('readonly', false);
1287
                $("input[name='note']").prop("readonly", false);
1288
                $("input[name='note']").keypress(function(e){
1288
                $("input[name='note']").keypress(function (e) {
1289
                    /* prevent submitting of renewselected form */
1289
                    /* prevent submitting of renewselected form */
1290
                    if(e.which == 13)
1290
                    if (e.which == 13) e.preventDefault();
1291
                        e.preventDefault();
1292
                });
1291
                });
1293
1292
1294
                $("input[name='note']").keyup(function(e){
1293
                $("input[name='note']").keyup(function (e) {
1295
                    var $btn_save = $('#save_'+$(this).data('issue_id'));
1294
                    var $btn_save = $("#save_" + $(this).data("issue_id"));
1296
                    var origvalue = $(this).data('origvalue');
1295
                    var origvalue = $(this).data("origvalue");
1297
                    var value = $(this).val();
1296
                    var value = $(this).val();
1298
1297
1299
                    if(origvalue != value) {
1298
                    if (origvalue != value) {
1300
                        if(origvalue != "")
1299
                        if (origvalue != "") $btn_save.text(_("Submit changes"));
1301
                            $btn_save.text(_("Submit changes"));
1300
                        else $btn_save.text(_("Submit note"));
1302
                        else
1303
                            $btn_save.text(_("Submit note"));
1304
                        $btn_save.show();
1301
                        $btn_save.show();
1305
                    } else {
1302
                    } else {
1306
                        $btn_save.hide();
1303
                        $btn_save.hide();
Lines 1308-1427 Link Here
1308
                });
1305
                });
1309
            }
1306
            }
1310
1307
1311
            $(".change_pickup").on("click", function(){
1308
            $(".change_pickup").on("click", function () {
1312
                var hold_id = $(this).data("hold-id");
1309
                var hold_id = $(this).data("hold-id");
1313
                $(this).hide();
1310
                $(this).hide();
1314
                $("#change-pickup-location" + hold_id ).show();
1311
                $("#change-pickup-location" + hold_id).show();
1315
            });
1312
            });
1316
1313
1317
            if ( $('#opac-user-clubs_panel').length ) {
1314
            if ($("#opac-user-clubs_panel").length) {
1318
                $('#opac-user-clubs-tab').on('click', function() {
1315
                $("#opac-user-clubs-tab").on("click", function () {
1319
                    $('#opac-user-clubs_panel').text(_("Loading..."));
1316
                    $("#opac-user-clubs_panel").text(_("Loading..."));
1320
                    $('#opac-user-clubs_panel').load(`/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=${logged_in_user_borrowernumber}`);
1317
                    $("#opac-user-clubs_panel").load(`/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=${logged_in_user_borrowernumber}`);
1321
                });
1318
                });
1322
            }
1319
            }
1323
1320
1324
            $(".cancel_recall").click(function(e){
1321
            $(".cancel_recall").click(function (e) {
1325
                return confirmDelete(_("Are you sure you want to remove this recall?"));
1322
                return confirmDelete(_("Are you sure you want to remove this recall?"));
1326
            });
1323
            });
1327
1324
1328
            $("body").on("click", ".btn-add-note", function(e){
1325
            $("body").on("click", ".btn-add-note", function (e) {
1329
                e.preventDefault();
1326
                e.preventDefault();
1330
                var title = $(this).data("title");
1327
                var title = $(this).data("title");
1331
                var issue_id = $(this).data("issueid");
1328
                var issue_id = $(this).data("issueid");
1332
                var note = $("#note_" + issue_id ).val();
1329
                var note = $("#note_" + issue_id).val();
1333
                var origvalue = $("#note_" + issue_id ).data("origvalue");
1330
                var origvalue = $("#note_" + issue_id).data("origvalue");
1334
                $("#addNote").val( note );
1331
                $("#addNote").val(note);
1335
                $("#addNoteIssueId").val( issue_id );
1332
                $("#addNoteIssueId").val(issue_id);
1336
                $("#addNoteTitle").text( title );
1333
                $("#addNoteTitle").text(title);
1337
                $("#addNoteModal").modal("show");
1334
                $("#addNoteModal").modal("show");
1338
            });
1335
            });
1339
1336
1340
            $("#addNoteForm").on("submit", function(e){
1337
            $("#addNoteForm").on("submit", function (e) {
1341
                e.preventDefault();
1338
                e.preventDefault();
1342
                var title = $("#addNoteTitle").text();
1339
                var title = $("#addNoteTitle").text();
1343
                var issue_id = $("#addNoteIssueId").val();
1340
                var issue_id = $("#addNoteIssueId").val();
1344
                var note = $("#addNote").val();
1341
                var note = $("#addNote").val();
1345
                submitNote( title, issue_id, note );
1342
                submitNote(title, issue_id, note);
1346
            });
1343
            });
1347
1344
1348
            $("#addNoteModal").on("hidden.bs.modal", function(){
1345
            $("#addNoteModal").on("hidden.bs.modal", function () {
1349
                $("#addNoteTitle").text("");
1346
                $("#addNoteTitle").text("");
1350
                $("#addNote").val("");
1347
                $("#addNote").val("");
1351
            });
1348
            });
1352
1349
1353
            $(".dismiss-message-button").click(function(e){
1350
            $(".dismiss-message-button").click(function (e) {
1354
                return confirmDelete(_("Are you sure you want to dismiss this message?"));
1351
                return confirmDelete(_("Are you sure you want to dismiss this message?"));
1355
            });
1352
            });
1356
1357
        });
1353
        });
1358
1354
1359
        function submitNote( title, issue_id, note ){
1355
        function submitNote(title, issue_id, note) {
1360
            var self = $("#addNoteModal");
1356
            var self = $("#addNoteModal");
1361
            var notebutton = $("#save_" + issue_id );
1357
            var notebutton = $("#save_" + issue_id);
1362
            var noteinput = $("#note_" + issue_id );
1358
            var noteinput = $("#note_" + issue_id);
1363
1359
1364
            var ajaxData = {
1360
            var ajaxData = {
1365
                'action': 'issuenote',
1361
                action: "issuenote",
1366
                'issue_id': issue_id,
1362
                issue_id: issue_id,
1367
                'note': note,
1363
                note: note,
1368
                csrf_token: $('meta[name="csrf-token"]').attr('content'),
1364
                csrf_token: $('meta[name="csrf-token"]').attr("content"),
1369
                op: 'cud-add_note',
1365
                op: "cud-add_note",
1370
            };
1366
            };
1371
1367
1372
            $.ajax({
1368
            $.ajax({
1373
                url: '/cgi-bin/koha/svc/checkout_notes/',
1369
                url: "/cgi-bin/koha/svc/checkout_notes/",
1374
                type: 'POST',
1370
                type: "POST",
1375
                dataType: 'json',
1371
                dataType: "json",
1376
                data: ajaxData,
1372
                data: ajaxData,
1377
            })
1373
            })
1378
            .done(function(data) {
1374
                .done(function (data) {
1379
                var message = "";
1375
                    var message = "";
1380
                if(data.status == 'saved') {
1376
                    if (data.status == "saved") {
1381
                    $("#notesaved").removeClass("alert-error");
1377
                        $("#notesaved").removeClass("alert-error");
1382
                    $("#notesaved").addClass("alert-info");
1378
                        $("#notesaved").addClass("alert-info");
1383
                    noteinput.data('origvalue', data.note)
1379
                        noteinput.data("origvalue", data.note).val(data.note);
1384
                        .val(data.note);
1380
                        notebutton.text(_("Edit note"));
1385
                    notebutton.text( _("Edit note" ) );
1381
                        $("#viewnote_" + issue_id).text(data.note);
1386
                    $("#viewnote_" + issue_id ).text( data.note );
1382
                        message = "<p>" + _("Your note about %s has been saved and sent to the library.").format(em(title)) + "</p>";
1387
                    message = "<p>" + _("Your note about %s has been saved and sent to the library.").format( em(title) ) + "</p>";
1383
                        message += '<p class="checkout_note">' + data.note;
1388
                    message += "<p class=\"checkout_note\">" + data.note;
1384
                        message +=
1389
                    message += "<a href=\"/cgi-bin/koha/opac-issue-note.pl?issue_id=" + issue_id + "\" class=\"btn btn-link btn-sm btn-add-note\" data-title=\"" + title + "\" data-issueid=\"" + issue_id + "\"><i class=\"fa fa-pencil\" aria-hidden=\"true\"></i> " + _("Edit note") + "</a>";
1385
                            '<a href="/cgi-bin/koha/opac-issue-note.pl?issue_id=' +
1390
                    message += "</p>";
1386
                            issue_id +
1391
                } else if(data.status == 'removed') {
1387
                            '" class="btn btn-link btn-sm btn-add-note" data-title="' +
1392
                    $("#notesaved").removeClass("alert-error");
1388
                            title +
1393
                    $("#notesaved").addClass("alert-info");
1389
                            '" data-issueid="' +
1394
                    noteinput.data('origvalue', "")
1390
                            issue_id +
1395
                        .val("")
1391
                            '"><i class="fa fa-pencil" aria-hidden="true"></i> ' +
1396
                    notebutton.text( _("Add note") );
1392
                            _("Edit note") +
1397
                    $("#viewnote_" + issue_id ).text( data.note );
1393
                            "</a>";
1398
                    message = "<p>" + _("Your note about %s was removed.").format( em(title) ) + "</p>";
1394
                        message += "</p>";
1399
                } else {
1395
                    } else if (data.status == "removed") {
1396
                        $("#notesaved").removeClass("alert-error");
1397
                        $("#notesaved").addClass("alert-info");
1398
                        noteinput.data("origvalue", "").val("");
1399
                        notebutton.text(_("Add note"));
1400
                        $("#viewnote_" + issue_id).text(data.note);
1401
                        message = "<p>" + _("Your note about %s was removed.").format(em(title)) + "</p>";
1402
                    } else {
1403
                        $("#notesaved").removeClass("alert-info");
1404
                        $("#notesaved").addClass("alert-error");
1405
                        message = "<p>" + _("Your note about %s could not be saved.").format(em(title)) + "</p>";
1406
                        notebutton.text(_("Add note"));
1407
                        $("#viewnote_" + issue_id).text(data.note);
1408
                        message += '<p style="font-weight:bold;">' + _("Something went wrong. The note has not been saved") + "</p>";
1409
                    }
1410
                    $("#notesaved").html(message);
1411
                })
1412
                .fail(function (data) {
1400
                    $("#notesaved").removeClass("alert-info");
1413
                    $("#notesaved").removeClass("alert-info");
1401
                    $("#notesaved").addClass("alert-error");
1414
                    $("#notesaved").addClass("alert-error");
1402
                    message =  "<p>" + _("Your note about %s could not be saved.").format( em(title) ) + "</p>";
1415
                    var message = '<p style="font-weight:bold;">' + _("Something went wrong. The note has not been saved") + "</p>";
1403
                    notebutton.text( _("Add note") );
1416
                    $("#notesaved").html(message);
1404
                    $("#viewnote_" + issue_id ).text( data.note );
1417
                })
1405
                    message += "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1418
                .always(function () {
1406
                }
1419
                    self.modal("hide");
1407
                $("#notesaved").html(message);
1420
                    $("#notesaved").show();
1408
            })
1421
                });
1409
            .fail(function(data) {
1410
                $("#notesaved").removeClass("alert-info");
1411
                $("#notesaved").addClass("alert-error");
1412
                var message = "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1413
                $("#notesaved").html(message);
1414
            })
1415
            .always(function() {
1416
                self.modal("hide");
1417
                $("#notesaved").show();
1418
            });
1419
        }
1422
        }
1420
1423
1421
        function em( title ){
1424
        function em(title) {
1422
            return "<em>" + title + "</em>";
1425
            return "<em>" + title + "</em>";
1423
        }
1426
        }
1424
1425
    </script>
1427
    </script>
1426
    [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
1428
    [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
1427
        [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %]
1429
        [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %]
1428
- 

Return to bug 41582