Koha/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt
Owen Leonard e4e5f96ffb
Bug 23464: (follow-up) QA fixes
This patch corrects two issues raised during testing:

 - Move JavaScript out of template check for IntranetUserJS so that
   SpineLabelAutoPrint behavior works correctly.
 - Add "close" button to pop-up window for cases when the barcode was
   not found.

Also changed:

- Added "required" attribute to barcode input on quick spine
  label printing page so that submitting an empty form will not work.

- Tweaked CSS slightly to fix alignment of spine label form and submit
  button. (You must rebuild the staff client CSS:
 https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-09-09 11:27:12 +01:00

53 lines
1.7 KiB
Text

[% USE raw %]
[% USE Asset %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Spine labels</title>
[% INCLUDE 'doc-head-close.inc' popup => 1 %]
[% Asset.css("css/spinelabel.css") | $raw %]
<style>
@media print {
.noprint { display: none; }
}
</style>
[% IF ( IntranetUserCSS ) %]<style>[% IntranetUserCSS | $raw %]</style>[% END %]
</head>
[% IF ( BarcodeNotFound ) %]
<body id="labels_spinelabel-print" class="tools labels">
<div class="dialog message">The barcode [% Barcode | html %] was not found.</div>
<div id="print_button" class="noprint">
<button class="btn btn-default close-window">Close</button>
</div>
[% ELSE %]
<body id="labels_spinelabel-print" class="tools labels">
<div id="spinelabel">
[% content | $raw %]
</div>
<div id="print_button" class="noprint">
<button class="btn btn-default print-label"><i class="fa fa-print"></i> Print this label</button>
</div>
[% END %]
[% Asset.js( "lib/jquery/jquery-2.2.3.min.js" ) | $raw %]
[% Asset.js( "lib/jquery/jquery-migrate-1.3.0.min.js" ) | $raw %]
[% IF ( autoprint ) %]
[% INCLUDE 'slip-print.inc' #printThenClose %]
[% END %]
<script>
[% IntranetUserJS | $raw %]
$(document).ready(function(){
$(".print-label").on("click", function(e){
e.preventDefault();
window.print();
window.close();
});
$(".close-window").on("click", function(e){
e.preventDefault();
window.close();
});
});
</script>
[% INCLUDE 'popup-bottom.inc' %]