Koha/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt
Lucas Gass d90831f67f Bug 29824: Allow editing of quick spine labels
To test:
1. Apply patch
2. Go to the quick spine label tool and enter a barcode of an item with a itemcallnumber
3. Notice the 'Edit this label' button at the bottom of the page, click it
4. Edit the itemcallnumber in some way: add some line breaks, remove some, insert some new characters, remove some characters.
5. You can now print the label with your edits.

Note: This changes nothing in the database, if you relaod the same item/itemcallnumer it will have returned to its original form

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-24 14:35:36 -10:00

59 lines
2 KiB
Text

[% USE raw %]
[% USE Asset %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Spine labels &rsaquo; Tools &rsaquo; Koha</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>
<button class="btn btn-default edit-label"><i class="fa fa-lock"></i> Edit 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>
$(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();
});
$('.edit-label').click( function() {
$('#spinelabel').attr('contenteditable', function(index, attr){
return attr == 'true' ? null : 'true';
});
$('.edit-label .fa').toggleClass('fa-lock').toggleClass('fa-unlock');
});
});
</script>
[% INCLUDE 'popup-bottom.inc' %]