Bug 31220: (QA follow-up) Add missing filter
[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>Label printing/exporting &rsaquo; Label creator &rsaquo; Tools &rsaquo; Koha</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         <h1>Label printing/exporting</h1>
12         [% IF ( batches ) %]
13             <form>
14                 <h3>Click on the following links to download the exported batch(es).</h3>
15                 [% IF warn_empty_range %]
16                 <div class="dialog alert">
17                     <p>Some or all of the barcodes in the range you have selected have no corresponding items.</p>
18                     <p>If you are using a layout without barcodes, this may result in missing entries or a blank page</p>
19                 </div>
20                 [% END %]
21                         [% FOREACH batche IN batches %]
22                         <fieldset>
23                             [% IF ( batche.label_ids ) %]
24                                 <legend>[% IF ( batche.label_count == 1 ) %][% batche.label_count | html %] single label[% ELSE %][% batche.label_count | html %] single labels[% END %]</legend>
25                                 <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 %][% batche.label_ids | html %]">Download as PDF</a>
26
27                                     <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>
28
29                                     <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>
30                             [% ELSIF ( batche.item_numbers ) %]
31                             <legend>[% IF ( batche.label_count == 1 ) %][% batche.label_count | html %] single label[% ELSE %][% batche.label_count | html %] single labels[% END %]</legend>
32                                     <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>
33
34                                     <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>
35
36                                     <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>
37                             [% ELSIF ( batche.batch_id) %]
38                             <legend>Label batch number [% batche.batch_id | html %]</legend>
39                                     <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>
40                                 </p>
41                                 <p>
42                                     <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>
43                                 </p>
44                                 <p>
45                                     <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>
46                             [% ELSIF (batche.from && batche.to) %]
47                             <legend>Barcodes from [% batche.from | html %] to [% batche.to | html %]</legend>
48                             <p>
49                                 <a class="document pdf" href="/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=0&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;start_label=[% batche.start_label | html %]&amp;from=[% batche.from | html %]&amp;to=[% batche.to | html %]&amp;barcode_length=[% batche.barcode_length | html %]">Download as PDF</a>
50                             </p>
51                             [% END %]
52                         </fieldset>
53                         [% END %]
54                 <fieldset class="action">
55                     <input type="button" class="gb-close" value="Done" />
56                 </fieldset>
57             </form>
58         [% ELSE %]
59             <h3>
60                 [% IF ( label_ids ) %]
61                     [% IF ( label_count == 1 ) %]<span>Exporting 1 label</span>[% ELSE %]<span>Exporting [% label_count | html %] labels</span>[% END %]
62                 [% ELSIF ( item_numbers ) %]
63                     [% IF ( item_count == 1 ) %]<span>Exporting 1 label</span>[% ELSE %]<span>Exporting [% item_count | html %] labels</span>[% END %]
64                 [% ELSE %]
65                     [% IF ( multi_batch_count == 1 ) %]<span>1 batch to export</span>[% ELSE %]<span>[% multi_batch_count | html %] batches to export</span>[% END %]
66                 [% END %]
67             </h3>
68             <form name="exporting" method="post" action="/cgi-bin/koha/labels/label-print.pl">
69                 <input type="hidden" name="op" value="export" />
70                 <input type="hidden" name="referer" value="[% referer | html %]" />
71                 [% FOREACH batch_id IN batch_ids %]
72                     <input type="hidden" name="batch_id" value="[% batch_id.batch_id | html %]" />
73                 [% END %]
74                 [% FOREACH label_id IN label_ids %]
75                     <input type="hidden" name="label_id" value="[% label_id.label_id | html %]" />
76                 [% END %]
77                 [% FOREACH item_number IN item_numbers %]
78                     <input type="hidden" name="item_number" value="[% item_number.item_number | html %]" />
79                 [% END %]
80                 <input type="hidden" name="from" value="[% txt_from | html %]" />
81                 <input type="hidden" name="to" value="[% txt_to | html %]" />
82                 <input type="hidden" name="barcode_length" value="[% barcode_length | html %]" />
83                 <fieldset class="rows">
84                     <ol>
85                         <li>
86                             <label for="template_id" style="width:20em">Select a template to be applied: </label>
87                             <select name="template_id" id="template_id">
88                                     [% FOREACH template IN templates %]
89                                     <option value="[% template.template_id | html %]">[% template.template_code | html %]</option>
90                                     [% END %]
91                                 </select>
92                         </li>
93                         <li>
94                             <label for="layout_id" style="width:20em">Select a layout to be applied: </label>
95                             <select name="layout_id" id="layout_id">
96                                     [% FOREACH layout IN layouts %]
97                                     <option value="[% layout.layout_id | html %]">[% layout.layout_name | html %]</option>
98                                     [% END %]
99                                 </select>
100                         </li>
101                         <li>
102                             <label for="start_label" style="width:20em">Enter starting label position (for PDF): </label>
103                             <input type="text" size="5" id="start_label" name="start_label" class="focus" title="Starting label number" value="1"/>
104                         </li>
105                     </ol>
106                 </fieldset>
107                 <fieldset class="action">
108                     <input type="submit" value="Export" />
109                     <a href="#" class="cancel gb-close">Cancel</a>
110                 </fieldset>
111             </form>
112         [% END %]
113     </div>
114
115 [% MACRO jsinclude BLOCK %]
116     [% Asset.js("js/tools-menu.js") | $raw %]
117     [% INCLUDE 'greybox.inc' %]
118     <script>
119         function Done() {
120             window.location = "[% referer | html %]";
121         };
122         $(document).ready(function(){
123             $(".gb-close").on("click",function(){
124                 parent.parent.GB_hide();
125             });
126         });
127     </script>
128 [% END %]
129
130 [% INCLUDE 'popup-bottom.inc' %]