kohabug 2463 & 2464 Removing unlinked fields from label-edit-layout.pl
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-edit-layout.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha &rsaquo; Tools &rsaquo; Labels</title>
2 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
3 <script>
4 function jscss(action,o,c1,c2)
5 {
6  // from:  http://onlinetools.org/articles/unobtrusivejavascript/cssjsseparation.html
7   switch (action){
8     case 'swap':
9       o.className=!jscss('check',o,c1)?o.className.replace(c2,c1): o.className.replace(c1,c2);
10     break;
11     case 'add':
12       if(!jscss('check',o,c1)){o.className+=o.className?' '+c1:c1;}
13     break;
14     case 'remove':
15       var rep=o.className.match(' '+c1)?' '+c1:c1;
16       o.className=o.className.replace(rep,'');
17     break;
18     case 'check':
19       return new RegExp('\\b'+c1+'\\b').test(o.className)
20     break;
21   }
22 }
23 function chooselayoutspec(rb) {
24         stringspec=document.getElementById("formatstring");
25         if(rb.value == 'layout_string') {
26                 stringspec.disabled=0;
27                 jscss('remove',document.getElementById('layout_string'),'disabled','');
28                 jscss('add',document.getElementById('layout_tx'),'disabled','');
29         } else {
30                 stringspec.disabled=1;
31                 jscss('remove',document.getElementById('layout_tx'),'disabled','');
32                 jscss('add',document.getElementById('layout_string'),'disabled','');
33         }
34 }
35 </script>
36 </head>
37 <body>
38 <!-- TMPL_INCLUDE NAME="header.inc" -->
39 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
40
41 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/labels/label-home.pl">Labels</a> &rsaquo; <!-- TMPL_IF NAME="layout_id" -->Edit<!-- TMPL_ELSE -->Create<!-- /TMPL_IF --> Label Layout</div>
42
43 <div id="doc3" class="yui-t2">
44    
45    <div id="bd">
46         <div id="yui-main">
47         <div class="yui-b">
48         <!-- TMPL_INCLUDE NAME="tools-labels-toolbar.inc" -->
49 <form name="input" action="/cgi-bin/koha/labels/label-manager.pl" method="get">
50 <fieldset class="rows">
51 <legend><!-- TMPL_IF NAME="layout_id" -->Edit<!-- TMPL_ELSE -->Create<!-- /TMPL_IF --> Label Layout</legend>
52 <ol>
53 <li><label for="layoutname">Layout Name</label>
54 <input type="text" name="layoutname" id="layoutname" size="20" value="<!-- TMPL_VAR NAME="layoutname" -->" /></li>
55
56 <li><label for="barcodetype">Choose Barcode Type (encoding)</label>
57 <select name="barcodetype" id="barcodetype">
58     <!-- TMPL_LOOP NAME="barcode_types" -->
59         <!-- TMPL_IF NAME="active" -->
60         <option value="<!-- TMPL_VAR NAME="code" -->" selected="selected"><!-- TMPL_VAR NAME="desc" --></option>
61         <!-- TMPL_ELSE -->
62         <option value="<!-- TMPL_VAR NAME="code" -->"><!-- TMPL_VAR NAME="desc" --></option>
63         <!-- /TMPL_IF -->
64     <!-- /TMPL_LOOP -->
65 </select></li>
66
67
68 <li><label for="printingtype">Choose Layout Type</label>
69 <select name="printingtype" id="printingtype">
70     <!-- TMPL_LOOP NAME="printingtypes" -->
71 <!-- TMPL_IF NAME="active" -->
72         <option value="<!-- TMPL_VAR NAME="code" -->" selected="selected"><!-- TMPL_VAR NAME="desc" --></option>
73         <!-- TMPL_ELSE -->
74         <option value="<!-- TMPL_VAR NAME="code" -->"><!-- TMPL_VAR NAME="desc" --></option>
75 <!-- /TMPL_IF -->
76     <!-- /TMPL_LOOP -->
77 </select></li>
78
79
80 <li> 
81 <fieldset class="rows">
82 <legend>
83 Bibliographic Data to Print
84 </legend>
85 <input type="radio" name="layoutchoice" value="layout_tx" <!-- TMPL_UNLESS NAME="layout_string" -->checked="checked"<!-- /TMPL_UNLESS --> onclick="chooselayoutspec(this);" >Choose Order Of Text Fields to Print</input>
86 <fieldset id="layout_tx"  <!-- TMPL_IF NAME="layout_string" -->class="disabled"<!-- /TMPL_IF -->>
87 <table summary="fields to print">
88 <tr>
89         <td>
90  <select name="tx_title" id="tx_title">
91             <!-- TMPL_LOOP Name="tx_title" -->
92                         <!-- TMPL_IF Name="selected" -->
93                 <option value="<!-- TMPL_VAR Name="num" -->" selected="selected">
94                     <!-- TMPL_VAR Name="num" -->
95                 </option>
96                         <!-- TMPL_ELSE -->
97                 <option value="<!-- TMPL_VAR Name="num" -->">
98                     <!-- TMPL_VAR Name="num" -->
99                 </option>
100                 <!-- /TMPL_IF -->
101             <!-- /TMPL_LOOP -->
102             </select>
103         <label for="tx_title">Title</label>
104         </td>
105         <td>
106         <select name="tx_author" id="tx_author">
107              <!-- TMPL_LOOP Name="tx_author" -->
108                 <!-- TMPL_IF Name="selected" -->         
109                 <option value="<!-- TMPL_VAR Name="num" -->" selected="selected">
110                     <!-- TMPL_VAR Name="num" -->
111                 </option>
112                 <!-- TMPL_ELSE -->              
113                 <option value="<!-- TMPL_VAR Name="num" -->">
114                     <!-- TMPL_VAR Name="num" -->
115                 </option>
116                 <!-- /TMPL_IF -->               
117             <!-- /TMPL_LOOP -->
118             </select>
119        <label for="tx_author">Author</label>
120         </td>
121         <td>
122         <select name="tx_isbn" id="tx_isbn">
123               <!-- TMPL_LOOP Name="tx_isbn" -->
124                 <!-- TMPL_IF Name="selected" -->          
125                 <option value="<!-- TMPL_VAR Name="num" -->" selected="selected">
126                     <!-- TMPL_VAR Name="num" -->
127                 </option>
128                 <!-- TMPL_ELSE -->              
129                 <option value="<!-- TMPL_VAR Name="num" -->">
130                     <!-- TMPL_VAR Name="num" -->
131                 </option>
132                 <!-- /TMPL_IF -->               
133             <!-- /TMPL_LOOP -->
134             </select>
135       <label for="tx_isbn">ISBN</label>
136         </td>
137 </tr>
138 <tr>
139         <td>
140         <select name="tx_issn" id="tx_issn">
141                <!-- TMPL_LOOP Name="tx_issn" -->
142                 <!-- TMPL_IF Name="selected" -->           
143                 <option value="<!-- TMPL_VAR Name="num" -->" selected="selected">
144                     <!-- TMPL_VAR Name="num" -->
145                 </option>
146                 <!-- TMPL_ELSE -->              
147                 <option value="<!-- TMPL_VAR Name="num" -->">
148                     <!-- TMPL_VAR Name="num" -->
149                 </option>
150                 <!-- /TMPL_IF -->               
151             <!-- /TMPL_LOOP -->
152             </select>
153      <label for="tx_issn">ISSN</label>
154          </td>
155         <td>
156         <select name="tx_itemtype" id="tx_itemtype">
157                  <!-- TMPL_LOOP Name="tx_itemtype" -->
158                 <!-- TMPL_IF Name="selected" -->                 
159                 <option value="<!-- TMPL_VAR Name="num" -->" selected="selected">
160                     <!-- TMPL_VAR Name="num" -->
161                 </option>
162                         <!-- TMPL_ELSE -->      
163                 <option value="<!-- TMPL_VAR Name="num" -->">
164                     <!-- TMPL_VAR Name="num" -->
165                 </option>
166                 <!-- /TMPL_IF -->               
167             <!-- /TMPL_LOOP -->
168             </select>
169    <label for="tx_itemtype">Itemtype</label>
170         </td>
171         <td>
172         <select name="tx_barcode">
173                  <!-- TMPL_LOOP Name="tx_barcode" -->
174                 <!-- TMPL_IF Name="selected" -->                 
175                 <option value="<!-- TMPL_VAR Name="num" -->" selected="selected">
176                     <!-- TMPL_VAR Name="num" -->
177                 </option>
178                         <!-- TMPL_ELSE -->       
179                 <option value="<!-- TMPL_VAR Name="num" -->">
180                     <!-- TMPL_VAR Name="num" -->
181                 </option>
182                         <!-- /TMPL_IF -->       
183             <!-- /TMPL_LOOP -->
184       </select>
185         <label for="tx_barcode">Barcode (as text)</label>
186         </td>
187 </tr> 
188  <tr>
189             <td>
190         <select name="tx_itemcallnumber" id="tx_itemcallnumber">
191                  <!-- TMPL_LOOP Name="tx_itemcallnumber" -->
192                         <!-- TMPL_IF Name="selected" -->          
193                 <option value="<!-- TMPL_VAR Name="num" -->" selected="selected">
194                     <!-- TMPL_VAR Name="num" -->
195                 </option>
196                         <!-- TMPL_ELSE -->       
197                 <option value="<!-- TMPL_VAR Name="num" -->">
198                     <!-- TMPL_VAR Name="num" -->
199                 </option>
200                         <!-- /TMPL_IF -->       
201             <!-- /TMPL_LOOP -->
202       </select>
203         <label for="tx_itemcallnumber">Call Number</label>
204         </td>
205                 <td>&nbsp;</td>
206                 <td>&nbsp;</td>
207   </tr>
208 </table>
209 </fieldset>
210 <br />
211 <input type="radio" name="layoutchoice" value="layout_string" <!-- TMPL_IF NAME="layout_string" -->checked="checked"<!-- /TMPL_IF --> onclick="chooselayoutspec(this);"> List Fields </input>
212 <!-- TMPL_IF NAME="layout_string" --><fieldset id="layout_string"><!-- TMPL_ELSE --><fieldset id="layout_string" class="disabled"><!-- /TMPL_IF -->
213 <label for="layoutname">Data Fields</label>
214   
215 <!-- TMPL_IF NAME="layout_string" --><input type="text" name="formatstring" id="formatstring" size="60" value="<!-- TMPL_VAR NAME="formatstring" -->" /><!-- TMPL_ELSE --><input type="text" name="formatstring" id="formatstring" size="60" value="<!-- TMPL_VAR NAME="formatstring" -->" disabled="disabled" /><!-- /TMPL_IF -->
216
217    <div class="help">
218    <p>Enter a comma separated list of fields to print.  You may include any <em>Koha field</em> or MARC subfield.</p>
219    <p>See online help for advanced options</p>
220    <p>ex: barcode, itemcallnumber, title, "050a 050b", 300a </p>
221         </div>
222 </fieldset>
223 </fieldset>   
224 </li>
225 <li><label for="startlabel">Start printing from Label number: </label><input type="text" name="startlabel"  id="startlabel" size="1"  value="<!-- TMPL_IF NAME="startlabel" --><!-- TMPL_VAR NAME="startlabel" --><!-- TMPL_ELSE -->1<!-- /TMPL_IF -->" /></li>
226
227
228 <li><label for="guidebox">Draw Guide Boxes</label>
229 <!-- TMPL_IF NAME="guidebox"-->
230 <input type="checkbox" name="guidebox" id="guidebox" value="1"  checked="checked" />
231 <!-- TMPL_ELSE -->
232 <input type="checkbox" name="guidebox" id="guidebox" value="1" />
233 <!-- /TMPL_IF --></li>
234
235 </ol>
236 </fieldset>
237 <fieldset class="action">
238         <input type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/labels/label-home.pl">Cancel</a>
239         <input type="hidden" name="op" value="<!-- TMPL_IF NAME="layout_id" -->save<!-- TMPL_ELSE -->add<!-- /TMPL_IF -->_layout" />
240         <input type="hidden" name="layout_id" value="<!-- TMPL_VAR NAME="layout_id" -->" />
241 </fieldset>
242 </form>
243
244 </div>
245 </div>
246 <div class="yui-b">
247 <!-- TMPL_INCLUDE NAME="labels-menu.inc" -->
248 </div>
249 </div>
250 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->