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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc (-6 / +1 lines)
Lines 23-34 Link Here
23
                </div>
23
                </div>
24
                [% UNLESS ( basketcount OR subscriptioncount ) %]
24
                [% UNLESS ( basketcount OR subscriptioncount ) %]
25
                    <div class="btn-group">
25
                    <div class="btn-group">
26
                        <form action="/cgi-bin/koha/acqui/supplier.pl" method="post">
26
                        <button type="button" data-toggle="modal" data-target="#deleteVendorModal" data-booksellerid="[% booksellerid | html %]" class="btn btn-default"><i class="fa fa-trash-can"></i> Delete vendor</button>
27
                            [% INCLUDE 'csrf-token.inc' %]
28
                            <input type="hidden" name="op" value="cud-delete" />
29
                            <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
30
                            <button class="btn btn-default" id="deletesupplier" type="submit"><i class="fa fa-trash-can"></i> Delete vendor</button>
31
                        </form>
32
                    </div>
27
                    </div>
33
                [% END %]
28
                [% END %]
34
            [% END %]
29
            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/delete_vendor.inc (+23 lines)
Line 0 Link Here
1
<!-- Delete Vendor modal form -->
2
<div id="deleteVendorModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="deleteVendorModalLabel">
3
    <form method="post" action="/cgi-bin/koha/acqui/supplier.pl">
4
        [% INCLUDE 'csrf-token.inc' %]
5
        <input type="hidden" name="op" value="cud-delete" />
6
        <input type="hidden" name="booksellerid" id="booksellerid" value="" />
7
        <div class="modal-dialog" role="document">
8
            <div class="modal-content">
9
                <div class="modal-header">
10
                    <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
11
                    <h4 class="modal-title" id="deleteVendorModalLabel">Delete vendor</h4>
12
                </div>
13
                <div class="modal-body">
14
                    <p>Are you sure you want to delete this vendor?</p>
15
                </div>
16
                <div class="modal-footer">
17
                    <button id="deleteVendorModaConfirmBtn" class="btn btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Yes</button>
18
                    <button id="deleteVendorModaCancelBtn"data-dismiss="modal" class="btn btn-secondary"><i class="fa fa-times" aria-hidden="true"></i> No</button>
19
                </div>
20
            </div>
21
        </div>
22
    </form>
23
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt (-2 / +4 lines)
Lines 208-214 Link Here
208
                                                <a class="btn btn-default btn-xs" id="addtoBasketLabel[% basket.basketno | html %]" href="#addtoBasket[% basket.basketno | html %]" role="button" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a>
208
                                                <a class="btn btn-default btn-xs" id="addtoBasketLabel[% basket.basketno | html %]" href="#addtoBasket[% basket.basketno | html %]" role="button" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a>
209
                                            [% END %]
209
                                            [% END %]
210
                                            <!-- Modal -->
210
                                            <!-- Modal -->
211
                                            <div id="addtoBasket[% basket.basketno | html %]" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno | html %]" aria-hidden="true" data-basketno="[% basket.basketname | html %]">
211
                                            <div id="addtoBasket[% basket.basketno | html %]" class="modal add_to_basket" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno | html %]" aria-hidden="true" data-basketno="[% basket.basketname | html %]">
212
                                                <div class="modal-dialog" role="document">
212
                                                <div class="modal-dialog" role="document">
213
                                                    <div class="modal-content">
213
                                                    <div class="modal-content">
214
                                                        <div class="modal-header">
214
                                                        <div class="modal-header">
Lines 257-262 Link Here
257
    </div>
257
    </div>
258
</div> <!-- /.row -->
258
</div> <!-- /.row -->
259
259
260
[% INCLUDE 'modals/delete_vendor.inc' %]
261
260
[% MACRO jsinclude BLOCK %]
262
[% MACRO jsinclude BLOCK %]
261
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
263
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
262
    [% INCLUDE 'datatables.inc' %]
264
    [% INCLUDE 'datatables.inc' %]
Lines 277-283 Link Here
277
                var id = $(this).find("option:selected").val();
279
                var id = $(this).find("option:selected").val();
278
                window.location.href = "#vendor" + id;
280
                window.location.href = "#vendor" + id;
279
            });
281
            });
280
            $(".modal").on("shown.bs.modal", function(){
282
            $(".add_to_basket").on("shown.bs.modal", function(){
281
                var basket = $(this).data("basketno");
283
                var basket = $(this).data("basketno");
282
                var legend = _("Add order to basket %s").format(basket);
284
                var legend = _("Add order to basket %s").format(basket);
283
                $(this).find("h4").text( legend );
285
                $(this).find("h4").text( legend );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt (+2 lines)
Lines 524-529 Link Here
524
    </aside>
524
    </aside>
525
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
525
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
526
</div> <!-- /.row -->
526
</div> <!-- /.row -->
527
[% INCLUDE 'modals/delete_vendor.inc' %]
528
527
[% MACRO jsinclude BLOCK %]
529
[% MACRO jsinclude BLOCK %]
528
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
530
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
529
    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
531
    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/acq.js (-3 / +4 lines)
Lines 389-395 function hideAllColumns(){ Link Here
389
}
389
}
390
390
391
$(document).ready(function(){
391
$(document).ready(function(){
392
    $("#deletesupplier").on("click", function(){
392
    $("#deleteVendorModal").on("shown.bs.modal", function(e){
393
        confirmDelete(__("Are you sure you want to delete this vendor?") );
393
        var button = $(e.relatedTarget);
394
        var item = button.data('booksellerid');
395
        $('#booksellerid').val(item);
394
    });
396
    });
395
});
397
});
396
- 

Return to bug 31921