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