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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-8 / +19 lines)
Lines 570-576 Link Here
570
    [% END %]
570
    [% END %]
571
    [% INCLUDE 'datatables.inc' %]
571
    [% INCLUDE 'datatables.inc' %]
572
    <script>
572
    <script>
573
        [% IF ( loggedinusername ) %]
573
        const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %];
574
    </script>
575
576
    [% IF ( loggedinusername ) %]
577
        <script>
574
            function enableCheckboxActions(){
578
            function enableCheckboxActions(){
575
                // Enable/disable controls if checkboxes are checked
579
                // Enable/disable controls if checkboxes are checked
576
                var checkedBoxes = $(".cb:checked");
580
                var checkedBoxes = $(".cb:checked");
Lines 582-590 Link Here
582
                  $(".selections-toolbar .links a").addClass("disabled");
586
                  $(".selections-toolbar .links a").addClass("disabled");
583
                }
587
                }
584
            }
588
            }
585
        [% END %]
589
        </script>
590
    [% END %]
586
591
587
        [% IF Koha.Preference( 'OPACSuggestionAutoFill' ) %]
592
    [% IF Koha.Preference( 'OPACSuggestionAutoFill' ) %]
593
        <script>
588
        $(function() {
594
        $(function() {
589
            $('#isbn').autofill({
595
            $('#isbn').autofill({
590
                'volumeInfo.title': {target: 'title', effect: 'flash'},
596
                'volumeInfo.title': {target: 'title', effect: 'flash'},
Lines 596-608 Link Here
596
                'kind': {target: 'itemtype', handle: function(t,v) { t.val('BK'); },},
602
                'kind': {target: 'itemtype', handle: function(t,v) { t.val('BK'); },},
597
            });
603
            });
598
        });
604
        });
599
        [% END %]
605
        </script>
606
    [% END %]
600
607
608
    <script>
601
        $(function() {
609
        $(function() {
602
            $("#suggestt").kohaTable({
610
            $("#suggestt").kohaTable({
603
                order: [[ 1, "asc" ]],
611
                order: [[ 1, "asc" ]],
604
                columnDefs: [
612
                columnDefs: [
605
                  [% IF ( loggedinusername ) %]{ targets: [ 0 ], orderable: false, searchable: false }[% END %],
613
                    ...( loggedinusername
614
                        ? [{ targets: [ 0 ], orderable: false, searchable: false }]
615
                        : []
616
                    ),
606
                    { className: 'dtr-control', orderable: false, targets: -1 },
617
                    { className: 'dtr-control', orderable: false, targets: -1 },
607
                    { responsivePriority: 1, targets: 1 }
618
                    { responsivePriority: 1, targets: 1 }
608
                ],
619
                ],
Lines 613-619 Link Here
613
                    }
624
                    }
614
                },
625
                },
615
            });
626
            });
616
            [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Clear all")+"<\/a>");
627
            if (loggedinusername){
628
            $("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Clear all")+"<\/a>");
617
            $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Select all")+"<\/a>");
629
            $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Select all")+"<\/a>");
618
            $("#CheckAll").on("click",function(e){
630
            $("#CheckAll").on("click",function(e){
619
                e.preventDefault();
631
                e.preventDefault();
Lines 665-671 Link Here
665
                    });
677
                    });
666
                }
678
                }
667
            });
679
            });
668
            [% END %]
680
            }
669
        });
681
        });
670
    </script>
682
    </script>
671
[% END %]
683
[% END %]
672
- 

Return to bug 41582