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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-37 / +63 lines)
Lines 638-651 Link Here
638
            });
638
            });
639
        </script>
639
        </script>
640
    [% END #/print %]
640
    [% END #/print %]
641
641
    <script>
642
    <script>
642
        var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
643
        var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
643
        var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these records from the list?");
644
        var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these records from the list?");
644
        var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
645
        var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
646
    </script>
647
648
    [% IF op == 'list' %]
649
        <script>
650
            var public = [% public | html %];
651
            const allow_transfer = [% allow_transfer ? 1 : 0 | html %];
652
        </script>
645
653
646
        [% IF op == 'list' %]
654
        <script>
647
            $(document).ready(function(){
655
            $(document).ready(function(){
648
                var public = [% public | html %];
649
656
650
                let sorton = [
657
                let sorton = [
651
                            'vs.shelfname',
658
                            'vs.shelfname',
Lines 672-678 Link Here
672
                                owner: $("#searchowner_filter").val(),
679
                                owner: $("#searchowner_filter").val(),
673
                                sortby: $("#searchsortby_filter").val(),
680
                                sortby: $("#searchsortby_filter").val(),
674
                                template_path: 'virtualshelves/tables/shelves_results.tt',
681
                                template_path: 'virtualshelves/tables/shelves_results.tt',
675
                                allow_transfer: '[% allow_transfer | html %]',
682
                                allow_transfer,
676
                            });
683
                            });
677
                        }
684
                        }
678
                    },
685
                    },
Lines 720-754 Link Here
720
                    return confirmDelete(MSG_CONFIRM_DELETE_LIST);
727
                    return confirmDelete(MSG_CONFIRM_DELETE_LIST);
721
                });
728
                });
722
            });
729
            });
723
        [% END # /IF op == 'list' %]
730
        </script>
731
    [% END # /IF op == 'list' %]
724
732
725
        [% IF shelf AND op == 'view' %]
733
    [% IF shelf AND op == 'view' %]
726
            $(document).ready(function(){
734
        <script>
727
                $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-times\"></i>"+_(" Clear all")+"<\/a>");
735
            addPrefs({
728
                $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
736
                intranetbookbag: [% Koha.Preference("intranetbookbag") ? 1 : 0 | html %],
729
                $("#CheckAll").click(function(e){
737
                virtualshelves: [% Koha.Preference("virtualshelves") ? 1 : 0 | html %],
730
                    e.preventDefault();
738
            });
731
                    $(".selection").each(function(){
732
                        $(this).prop("checked", true);
733
                    });
734
                });
735
739
736
                $("#CheckNone").click(function(e){
740
            function build_dropdown(){
737
                    e.preventDefault();
738
                    $(".selection").each(function(){
739
                        $(this).prop("checked", false);
740
                    });
741
                });
742
                $(".placehold").on("click",function(e){
743
                    placeHold();
744
                    e.preventDefault();
745
                });
746
                $(".addtocart").show();
747
                var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
741
                var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
748
                [% IF (Koha.Preference("intranetbookbag")) %]
742
                if (prefs.intranetbookbag){
749
                     param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
743
                     param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
750
                [% END %]
744
                }
751
                [% IF Koha.Preference('virtualshelves') %]
745
                if (prefs.virtualshelves){
752
                    [% IF add_to_some_private_shelves.count %]
746
                    [% IF add_to_some_private_shelves.count %]
753
                        param1 += "<optgroup label=\""+_("Your lists:")+"\">";
747
                        param1 += "<optgroup label=\""+_("Your lists:")+"\">";
754
                        [% SET number_of_private_shelves = 0 %]
748
                        [% SET number_of_private_shelves = 0 %]
Lines 777-785 Link Here
777
                        param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
771
                        param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
778
                    [% END %]
772
                    [% END %]
779
                    param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
773
                    param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
780
                [% END %]
774
                }
781
                param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
775
                param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>";
782
                $("span.addto").html(param1);
776
                return param1;
777
            }
778
        </script>
779
780
        <script>
781
            $(document).ready(function(){
782
                $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-times\"></i>"+_(" Clear all")+"<\/a>");
783
                $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/shelves.pl\"><i class=\"fa fa-check\"></i>"+_(" Select all")+"<\/a>");
784
                $("#CheckAll").click(function(e){
785
                    e.preventDefault();
786
                    $(".selection").each(function(){
787
                        $(this).prop("checked", true);
788
                    });
789
                });
790
791
                $("#CheckNone").click(function(e){
792
                    e.preventDefault();
793
                    $(".selection").each(function(){
794
                        $(this).prop("checked", false);
795
                    });
796
                });
797
                $(".placehold").on("click",function(e){
798
                    placeHold();
799
                    e.preventDefault();
800
                });
801
                $(".addtocart").show();
802
                let dropdown = build_dropdown();
803
                $("span.addto").html(dropdown);
783
                $("#cartsubmit").on("click",function(e){
804
                $("#cartsubmit").on("click",function(e){
784
                    cartList();
805
                    cartList();
785
                    e.preventDefault();
806
                    e.preventDefault();
Lines 811-824 Link Here
811
                    $("#barcodes").focus();
832
                    $("#barcodes").focus();
812
                });
833
                });
813
            });
834
            });
814
        [% END # /IF shelf %]
835
        </script>
836
    [% END # /IF shelf AND op == 'view' %]
815
837
816
        [% IF shelf AND op == 'edit_form' %]
838
    [% IF shelf AND op == 'edit_form' %]
839
        <script>
817
            $(document).ready(function(){
840
            $(document).ready(function(){
818
                AdjustRemark();
841
                AdjustRemark();
819
            });
842
            });
820
        [% END %]
843
        </script>
844
    [% END %]
821
845
846
    <script>
822
        /**
847
        /**
823
         * This function checks if the adequate number of records are checked for merging
848
         * This function checks if the adequate number of records are checked for merging
824
         */
849
         */
Lines 943-950 Link Here
943
                $("#permitted_staff_remark").hide();
968
                $("#permitted_staff_remark").hide();
944
            }
969
            }
945
        }
970
        }
946
        [% IF op == 'view' %]
971
    </script>
947
972
973
    [% IF op == 'view' %]
974
        <script>
948
            function sendList(){
975
            function sendList(){
949
                openWindow( CGIBIN + 'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]' );
976
                openWindow( CGIBIN + 'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]' );
950
             }
977
             }
Lines 955-963 Link Here
955
                    return false;
982
                    return false;
956
                });
983
                });
957
             });
984
             });
985
        </script>
986
    [% END %]
958
987
959
        [% END %]
960
    </script>
961
    [% IF op == 'transfer' %]
988
    [% IF op == 'transfer' %]
962
        <script>
989
        <script>
963
            $(document).ready(function () {
990
            $(document).ready(function () {
964
- 

Return to bug 41581