Bug 31882: Correct titles for pages in new cataloging module
[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>Print barcode range &rsaquo; Label creator &rsaquo; Cataloging &rsaquo; Koha</title>
4     [% INCLUDE 'doc-head-close.inc' %]
5     [% INCLUDE 'greybox.inc' %]
6 </head>
7 <body id="labels_label-home" class="tools labels">
8     [% WRAPPER 'header.inc' %]
9     [% INCLUDE 'cat-search.inc' %]
10 [% END %]
11
12     [% WRAPPER 'sub-header.inc' %]
13     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
14         <ol>
15             <li>
16                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17             </li>
18             <li>
19                 <a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
20             </li>
21             <li>
22                 <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>
23             </li>
24             <li>
25                 <a href="#" aria-current="page">
26                     Print barcode range
27                 </a>
28             </li>
29         </ol>
30     </nav>
31     [% END %]
32
33     <div class="main container-fluid">
34         <div class="row">
35             <div class="col-sm-10 col-sm-push-2">
36                 <main>
37                     [% INCLUDE 'labels-toolbar.inc' %]
38                     <h1>Print barcode range</h1>
39                     <form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post">
40                         <input type="hidden" name="op" value="add" />
41                         <fieldset class="rows">
42                             <ol>
43                                 <li>
44                                     <label for="from-input">From:</label>
45                                     <input type="text" inputmode="numeric" pattern="[0-9]*" name="from" id="from-input" value="0" style="text-align: right;"/>
46                                 </li>
47                                 <li>
48                                     <label for="to-input">To:</label>
49                                     <input type="text" inputmode="numeric" pattern="[0-9]*" name="to" id="to-input" value="0" style="text-align: right;"/>
50                                 </li>
51                             </ol>
52                         </fieldset>
53                         <fieldset class="action">
54                             <button type="button" class="btn btn-default" id="print">Print range</button>
55                         </fieldset>
56                     </form>
57                 </main>
58             </div> <!-- /.col-sm-10.col-sm-push-2 -->
59
60             <div class="col-sm-2 col-sm-pull-10">
61                 <aside>
62                     [% INCLUDE 'cat-menu.inc' %]
63                 </aside>
64             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
65         </div> <!-- /.row -->
66     </div> <!-- /.main.container-fluid -->
67
68 [% MACRO jsinclude BLOCK %]
69     <script>
70         function Xport() {
71             var str = "";
72             str += "from=" + document.getElementById("from-input").value + "&";
73             str += "to=" + document.getElementById("to-input").value;
74             return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?" + str, 400, 800);
75         }
76
77         function checkTwoValue(_from, _to, _id){
78             var result = _from.length == _to.length;
79             if (_from[0] == "0" || _to[0] == "0") {
80                 switch (_id){
81                     case 'from-input':
82                         var to_inp = $("#to-input")
83                         if (to_inp.hasClass('error')){
84                             to_inp.removeClass('error').addClass('valid');
85                             $("to-input-error").remove();
86                         }
87                         if ($('#to-input-error').length){
88                             $("#to-input-error").remove();
89                         }
90                         return result;
91                     case 'to-input':
92                         var from_inp = $("#from-input")
93                         if (from_inp.hasClass('error')){
94                             from_inp.removeClass('error').addClass('valid');
95                         }
96                         if ($('#from-input-error').length){
97                             $("#from-input-error").remove();
98                         }
99                         return result;
100                     }
101                 }
102                 return true;
103             }
104
105         $(document).ready(function () {
106             $('#navmenulist a[href$="/cgi-bin/koha/labels/label-home.pl"]').addClass("current");
107             $.validator.addMethod("gt", function(value, element, params) {
108                 return parseInt(value) >= parseInt($(params).val());
109             }, _("Must be greater or equal to the from value."));
110
111             $.validator.addMethod("eq", function(value, element, params) {
112                 return checkTwoValue($("#from-input").val(), $("#to-input").val(), $(element).attr('id'));
113             }, _("From and to values must have the same length."));
114
115             $("form[name=add_by_number]").validate({
116                 rules: {
117                     from: {
118                         required: true,
119                         eq: "#from-input",
120                         eq: "#to-input",
121                     },
122                     to: {
123                         required: true,
124                         gt: "#from-input",
125                         eq: "#from-input",
126                         eq: "#to-input",
127                     }
128                 }
129             });
130
131             $("#print").on("click", function () {
132                 if ( $("form[name=add_by_number]").valid() ) {
133                     return Xport();
134                 }
135             });
136         });
137
138
139
140
141
142
143
144     </script>
145 [% END %]
146
147 [% INCLUDE 'intranet-bottom.inc' %]