7d6740cf57
Edit the labels/label-edit-range.tt template to follow current standards : - Use footer javascript - Use bootstrap grid - Use jQuery Validation plugin for validation Also fixes breadcrumbs to be more specific. To test: Make sure the page looks correct and still works as expected. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
91 lines
No EOL
3.6 KiB
Text
91 lines
No EOL
3.6 KiB
Text
[% SET footerjs = 1 %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Tools › Label creator › Barcode range</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% INCLUDE 'greybox.inc' %]
|
|
</head>
|
|
<body id="labels_label-home" class="tools labels">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
<div id="breadcrumbs">
|
|
<a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
|
|
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
|
|
<a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> ›
|
|
Barcode range
|
|
</div>
|
|
|
|
<div class="main container-fluid">
|
|
<div class="row">
|
|
<div class="col-sm-10 col-sm-push-2">
|
|
<main>
|
|
[% INCLUDE 'labels-toolbar.inc' %]
|
|
<h2>Print barcode range</h2>
|
|
<form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post">
|
|
<input type="hidden" name="op" value="add" />
|
|
<fieldset class="rows">
|
|
<ol>
|
|
<li>
|
|
<label for="from-input">From:</label>
|
|
<input type="number" name="from" id="from-input" value="0" style="text-align: right;"/>
|
|
</li>
|
|
<li>
|
|
<label for="to-input">To:</label>
|
|
<input type="number" name="to" id="to-input" value="0" style="text-align: right;"/>
|
|
</li>
|
|
</ol>
|
|
</fieldset>
|
|
<fieldset class="action">
|
|
<button type="button" class="btn btn-default" id="print">Print range</button>
|
|
</fieldset>
|
|
</form>
|
|
</main>
|
|
</div> <!-- /.col-sm-10.col-sm-push-2 -->
|
|
|
|
<div class="col-sm-2 col-sm-pull-10">
|
|
<aside>
|
|
[% INCLUDE 'tools-menu.inc' %]
|
|
</aside>
|
|
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
|
|
</div> <!-- /.row -->
|
|
</div> <!-- /.main.container-fluid -->
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
[% Asset.js("js/tools-menu.js") | $raw %]
|
|
<script>
|
|
function Xport() {
|
|
var str = "";
|
|
str += "from=" + parseInt(document.getElementById("from-input").value) + "&";
|
|
str += "to=" + parseInt(document.getElementById("to-input").value);
|
|
return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?" + str, 400, 800);
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
$.validator.addMethod("gt", function(value, element, params) {
|
|
return parseInt(value) > parseInt($(params).val());
|
|
}, _("Must be greater than from value."));
|
|
|
|
$("form[name=add_by_number]").validate({
|
|
rules: {
|
|
from: {
|
|
required: true,
|
|
number: true,
|
|
min: 1
|
|
},
|
|
to: {
|
|
required: true,
|
|
number: true,
|
|
gt: "#from-input"
|
|
}
|
|
}
|
|
});
|
|
|
|
$("#print").on("click", function () {
|
|
if ( $("form[name=add_by_number]").valid() ) {
|
|
return Xport();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %] |