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

(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-33 lines)
Lines 4748-4783 div .suggestion_note { Link Here
4748
        border-bottom-right-radius: 5px;
4748
        border-bottom-right-radius: 5px;
4749
    }
4749
    }
4750
}
4750
}
4751
4752
@media print {
4753
    body.modalprinter * {
4754
        visibility: hidden;
4755
    }
4756
4757
    body.modalprinter .modal-dialog.focused {
4758
        left: 0;
4759
        margin: 0;
4760
        padding: 0;
4761
        position: absolute;
4762
        top: 0;
4763
    }
4764
4765
    body.modalprinter .modal-dialog.focused .modal-content {
4766
        border-width: 0;
4767
    }
4768
4769
    body.modalprinter .modal-dialog.focused .modal-content .modal-header .modal-title,
4770
    body.modalprinter .modal-dialog.focused .modal-content .modal-body,
4771
    body.modalprinter .modal-dialog.focused .modal-content .modal-body * {
4772
        visibility: visible;
4773
    }
4774
4775
    body.modalprinter .modal-dialog.focused .modal-content .modal-header,
4776
    body.modalprinter .modal-dialog.focused .modal-content .modal-body {
4777
        padding: 0;
4778
    }
4779
4780
    body.modalprinter .modal-dialog.focused .modal-content .modal-header .modal-title {
4781
        margin-bottom: 20px;
4782
    }
4783
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-16 / +1 lines)
Lines 1638-1659 Link Here
1638
                "order": [[ 1, 'asc' ], [ 0, 'asc' ]]
1638
                "order": [[ 1, 'asc' ], [ 0, 'asc' ]]
1639
            }));
1639
            }));
1640
1640
1641
            // print modals
1642
            $('.modal.printable').on('shown.bs.modal', function() {
1643
                $('.modal-dialog', this).addClass('focused');
1644
                $('body').addClass('modalprinter');
1645
1646
                if ($(this).hasClass('autoprint')) {
1647
                    window.print();
1648
                }
1649
            }).on('hidden.bs.modal', function() {
1650
                $('.modal-dialog', this).removeClass('focused');
1651
                $('body').removeClass('modalprinter');
1652
            });
1653
1654
            $('.printModal').click(function() {
1655
                window.print();
1656
            });
1657
            [% IF ( !(Koha.Preference('TransfersBlockCirc')) && Koha.Preference('AutomaticConfirmTransfer') ) %]
1641
            [% IF ( !(Koha.Preference('TransfersBlockCirc')) && Koha.Preference('AutomaticConfirmTransfer') ) %]
1658
                $("#wrong-transfer-modal").on('hidden.bs.modal',function(){
1642
                $("#wrong-transfer-modal").on('hidden.bs.modal',function(){
1659
                    $("#wrongtransferform").submit();
1643
                    $("#wrongtransferform").submit();
Lines 1665-1670 Link Here
1665
                [% END %]
1649
                [% END %]
1666
            [% END %]
1650
            [% END %]
1667
        });
1651
        });
1652
        [% Asset.js("js/modal_printer.js") | $raw %]
1668
    </script>
1653
    </script>
1669
1654
1670
[% END %]
1655
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt (+1 lines)
Lines 352-357 Link Here
352
    [% INCLUDE 'format_price.inc' %]
352
    [% INCLUDE 'format_price.inc' %]
353
    [% INCLUDE 'js-date-format.inc' %]
353
    [% INCLUDE 'js-date-format.inc' %]
354
    [% Asset.js("js/cashup_modal.js") | $raw %]
354
    [% Asset.js("js/cashup_modal.js") | $raw %]
355
    [% Asset.js("js/modal_printer.js") | $raw %]
355
    [% INCLUDE 'calendar.inc' %]
356
    [% INCLUDE 'calendar.inc' %]
356
    <script>
357
    <script>
357
        var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, {
358
        var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, {
(-)a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js (-56 lines)
Lines 41-100 $(document).ready(function() { Link Here
41
            }
41
            }
42
        });
