|
Lines 1-11
Link Here
|
|
|
1 |
[% SET footerjs = 1 %] |
| 1 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
| 2 |
<title>Koha › Tools › Label creator</title> |
3 |
<title>Koha › Tools › Label creator › Barcode range</title> |
| 3 |
[% INCLUDE 'doc-head-close.inc' %] |
4 |
[% INCLUDE 'doc-head-close.inc' %] |
| 4 |
[% INCLUDE 'greybox.inc' %] |
5 |
[% INCLUDE 'greybox.inc' %] |
| 5 |
[% IF ( bidi ) %] |
6 |
</head> |
| 6 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" /> |
7 |
<body id="labels_label-home" class="tools labels"> |
| 7 |
[% END %] |
8 |
[% INCLUDE 'header.inc' %] |
| 8 |
<script type="text/javascript"> |
9 |
[% INCLUDE 'cat-search.inc' %] |
|
|
10 |
<div id="breadcrumbs"> |
| 11 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> › |
| 12 |
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › |
| 13 |
<a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> › |
| 14 |
Barcode range |
| 15 |
</div> |
| 16 |
|
| 17 |
<div class="main container-fluid"> |
| 18 |
<div class="row"> |
| 19 |
<div class="col-sm-10 col-sm-push-2"> |
| 20 |
<main> |
| 21 |
[% INCLUDE 'labels-toolbar.inc' %] |
| 22 |
<h2>Print barcode range</h2> |
| 23 |
<form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post"> |
| 24 |
<input type="hidden" name="op" value="add" /> |
| 25 |
<fieldset class="rows"> |
| 26 |
<ol> |
| 27 |
<li> |
| 28 |
<label for="from-input">From:</label> |
| 29 |
<input type="number" name="from" id="from-input" value="0" style="text-align: right;"/> |
| 30 |
</li> |
| 31 |
<li> |
| 32 |
<label for="to-input">To:</label> |
| 33 |
<input type="number" name="to" id="to-input" value="0" style="text-align: right;"/> |
| 34 |
</li> |
| 35 |
</ol> |
| 36 |
</fieldset> |
| 37 |
<fieldset class="action"> |
| 38 |
<button type="button" class="btn btn-default" id="print">Print range</button> |
| 39 |
</fieldset> |
| 40 |
</form> |
| 41 |
</main> |
| 42 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
| 43 |
|
| 44 |
<div class="col-sm-2 col-sm-pull-10"> |
| 45 |
<aside> |
| 46 |
[% INCLUDE 'tools-menu.inc' %] |
| 47 |
</aside> |
| 48 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
| 49 |
</div> <!-- /.row --> |
| 50 |
</div> <!-- /.main.container-fluid --> |
| 51 |
|
| 52 |
[% MACRO jsinclude BLOCK %] |
| 53 |
[% Asset.js("js/tools-menu.js") | $raw %] |
| 54 |
<script> |
| 9 |
function Xport() { |
55 |
function Xport() { |
| 10 |
var str = ""; |
56 |
var str = ""; |
| 11 |
str += "from=" + parseInt(document.getElementById("from-input").value) + "&"; |
57 |
str += "from=" + parseInt(document.getElementById("from-input").value) + "&"; |
|
Lines 13-105
Link Here
|
| 13 |
return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?" + str, 400, 800); |
59 |
return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?" + str, 400, 800); |
| 14 |
} |
60 |
} |
| 15 |
|
61 |
|
| 16 |
function validate() { |
62 |
$(document).ready(function () { |
| 17 |
var error = false; |
63 |
$.validator.addMethod("gt", function(value, element, params) { |
| 18 |
var from_input = document.getElementById("from-input").value; |
64 |
return parseInt(value) > parseInt($(params).val()); |
| 19 |
var to_input = document.getElementById("to-input").value; |
65 |
}, _("Must be greater than from value.")); |
| 20 |
|
|
|
| 21 |
if (isNaN(parseInt(from_input))) { |
| 22 |
document.getElementById("from-error").innerHTML = " *Must be a positive integer"; |
| 23 |
error = true; |
| 24 |
} else if (parseInt(from_input) < 1) { |
| 25 |
document.getElementById("from-error").innerHTML = " *Cannot be smaller than 1"; |
| 26 |
error = true; |
| 27 |
} else { |
| 28 |
document.getElementById("from-error").innerHTML = ""; |
| 29 |
} |
| 30 |
|
66 |
|
| 31 |
if (isNaN(parseInt(to_input))) { |
67 |
$("form[name=add_by_number]").validate({ |
| 32 |
document.getElementById("to-error").innerHTML = " *Must be a positive integer"; |
68 |
rules: { |
| 33 |
error = true; |
69 |
from: { |
| 34 |
} else if (parseInt(from_input) > parseInt(to_input)) { |
70 |
required: true, |
| 35 |
document.getElementById("to-error").innerHTML = " *Cannot be smaller than starting value"; |
71 |
number: true, |
| 36 |
error = true; |
72 |
min: 1 |
| 37 |
} else { |
73 |
}, |
| 38 |
document.getElementById("to-error").innerHTML = ""; |
74 |
to: { |
| 39 |
} |
75 |
required: true, |
| 40 |
|
76 |
number: true, |
| 41 |
if (error) |
77 |
gt: "#from-input" |
| 42 |
return; |
78 |
} |
| 43 |
|
79 |
} |
| 44 |
return Xport(); |
80 |
}); |
| 45 |
} |
|
|
| 46 |
|
81 |
|
|
|
82 |
$("#print").on("click", function () { |
| 83 |
if ( $("form[name=add_by_number]").valid() ) { |
| 84 |
return Xport(); |
| 85 |
} |
| 86 |
}); |
| 87 |
}); |
| 47 |
</script> |
88 |
</script> |
| 48 |
</head> |
89 |
[% END %] |
| 49 |
<body id="labels_label-home" class="tools labels"> |
|
|
| 50 |
[% INCLUDE 'header.inc' %] |
| 51 |
[% INCLUDE 'cat-search.inc' %] |
| 52 |
<div id="breadcrumbs"> |
| 53 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> › |
| 54 |
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › |
| 55 |
Label creator |
| 56 |
</div> |
| 57 |
<div id="doc3" class="yui-t2"> |
| 58 |
<div id="bd"> |
| 59 |
<div id="yui-main"> |
| 60 |
<div class="yui-b"> |
| 61 |
<div class="yui-g"> |
| 62 |
[% INCLUDE 'labels-toolbar.inc' %] |
| 63 |
<div class="yui-u first"> |
| 64 |
|
90 |
|
| 65 |
</div> |
91 |
[% INCLUDE 'intranet-bottom.inc' %] |
| 66 |
<h3>Print barcode range</h3> |
|
|
| 67 |
</div> |
| 68 |
<form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post"> |
| 69 |
<div> |
| 70 |
<fieldset class="rows" style="border-bottom: 0px; border: 0px;"> |
| 71 |
<ol> |
| 72 |
<li> |
| 73 |
<input type="hidden" name="op" value="add" /> |
| 74 |
</li> |
| 75 |
<li> |
| 76 |
<label for="from-input">From:</label> |
| 77 |
<input type="number" name="from" id="from-input" value="0" style="text-align: right;"/> |
| 78 |
<span id="from-error" style="color: red; font-style: italic;"></span> |
| 79 |
<br/> |
| 80 |
</li> |
| 81 |
<li> |
| 82 |
<label for="to-input">To:</label> |
| 83 |
<input type="number" name="to" id="to-input" value="0" style="text-align: right;"/> |
| 84 |
<span id="to-error" style="color: red; font-style: italic;"></span> |
| 85 |
<br/> |
| 86 |
</li> |
| 87 |
</ol> |
| 88 |
</fieldset> |
| 89 |
</div> |
| 90 |
</form> |
| 91 |
<div id="batch-manage" class="btn-toolbar"> |
| 92 |
<a class="btn btn-default btn-sm" id="print" onClick="validate()"> |
| 93 |
<!-- This display a plus. Is there a more appropriate symbol to use? |
| 94 |
<i class="fa fa-plus"></i> |
| 95 |
--> |
| 96 |
Print range |
| 97 |
</a> |
| 98 |
</div> |
| 99 |
</div> |
| 100 |
</div> |
| 101 |
<div class="yui-b"> |
| 102 |
[% INCLUDE 'tools-menu.inc' %] |
| 103 |
</div> |
| 104 |
</div> |
| 105 |
[% INCLUDE 'intranet-bottom.inc' %] |
| 106 |
- |
|
|