Moving </head><body> into body of templates so that js and css can be embedded per...
[koha_ffzg] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / serials-edit.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Serials</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 </head>
5 <body>
6 <!-- TMPL_INCLUDE NAME="header.inc" -->
7 <!--TMPL_INCLUDE NAME="menu-serials.inc" -->
8
9 <div id="doc3" class="yui-t2">
10    
11    <div id="bd">
12         <div id="yui-main">
13         <div class="yui-b"><div class="yui-g">
14
15 <h1>Serial Edition <!-- TMPL_VAR name="bibliotitle" --></h1>
16 <form method="post" name="f" action="serials-edit.pl">
17 <!--onsubmit="return barcode_check()">-->
18 <div id="action">
19     <a href="serials-collection.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->" title="serial Collection for <!--TMPL_VAR Name="bibliotitle"-->">Serial collection</a>
20     <!--TMPL_LOOP Name="subscriptions"-->
21     <a href="subscription-detail.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" title="detail of the subscription">Subscription #<!-- TMPL_VAR name="subscriptionid" --></a>
22         <!--TMPL_IF name="abouttoexpire"--><a href="#" onclick="popup('subscription-renew.pl?subscriptionid=<!--TMPL_VAR Name="subscriptionid"-->&amp;mode=popup')">Renew <!--TMPL_VAR Name="subscriptionid"--></a>
23         <!--/TMPL_IF-->
24         <!--TMPL_IF name="subscriptionexpired"--><a href="#" onclick="popup('subscription-renew.pl?subscriptionid=<!--TMPL_VAR Name="subscriptionid"-->&amp;mode=popup')">Renew <!--TMPL_VAR Name="subscriptionid"--></a>
25         <!--/TMPL_IF-->
26       <!--/TMPL_LOOP-->
27     <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->" title="go to <!-- TMPL_VAR name="bibliotitle" -->">Show Biblio</a>
28 </div>
29 <!--TMPL_IF Name="barcode_not_unique" -->
30 Error : Barcode Not Unique For serialseq <!--TMPL_VAR Name="errserialseq"-->
31 <!--/TMPL_IF -->
32
33  <input type="hidden" name="op" value="serialchangestatus" />
34         <table cellspacing="0" cellpadding="0" border="0" class="collapse">
35         <tr>
36                 <th>
37                         Numbered
38                 </th>
39                 <th>
40                         Published on
41                 </th>
42                 <th>
43                         planned for
44                 </th>
45                 <th>
46                         Status
47                 </th>
48                 <th>
49                         Notes
50                 </th>
51         </tr>
52 <!-- TMPL_LOOP name="serialslist" -->
53     <tr>
54         <td>
55             <input type="hidden" name="serialid" value="<!-- TMPL_VAR name="serialid" -->" />
56             <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
57             <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
58             <input type="hidden" name="itemcount" value="<!-- TMPL_VAR name="issuesatonce" -->" />
59             <input type="hidden" name="user" value="<!-- TMPL_VAR name="librarian" -->" />
60             Issue <input type="text" name="serialseq" value="<!-- TMPL_VAR name="serialseq" -->" size="20" maxlength="100" />
61         </td>
62         <td>
63             <input type="text" name="publisheddate" value="<!-- TMPL_VAR name="publisheddate" -->" size="10" maxlength="15" />
64         </td>
65         <td>
66             <input type="text" name="planneddate" value="<!-- TMPL_VAR name="planneddate" -->" size="10" maxlength="15" />
67         </td>
68         <td>
69             <!--TMPL_IF name="editdisable"-->
70               <select name="status" size="1" id="status<!-- TMPL_VAR NAME="num" -->" disabled="disabled">
71             <!--TMPL_ELSE-->
72               <select name="status" size="1" id="status<!-- TMPL_VAR NAME="num" -->" onchange="if (this.value==2){unHideItems('items'+<!-- TMPL_VAR NAME="subscriptionid" -->+<!-- TMPL_VAR NAME="serialid" -->,'label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')}" >
73             <!--/TMPL_IF-->
74   <!--TMPL_IF name="status1" -->
75                     <option value="1" selected="selected">Waited</option>
76   <!-- /TMPL_IF -->
77   <!--TMPL_IF name="status2" -->
78                     <option value="2" selected="selected">Arrived</option>
79   <!--TMPL_ELSE -->
80                     <option value="2">Arrived</option>
81   <!-- /TMPL_IF -->
82   <!--TMPL_IF name="status3" -->
83                     <option value="3" selected="selected">Late</option>
84   <!-- TMPL_ELSE -->
85                     <option value="3">Late</option>
86   <!-- /TMPL_IF -->
87   <!--TMPL_IF name="status4" -->
88                     <option value="4" selected="selected">Missing</option>
89   <!-- TMPL_ELSE -->
90                     <option value="4">Missing</option>
91   <!-- /TMPL_IF -->
92   <!--TMPL_IF name="status7" -->
93                     <option value="7" selected="selected">Claimed</option>
94   <!-- TMPL_ELSE -->
95                     <option value="7">Claimed</option>
96   <!-- /TMPL_IF -->
97   <!--TMPL_IF name="status5" -->
98                     <option value="5" selected="selected">Not Available</option>
99   <!-- TMPL_ELSE -->
100                     <option value="5">Not Available</option>
101   <!-- /TMPL_IF -->
102   <!--TMPL_IF name="status6" -->
103                     <option value="6" selected="selected">Delete</option>
104   <!-- TMPL_ELSE -->
105                     <option value="6">Delete</option>
106   <!-- /TMPL_IF -->
107             </select>
108
109         </td>
110         <td>
111             <input type="text" name="notes" value="<!-- TMPL_VAR name="sernotes" -->" size="20" maxlength="255" />
112         </td>
113     </tr>
114   <!--TMPL_UNLESS Name="subscriptionexpired"-->
115   <!--TMPL_IF Name="serialsadditems"-->
116           <tr>
117           <td colspan="5">
118       <a id="label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->" style="color: grey; font-size: 80%; cursor: se-resize;"  onclick="unHideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
119              Items   </a>
120         <fieldset style="display:none;" id="items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->">
121         <legend><a style="cursor: se-resize;"  onclick="HideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
122                 Items</a>
123         </legend>
124           <div id="cataloguing_additem_itemlist">
125         <!-- TMPL_LOOP NAME="items" -->
126         <div id="item<!-- TMPL_VAR NAME="serialid" --><!-- TMPL_VAR NAME="countitems" -->" class="items">
127         <!-- TMPL_LOOP NAME="iteminformation" -->
128         <p>
129         <div id="subfield<!-- TMPL_VAR NAME="serialid" --><!-- TMPL_VAR NAME="countitems" --><!-- TMPL_VAR NAME="countsubfield" -->" class="subfield">                <label><!-- TMPL_VAR NAME="subfield" --> - <!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF --></label>
130                 <!-- TMPL_VAR NAME="marc_value" -->
131                 <input type="hidden" name="itemid" value="<!-- TMPL_VAR NAME="itemid" -->" />
132                 <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
133                 <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
134                 <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
135                 <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
136             </div>
137          </p>
138         <!-- /tmpl_loop -->
139         
140         <input type="hidden" name="moditem" value="" /> 
141         <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->" />
142         <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->" />
143         <input type="hidden" name="serial" value="<!-- TMPL_VAR NAME="serialid" -->" />
144         <input type="hidden" name="bibnum" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
145         <input type="hidden" name="itemid" value="<!-- TMPL_VAR NAME="itemid" -->" />
146         <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
147         </div>
148         <!--/TMPL_LOOP-->
149         </div>
150         </fieldset>
151     </td>
152     </tr>
153   <!-- /TMPL_IF -->
154   <!--/TMPL_UNLESS -->
155 <!-- /TMPL_LOOP -->
156 <!-- TMPL_LOOP name="newserialloop" -->
157     <!--TMPL_UNLESS Name="subscriptionexpired"-->
158     <tr>
159         <td>
160             <input type="hidden" name="serialid" value="NEW" />
161             <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
162             <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
163             <input type="hidden" name="itemcount" value="<!-- TMPL_VAR name="issuesatonce" -->" />
164             <input type="hidden" name="user" value="<!-- TMPL_VAR name="librarian" -->" />
165             <b>Subs. <!-- TMPL_VAR name="subscriptionid" --></b> New Issue <input type="text" name="serialseq" value="" size="20" maxlength="100" onchange="if (this.value!=''){unHideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!-- TMPL_VAR NAME="serialid" -->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')} else {HideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!-- TMPL_VAR NAME="serialid" -->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')}" />
166         </td>
167         <td>
168             <input type="text" name="publisheddate" value="<!-- TMPL_VAR name="publisheddate" -->" size="10" maxlength="15" />
169         </td>
170         <td>
171             <input type="text" name="planneddate" value="<!-- TMPL_VAR name="planneddate" -->" size="10" maxlength="15" />
172         </td>
173         <td>
174             <select name="status" size="1" id="status<!-- TMPL_VAR NAME="num" -->">
175   <!--TMPL_IF name="status1" -->
176                     <option value="1" selected="selected">Waited</option>
177   <!-- /TMPL_IF -->
178   <!--TMPL_IF name="status2" -->
179                     <option value="2" selected="selected">Arrived</option>
180   <!--TMPL_ELSE -->
181                     <option value="2">Arrived</option>
182   <!-- /TMPL_IF -->
183   <!--TMPL_IF name="status3" -->
184                     <option value="3" selected="selected">Late</option>
185   <!-- TMPL_ELSE -->
186                     <option value="3">Late</option>
187   <!-- /TMPL_IF -->
188   <!--TMPL_IF name="status4" -->
189                     <option value="4" selected="selected">Missing</option>
190   <!-- TMPL_ELSE -->
191                     <option value="4">Missing</option>
192   <!-- /TMPL_IF -->
193   <!--TMPL_IF name="status7" -->
194                     <option value="7" selected="selected">Claimed</option>
195   <!-- TMPL_ELSE -->
196                     <option value="7">Claimed</option>
197   <!-- /TMPL_IF -->
198   <!--TMPL_IF name="status5" -->
199                     <option value="5" selected="selected">Not Available</option>
200   <!-- TMPL_ELSE -->
201                     <option value="5">Not Available</option>
202   <!-- /TMPL_IF -->
203   <!--TMPL_IF name="status6" -->
204                     <option value="6" selected="selected">Delete</option>
205   <!-- TMPL_ELSE -->
206                     <option value="6">Delete</option>
207   <!-- /TMPL_IF -->
208             </select>
209
210         </td>
211         <td>
212             <input type="text" name="notes" value="" size="20" maxlength="255" />
213         </td>
214     </tr>
215   <!--TMPL_IF Name="serialsadditems"-->
216           <tr>
217           <td colspan="5">
218       <a id="label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->" style="color: grey; font-size: 80%; cursor: se-resize;"  onclick="unHideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
219              Item</a>
220         <fieldset style="display:none;" id="items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->">
221         <legend><a style="cursor: se-resize;"  onclick="HideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
222                 Item</a>
223         </legend>
224           <div id="cataloguing_additem_itemlist">
225         <div id="item<!-- TMPL_VAR NAME="serialid" --><!-- TMPL_VAR NAME="countitems" -->" class="items">
226         <!-- TMPL_LOOP NAME="iteminformation" -->
227         <p>
228         <div id="subfield<!-- TMPL_VAR NAME="serialid" --><!-- TMPL_VAR NAME="countitems" --><!-- TMPL_VAR NAME="countsubfield" -->" class="subfield">                <label><!-- TMPL_VAR NAME="subfield" --> - <!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF --></label>
229                 <!-- TMPL_VAR NAME="marc_value" -->
230                 <input type="hidden" name="itemid" value="<!-- TMPL_VAR NAME="itemid" -->" />
231                 <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
232                 <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
233                 <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
234                 <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
235         </div>
236         </p>
237         <!-- /tmpl_loop -->
238         
239         <input type="hidden" name="moditem" value="" /> 
240         <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->" />
241         <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->" />
242         <input type="hidden" name="serial" value="<!-- TMPL_VAR NAME="serialid" -->" />
243         <input type="hidden" name="bibnum" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
244         <input type="hidden" name="itemid" value="<!-- TMPL_VAR NAME="itemid" -->" />
245         <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
246         </div>
247         </div>
248         </fieldset>
249     </td>
250     </tr>
251   <!-- /TMPL_IF -->
252   <!--/TMPL_UNLESS -->
253 <!-- /TMPL_LOOP -->
254
255 </table>
256     <input type="submit" value="Save"  class="button" accesskey="w" /> <!--onclick="Check(this.form)" -->
257 </div>
258 </form>
259
260 <script language="JavaScript" type="text/javascript">
261
262 function popup(subscriptionid) {
263         window.open("subscription-renew.pl?subscriptionid="+subscriptionid,"subscription_renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
264 }
265
266 function barcode_check(){
267     <!-- TMPL_IF NAME="count" -->
268     var count = <!-- TMPL_VAR NAME="count" -->;
269     for(var i=1;i<=count;i++){
270
271         var barcodenum = "barcode"+i;
272         var statusnum = "status"+i;
273         var elembarcode = "document.getElementById('"+barcodenum+"')";
274         var elemstatus = "document.getElementById('"+statusnum+"')";
275 // alert(elembarcode+"\n"+eval(elembarcode+".value));
276 // alert(elemstatus+"\n"+eval(elemstatus+".value"));
277         if(eval(elembarcode+".value") =='' && eval(elemstatus+".value") == 2){
278             var answer = confirm("Leave barcode blank?\n - Note: unable to change this later");
279             if (answer){
280                 document.f.submit();
281             } else {
282                 return false;
283             }
284         }
285         if(eval(elembarcode+".value".indexOf('TEMP')) > 0 && eval(elemstatus+".value") == 2){
286             var answer = confirm("A barcode was not entered.\nDo you want to put in a barcode\nor do you want to use a system generated barcode?");
287             if (answer){
288                 document.f.submit();
289             } else {
290                 return false;
291             }
292         }
293     }
294     <!--/TMPL_IF-->
295 }
296
297 function Check(f) {
298     var total_errors=0;
299 //      alert(f.field_value.length);
300     for (i=0 ; i<f.field_value.length ; i++) {
301 //      alert (f.field_value[i].value);
302         if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
303             document.getElementById("error"+i).style.backgroundColor="#FF0000";
304             total_errors++;
305         } else {
306 //                      document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
307         }
308     }
309     var alertString2;
310     if (total_errors==0) {
311         document.f.submit();
312     } else {
313         alertString2  = _("Form not submitted because of the following problem(s)");
314         alertString2 += "\n------------------------------------------------------------------------------------\n";
315         alertString2 += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)");
316         alert(alertString2);
317     }
318 }
319 <!--TMPL_IF Name="serialsadditems"-->
320 function unHideItems(index,labelindex) {
321         subfield = document.getElementById(index);
322         subfield.style.display = 'block';
323         label = document.getElementById(labelindex);
324         label.style.display='none';     
325 }
326 function HideItems(index,labelindex) {
327         subfield = document.getElementById(index);
328         subfield.style.display = 'none';
329         label = document.getElementById(labelindex);
330         label.style.display='block';    
331 }
332 <!--/TMPL_IF>
333 </script>
334
335 </div>
336 </div>
337 </div>
338
339 <!-- TMPL_INCLUDE NAME="mainmenu.inc" -->
340 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->