Browse Source

Bug 26172: (follow-up) Add print option

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Martin Renvoize 1 year ago
committed by Jonathan Druart
parent
commit
eaabed085f
  1. 33
      koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
  2. 19
      koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt

33
koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss

@ -4497,3 +4497,36 @@ div .suggestion_note {
border-bottom-right-radius: 5px;
}
}
@media print {
body.modalprinter * {
visibility: hidden;
}
body.modalprinter .modal-dialog.focused {
position: absolute;
padding: 0;
margin: 0;
left: 0;
top: 0;
}
body.modalprinter .modal-dialog.focused .modal-content {
border-width: 0;
}
body.modalprinter .modal-dialog.focused .modal-content .modal-header .modal-title,
body.modalprinter .modal-dialog.focused .modal-content .modal-body,
body.modalprinter .modal-dialog.focused .modal-content .modal-body * {
visibility: visible;
}
body.modalprinter .modal-dialog.focused .modal-content .modal-header,
body.modalprinter .modal-dialog.focused .modal-content .modal-body {
padding: 0;
}
body.modalprinter .modal-dialog.focused .modal-content .modal-header .modal-title {
margin-bottom: 20px;
}
}

19
koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt

@ -306,7 +306,7 @@
<!-- Cashup summary modal -->
[% IF register.last_cashup %]
<div class="modal" id="cashupSummaryModal" tabindex="-1" role="dialog" aria-labelledby="cashupSummaryLabel">
<div class="modal printable" id="cashupSummaryModal" tabindex="-1" role="dialog" aria-labelledby="cashupSummaryLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
@ -356,6 +356,7 @@
</div> <!-- /.modal-body -->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="printModal btn btn-primary"><i class="fa fa-print"></i> Print</button>
</div> <!-- /.modal-footer -->
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
@ -427,6 +428,22 @@
win.focus();
});
$('.modal.printable').on('shown.bs.modal', function() {
$('.modal-dialog', this).addClass('focused');
$('body').addClass('modalprinter');
if ($(this).hasClass('autoprint')) {
window.print();
}
}).on('hidden.bs.modal', function () {
$('.modal-dialog', this).removeClass('focused');
$('body').removeClass('modalprinter');
});
$('.printModal').click(function() {
window.print();
});
$(document).ready(function() {
// http://jqueryui.com/demos/datepicker/#date-range
var dates = $( "#from, #to" ).datepicker({

Loading…
Cancel
Save