Koha/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt
Victor Grousset/tuxayo a7bc53d943 Bug 26875: (follow-up) Fix error message ("greater or equal")
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-04 15:53:12 +01:00

91 lines
3.6 KiB
Text

[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; 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> &rsaquo;
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
<a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> &rsaquo;
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 or equal to the 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' %]