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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/bundle_contents.inc (-21 / +2 lines)
Lines 4-31 Link Here
4
        <div class="modal-content">
4
        <div class="modal-content">
5
            <div class="modal-header">
5
            <div class="modal-header">
6
                <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
6
                <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
7
                <h4 class="modal-title" id="bundleContentsLabel">Bundle contents for [% item.barcode | html %]</h4>
7
                <h4 class="modal-title" id="bundleContentsLabel"></h4>
8
            </div>
8
            </div>
9
            <div class="modal-body">
9
            <div class="modal-body"></div> <!-- /.modal-body -->
10
                <table style="width:100%">
11
                    <thead>
12
                        <tr>
13
                            <th>Barcode</th>
14
                            <th>Title</th>
15
                        </tr>
16
                    </thead>
17
                    <tbody>
18
                    [% FOREACH bundle_item IN bundle_items %]
19
                        <tr>
20
                            <td>[% bundle_item.barcode | html %]</td>
21
                            <td>[% INCLUDE 'biblio-title.inc' biblio=bundle_item.biblio %]</td>
22
                        </tr>
23
                    [% END %]
24
                    </tbody>
25
                    <tfoot>
26
                    </tfoot>
27
                </table>
28
            </div> <!-- /.modal-body -->
29
            <div class="modal-footer">
10
            <div class="modal-footer">
30
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
11
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
31
                <button type="button" class="printModal btn btn-primary"><i class="fa fa-print"></i> Print</button>
12
                <button type="button" class="printModal btn btn-primary"><i class="fa fa-print"></i> Print</button>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-20 / +5 lines)
Lines 224-231 Link Here
224
                                    <h3>Bundle had missing items</h3>
224
                                    <h3>Bundle had missing items</h3>
225
                                    <p>Bundle contents list updated</p>
225
                                    <p>Bundle contents list updated</p>
226
                                    <p>
226
                                    <p>
227
                                        <a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleContentsModal"><i class="fa fa-eye" aria-hidden="true"></i> View updated contents list</a>
227
                                        <a class="btn btn-default btn-xs bundle-contents" role="button" data-itemnumber="[% item.itemnumber | html %]" href="#bundleContentsModal"><i class="fa fa-eye bundle-contents-icon" aria-hidden="true"></i><i class="fa fa-spinner fa-pulse fa-fw bundle-contents-spinner" style="display:none"></i> View updated contents list</a>
228
                                        <a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleMissingModal"><i class="fa fa-eye" aria-hidden="true"></i> View list of missing items</a>
228
                                        <a class="btn btn-default btn-xs bundle-missing" role="button" data-toggle="modal" href="#bundleMissingModal"><i class="fa fa-eye" aria-hidden="true"></i> View list of missing items</a>
229
                                    </p>
229
                                    </p>
230
                                </div>
230
                                </div>
231
                            [% END %]
231
                            [% END %]
Lines 386-392 Link Here
386
                                <div class="dialog message">
386
                                <div class="dialog message">
387
                                    <h3>Bundle verified</h3>
387
                                    <h3>Bundle verified</h3>
388
                                    <p>The bundle content was verified</p>
388
                                    <p>The bundle content was verified</p>
389
                                    <p><a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleContentsModal"><i class="fa fa-eye" aria-hidden="true"></i> View contents list</a></p>
389
                                    <p><a class="btn btn-default btn-xs bundle-contents" role="button" data-itemnumber="[% item.itemnumber | html %]" href="#bundleContentsModal"><i class="fa fa-eye bundle-contents-icon" aria-hidden="true"></i><i class="fa fa-spinner fa-pulse fa-fw bundle-contents-spinner" style="display:none"></i> View contents list</a></p>
390
                                </div>
390
                                </div>
391
                            [% END %]
391
                            [% END %]
392
                        [% END # /BLOCK all_checkin_messages %]
392
                        [% END # /BLOCK all_checkin_messages %]
Lines 1359-1364 Link Here
1359
        </script>
1359
        </script>
1360
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1360
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1361
    [% END %]
1361
    [% END %]
1362
    [% Asset.js("js/bundle_contents_modal.js") | $raw %]
1363
    [% INCLUDE 'timepicker.inc' %]
1362
1364
1363
    <script>
1365
    <script>
1364
        function Dopop(link) {
1366
        function Dopop(link) {
Lines 1588-1610 Link Here
1588
                "bInfo": false,
1590
                "bInfo": false,
1589
                "order": [[ 1, 'asc' ], [ 0, 'asc' ]]
1591
                "order": [[ 1, 'asc' ], [ 0, 'asc' ]]
1590
            }));
1592
            }));
1591
1592
            // print modals
1593
            $('.modal.printable').on('shown.bs.modal', function() {
1594
                $('.modal-dialog', this).addClass('focused');
1595
                $('body').addClass('modalprinter');
1596
1597
                if ($(this).hasClass('autoprint')) {
1598
                    window.print();
1599
                }
1600
            }).on('hidden.bs.modal', function() {
1601
                $('.modal-dialog', this).removeClass('focused');
1602
                $('body').removeClass('modalprinter');
1603
            });
1604
1605
            $('.printModal').click(function() {
1606
                window.print();
1607
            });
1608
        });
1593
        });
1609
    </script>
1594
    </script>
1610
1595
(-)a/koha-tmpl/intranet-tmpl/prog/js/bundle_contents_modal.js (-1 / +36 lines)
Line 0 Link Here
0
- 
1
$('body').on('click', '.bundle-contents', function (e) {
2
    let itemnumber = $(this).data('itemnumber');
3
4
    let modal = $('#bundleContentsModal');
5
    $('.bundle-contents-icon').hide();
6
    $('.bundle-contents-spinner').show();
7
    $.ajax({
8
        url: '/api/v1/items/' + itemnumber + '/print_slips/BUNDLE',
9
        success: function(data) {
10
            console.log(data);
11
            modal.find('.modal-title').text(data.title);
12
            modal.find('.modal-body').html(data.content);
13
            modal.modal('show');
14
            $('.bundle-contents-spinner').hide();
15
            $('.bundle-contents-icon').show();
16
        },
17
        contentType: "json"
18
    });
19
20
});
21
22
$('.modal.printable').on('shown.bs.modal', function() {
23
    $('.modal-dialog', this).addClass('focused');
24
    $('body').addClass('modalprinter');
25
26
    if ($(this).hasClass('autoprint')) {
27
        window.print();
28
    }
29
}).on('hidden.bs.modal', function() {
30
    $('.modal-dialog', this).removeClass('focused');
31
    $('body').removeClass('modalprinter');
32
});
33
34
$('.printModal').click(function() {
35
    window.print();
36
});

Return to bug 29566