42
        });
43
    });
43
    });
44
45
    $('.modal.printable').on('shown.bs.modal', function() {
46
        $('.modal-dialog', this).addClass('focused');
47
        $('body').addClass('modalprinter');
48
49
        if ($(this).hasClass('autoprint')) {
50
            window.print();
51
        }
52
    }).on('hidden.bs.modal', function() {
53
        $('.modal-dialog', this).removeClass('focused');
54
        $('body').removeClass('modalprinter');
55
    });
56
57
    $('.printModal').click(function() {
58
59
        let contents = $('#cashupSummaryModal .modal-body').html();
60
        let win = window.open('','');
61
        win.document.write(`
62
            <style>
63
                table {
64
                    background-color: #FFFFFF;
65
                    border-bottom: 1px solid #CCCCCC;
66
                    border-collapse: collapse;
67
                    border-left: 1px solid #CCCCCC;
68
                    margin: 3px 0 5px 0;
69
                    padding: 0;
70
                    width: 99%;
71
                }
72
73
                td {
74
                    background-color: #FFF;
75
                    border-bottom: 1px solid #CCCCCC;
76
                    border-left: 0;
77
                    border-right: 1px solid #CCCCCC;
78
                    border-top: 0;
79
                    font-size: 12px;
80
                    padding: 5px 5px 5px 5px;
81
                }
82
83
                th {
84
                    background-color: #E9E9E9;
85
                    border-bottom: 1px solid #CCCCCC;
86
                    border-left: 0;
87
                    border-right: 1px solid #CCCCCC;
88
                    border-top: 0;
89
                    font-size: 14px;
90
                    font-weight: bold;
91
                    padding: 5px 5px 5px 5px;
92
                    text-align: left;
93
                }
94
            </style>
95
        `)
96
        win.document.write( contents );
97
        win.print();
98
        win.close();
99
    });
100
});
44
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/modal_printer.js (-1 / +63 lines)
Line 0 Link Here
0
- 
1
$(document).ready(function() {
2
3
    function modalPrint() {
4
        let title = $('.modal-dialog.focused .modal-title').html();
5
        let contents = $('.modal-dialog.focused .modal-body').html();
6
        let win = window.open('','');
7
        win.document.write(`
8
            <style>
9
                table {
10
                    background-color: #FFFFFF;
11
                    border-bottom: 1px solid #CCCCCC;
12
                    border-collapse: collapse;
13
                    border-left: 1px solid #CCCCCC;
14
                    margin: 3px 0 5px 0;
15
                    padding: 0;
16
                    width: 99%;
17
                }
18
19
                td {
20
                    background-color: #FFF;
21
                    border-bottom: 1px solid #CCCCCC;
22
                    border-left: 0;
23
                    border-right: 1px solid #CCCCCC;
24
                    border-top: 0;
25
                    font-size: 12px;
26
                    padding: 5px 5px 5px 5px;
27
                }
28
29
                th {
30
                    background-color: #E9E9E9;
31
                    border-bottom: 1px solid #CCCCCC;
32
                    border-left: 0;
33
                    border-right: 1px solid #CCCCCC;
34
                    border-top: 0;
35
                    font-size: 14px;
36
                    font-weight: bold;
37
                    padding: 5px 5px 5px 5px;
38
                    text-align: left;
39
                }
40
            </style>
41
        `)
42
        win.document.write( title );
43
        win.document.write( contents );
44
        win.print();
45
        win.close();
46
    }
47
48
    // Set focused on printable modals on open and autoprint if required
49
    $('.modal.printable').on('shown.bs.modal', function() {
50
        $('.modal-dialog', this).addClass('focused');
51
52
        if ($(this).hasClass('autoprint')) {
53
            modalPrint();
54
        }
55
    }).on('hidden.bs.modal', function() {
56
        $('.modal-dialog', this).removeClass('focused');
57
    });
58
59
    // Trigger print on button click
60
    $('.printModal').click(function() {
61
        modalPrint();
62
    });
63
});

Return to bug 31041