Bug 7468: Add warning when range has non-existent barcodes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-print.tt
1 [% USE raw %]
2 [% SET footerjs = 1 %]
3     [% INCLUDE 'doc-head-open.inc' %]
4     <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Label printing/exporting</title>
5     [% INCLUDE 'doc-head-close.inc' popup => 1 %]
6     <style>table {border-collapse: separate; border-spacing: 0; border: hidden none;} .header {cursor: auto; background-position: center center; background-repeat: repeat;}</style>
7 </head>
8
9 <body id="labels_label-print" class="tools labels">
10     <div class="main container-fluid">
11         [% IF ( batches ) %]
12             <form>
13                 <h3>Click on the following links to download the exported batch(es).</h3>
14                 [% IF warn_empty_range %]
15                 <div style="color: red; font-weight: bold;">Some or all of the barcodes in the range you have selected have no corresponding items. Because you are using a layout without barcodes, this may result in missing entries or a blank page.</div>
16                 [% END %]
17                         [% FOREACH batche IN batches %]
18                         <fieldset>
19                             [% IF ( batche.label_ids ) %]
20                                 <legend>[% IF ( batche.label_count == 1 ) %][% batche.label_count | html %] single label[% ELSE %][% batche.label_count | html %] single labels[% END %]</legend>
21                                     <p><a class="document pdf" href="/cgi-bin/koha/labels/[% batche.create_script | html %]?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;start_label=[% batche.start_label | html %][% batche.label_ids | html %]">Download as PDF</a></p>
22
23                                     <p><a class="document csv" href="/cgi-bin/koha/labels/label-create-csv.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %][% batche.label_ids | html %]">Download as CSV</a></p>
24
25                                     <p><a class="document xml" href="/cgi-bin/koha/labels/label-create-xml.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %][% batche.label_ids | html %]">Download as XML</a></p>
26                             [% ELSIF ( batche.item_numbers ) %]
27                             <legend>[% IF ( batche.label_count == 1 ) %][% batche.label_count | html %] single label[% ELSE %][% batche.label_count | html %] single labels[% END %]</legend>
28                                     <p><a class="document pdf" href="/cgi-bin/koha/labels/[% batche.create_script | html %]?template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;start_label=[% batche.start_label | html %][% batche.item_numbers | html %]">Download as PDF</a></p>
29
30                                     <p><a class="document csv" href="/cgi-bin/koha/labels/label-create-csv.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %][% batche.item_numbers | html %]">Download as CSV</a></p>
31
32                                     <p><a class="document xml" href="/cgi-bin/koha/labels/label-create-xml.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %][% batche.item_numbers | html %]">Download as XML</a></p>
33                             [% ELSIF ( batche.batch_id) %]
34                             <legend>Label Batch Number [% batche.batch_id | html %]</legend>
35                                     <p><a class="document pdf" href="/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;start_label=[% batche.start_label | html %]">Download as PDF</a>
36                                 </p>
37                                 <p>
38                                     <a class="document csv" href="/cgi-bin/koha/labels/label-create-csv.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]">Download as CSV</a>
39                                 </p>
40                                 <p>
41                                     <a class="document xml" href="/cgi-bin/koha/labels/label-create-xml.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]">Download as XML</a></p>
42                             [% ELSIF (batche.from && batche.to) %]
43                             <legend>Barcodes from [% batche.from %] to [% batche.to %]</legend>
44                             <p>
45                                 <a class="document pdf" href="/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=0&amp;template_id=[% batche.template_id %]&amp;layout_id=[% batche.layout_id %]&amp;start_label=[% batche.start_label %]&amp;from=[% batche.from %]&amp;to=[% batche.to %]">Download as PDF</a>
46                             </p>
47                             [% END %]
48                         </fieldset>
49                         [% END %]
50                 <fieldset class="action">
51                     <input type="button" class="gb-close" value="Done" />
52                 </fieldset>
53             </form>
54         [% ELSE %]
55             <h3>
56                 [% IF ( label_ids ) %]
57                     [% IF ( label_count == 1 ) %]Exporting [% label_count | html %] label[% ELSE %]Exporting [% label_count | html %] labels[% END %]
58                 [% ELSIF ( item_numbers ) %]
59                     [% IF ( item_count == 1 ) %]Exporting [% item_count | html %] label[% ELSE %]Exporting [% item_count | html %] labels[% END %]
60                 [% ELSE %]
61                     [% IF ( multi_batch_count == 1 ) %][% multi_batch_count | html %] batch to export[% ELSE %][% multi_batch_count | html %] batches to export[% END %]
62                 [% END %]
63             </h3>
64             <form name="exporting" method="post" action="/cgi-bin/koha/labels/label-print.pl">
65                 <input type="hidden" name="op" value="export" />
66                 <input type="hidden" name="referer" value="[% referer | html %]" />
67                 [% FOREACH batch_id IN batch_ids %]
68                     <input type="hidden" name="batch_id" value="[% batch_id.batch_id | html %]" />
69                 [% END %]
70                 [% FOREACH label_id IN label_ids %]
71                     <input type="hidden" name="label_id" value="[% label_id.label_id | html %]" />
72                 [% END %]
73                 [% FOREACH item_number IN item_numbers %]
74                     <input type="hidden" name="item_number" value="[% item_number.item_number | html %]" />
75                 [% END %]
76                     <input type="hidden" name="from" value="[% from %]" />
77                     <input type="hidden" name="to" value="[% to %]" />
78                 <fieldset class="rows">
79                     <ol>
80                         <li>
81                             <label for="template_id" style="width:20em">Select a template to be applied: </label>
82                             <select name="template_id" id="template_id">
83                                     [% FOREACH template IN templates %]
84                                     <option value="[% template.template_id | html %]">[% template.template_code | html %]</option>
85                                     [% END %]
86                                 </select>
87                         </li>
88                         <li>
89                             <label for="layout_id" style="width:20em">Select a layout to be applied: </label>
90                             <select name="layout_id" id="layout_id">
91                                     [% FOREACH layout IN layouts %]
92                                     <option value="[% layout.layout_id | html %]">[% layout.layout_name | html %]</option>
93                                     [% END %]
94                                 </select>
95                         </li>
96                         <li>
97                             <label for="start_label" style="width:20em">Enter starting label position (for PDF): </label>
98                             <input type="text" size="5" id="start_label" name="start_label" class="focus" title="Starting label number" value="1"/>
99                         </li>
100                     </ol>
101                 </fieldset>
102                 <fieldset class="action">
103                     <input type="submit" value="Export" />
104                     <a href="#" class="cancel gb-close">Cancel</a>
105                 </fieldset>
106             </form>
107         [% END %]
108     </div>
109
110 [% MACRO jsinclude BLOCK %]
111     [% Asset.js("js/tools-menu.js") | $raw %]
112     [% INCLUDE 'greybox.inc' %]
113     <script>
114         function Done() {
115             window.location = "[% referer | html %]";
116         };
117         $(document).ready(function(){
118             $(".gb-close").on("click",function(){
119                 parent.parent.GB_hide();
120             });
121         });
122     </script>
123 [% END %]
124
125 [% INCLUDE 'popup-bottom.inc' %]