Bug 26875: (follow-up) Fix error message ("greater or equal")
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-edit-range.tt
1 [% SET footerjs = 1 %]
2     [% INCLUDE 'doc-head-open.inc' %]
3     <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Barcode range</title>
4     [% INCLUDE 'doc-head-close.inc' %]
5     [% INCLUDE 'greybox.inc' %]
6 </head>
7 <body id="labels_label-home" class="tools labels">
8     [% INCLUDE 'header.inc' %]
9     [% INCLUDE 'cat-search.inc' %]
10     <div id="breadcrumbs">
11         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
12         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
13         <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> &rsaquo;
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>
55         function Xport() {
56             var str = "";
57             str += "from=" + parseInt(document.getElementById("from-input").value) + "&";
58             str += "to=" + parseInt(document.getElementById("to-input").value);
59             return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?" + str, 400, 800);
60         }
61
62         $(document).ready(function () {
63             $.validator.addMethod("gt", function(value, element, params) {
64                 return parseInt(value) >= parseInt($(params).val());
65             }, _("Must be greater or equal to the from value."));
66
67             $("form[name=add_by_number]").validate({
68                 rules: {
69                     from: {
70                         required: true,
71                         number: true,
72                         min: 1
73                     },
74                     to: {
75                         required: true,
76                         number: true,
77                         gt: "#from-input"
78                     }
79                 }
80             });
81
82             $("#print").on("click", function () {
83                 if ( $("form[name=add_by_number]").valid() ) {
84                     return Xport();
85                 }
86             });
87         });
88     </script>
89 [% END %]
90
91 [% INCLUDE 'intranet-bottom.inc' %]