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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc (-1 / +1 lines)
Lines 52-58 Link Here
52
        [% IF ( shelf AND op == 'view' ) %]
52
        [% IF ( shelf AND op == 'view' ) %]
53
            <span class="actions"><a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | uri %]" class="addtoshelf btn btn-link btn-sm"><i class="fa fa-list" aria-hidden="true"></i> Save to another list</a></span>
53
            <span class="actions"><a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | uri %]" class="addtoshelf btn btn-link btn-sm"><i class="fa fa-list" aria-hidden="true"></i> Save to another list</a></span>
54
            [% IF can_remove_biblios %]
54
            [% IF can_remove_biblios %]
55
                <span class="actions"><a class="btn btn-link btn-sm removeitems" data-biblionumber="[% items.biblionumber | html %]" href="/cgi-bin/koha/opac-shelves.pl?op=remove_biblios&amp;shelfnumber=[% shelf.shelfnumber | html %]&amp;biblionumber=[% items.biblionumber | html %]"><i class="fa fa-remove" aria-hidden="true"></i> Remove from this list</a></span>
55
                <span class="actions"><a class="btn btn-link btn-sm removeitems" data-biblionumber="[% items.biblionumber | html %]" href="#"><i class="fa fa-remove" aria-hidden="true"></i> Remove from this list</a></span>
56
            [% END %]
56
            [% END %]
57
        [% ELSE %]
57
        [% ELSE %]
58
            <span class="actions"><a class="addtoshelf btn btn-link btn-sm" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-list" aria-hidden="true"></i> Save to lists</a></span>
58
            <span class="actions"><a class="addtoshelf btn btn-link btn-sm" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-list" aria-hidden="true"></i> Save to lists</a></span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-11 / +19 lines)
Lines 383-389 Link Here
383
                                            </span>
383
                                            </span>
384
                                        [% END %]
384
                                        [% END %]
385
                                        [% IF loggedinusername && can_remove_biblios %]
385
                                        [% IF loggedinusername && can_remove_biblios %]
386
                                            <span id="removeitems"></span>
386
                                            <a href="#" class="btn btn-link disabled removeitems tag_hides"><i class="fa fa-fw fa-remove" aria-hidden="true"></i> Remove from list</a>
387
                                        [% END %]
387
                                        [% END %]
388
                                    </div> <!-- / .links -->
388
                                    </div> <!-- / .links -->
389
                                </div> <!-- / .selections-toolbar -->
389
                                </div> <!-- / .selections-toolbar -->
Lines 547-552 Link Here
547
                                    <input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger removeitems"/>
547
                                    <input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger removeitems"/>
548
                                [% END %]
548
                                [% END %]
549
                            </form> <!-- /myform -->
549
                            </form> <!-- /myform -->
550
                            [% IF can_manage_shelf %]
551
                                <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="shelf_delete_title">
552
                                    [% INCLUDE 'csrf-token.inc' %]
553
                                    <input type="hidden" name="op" value="cud-remove_biblios" />
554
                                    <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
555
                                    <input type="hidden" name="biblionumber" id="shelf_delete_biblionumber" value="" />
556
                                    <input type="hidden" name="modifyshelfcontents" value="1" />
557
                                </form>
558
                            [% END %]
550
                        [% ELSE %]
559
                        [% ELSE %]
551
                            <div id="toolbar" class="toolbar clearfix">
560
                            <div id="toolbar" class="toolbar clearfix">
552
                                <div class="list-actions">
561
                                <div class="list-actions">
Lines 985-1000 $(function() { Link Here
985
    [% IF loggedinusername && can_remove_biblios %]
994
    [% IF loggedinusername && can_remove_biblios %]
986
        $("body").on("click", ".removeitems", function(e){
995
        $("body").on("click", ".removeitems", function(e){
987
            e.preventDefault();
996
            e.preventDefault();
988
            var href;
989
            var title;
997
            var title;
990
            var yes_label;
998
            var yes_label;
991
            var no_label;
999
            var no_label;
992
            var message = "";
1000
            var message = "";
1001
            var biblionumber;
993
            /* Single "Remove from list" link has a biblionumber data-attribute */
1002
            /* Single "Remove from list" link has a biblionumber data-attribute */
994
            if( $(this).data("biblionumber") ){
1003
            if( $(this).data("biblionumber") ){
995
                /* Use the checkbox with that value to preview the title in the confirmation */
1004
                /* Use the checkbox with that value to preview the title in the confirmation */
996
                var selected_titles = $(".cb[value='" + $(this).data("biblionumber") + "'");
1005
                var selected_titles = $(".cb[value='" + $(this).data("biblionumber") + "'");
997
                var href = $(this).attr("href");
1006
                biblionumber = $(this).data("biblionumber");
998
            } else {
1007
            } else {
999
                var selected_titles = $(".cb:checked");
1008
                var selected_titles = $(".cb:checked");
1000
            }
1009
            }
Lines 1004-1026 $(function() { Link Here
1004
                if( selected_titles.size() > 1 ){
1013
                if( selected_titles.size() > 1 ){
1005
                    message = $("<ul></ul>");
1014
                    message = $("<ul></ul>");
1006
                    title = _("Are you sure you want to remove these items from the list?");
1015
                    title = _("Are you sure you want to remove these items from the list?");
1007
                    yes_label = _("Yes, delete from list");
1016
                    yes_label = _("Yes, remove from list");
1008
                    no_label = _("No, do not delete from list");
1017
                    no_label = _("No, do not remove from list");
1009
                    selected_titles.each(function(){
1018
                    selected_titles.each(function(){
1010
                        message.append( "<li>" +  $(this).data("title") + "</li>" );
1019
                        message.append( "<li>" +  $(this).data("title") + "</li>" );
1011
                    });
1020
                    });
1012
                } else {
1021
                } else {
1013
                    title = _("Are you sure you want to remove this item from the list?");
1022
                    title = _("Are you sure you want to remove this item from the list?");
1014
                    yes_label = _("Yes, delete from list");
1023
                    yes_label = _("Yes, remove from list");
1015
                    no_label = _("No, do not delete from list");
1024
                    no_label = _("No, do not remove from list");
1016
                    selected_titles.each(function(){
1025
                    selected_titles.each(function(){
1017
                        message += $(this).data("title");
1026
                        message += $(this).data("title");
1018
                    });
1027
                    });
1019
                }
1028
                }
1020
                confirmModal( message, title, yes_label, no_label, function( result ){
1029
                confirmModal( message, title, yes_label, no_label, function( result ){
1021
                    if( result ){
1030
                    if( result ){
1022
                        if( href ){
1031
                        if( selected_titles.size() == 1 ){
1023
                            location.href= href;
1032
                            $("#shelf_delete_biblionumber").val( biblionumber );
1033
                            $("#shelf_delete_title").submit();
1024
                        } else {
1034
                        } else {
1025
                            $("#myform").submit();
1035
                            $("#myform").submit();
1026
                        }
1036
                        }
Lines 1029-1035 $(function() { Link Here
1029
            }
1039
            }
1030
        });
1040
        });
1031
1041
1032
        $("#removeitems").html("<a href=\"#\" class=\"btn btn-link disabled removeitems tag_hides\"><i class=\"fa fa-fw fa-remove\" aria-hidden=\"true\"></i> "+_("Remove from list")+"</a>");
1033
    [% END %]
1042
    [% END %]
1034
    [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
1043
    [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
1035
    [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
1044
    [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
1036
- 

Return to bug 37150