#1491: Subscription add does not check for all required fields
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / subscription-add.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Serials &rsaquo; <!-- TMPL_IF name="mod" --> Modify subscription to <!-- TMPL_VAR name="bibliotitle" --><!-- TMPL_ELSE -->New subscription<!-- /TMPL_IF --></title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
5
6 <script type="text/javascript">
7 <!--
8
9 // the english words used in display purposes
10 var text = new Array(_('Number'),_('Volume'),_('Issue'),_('Month'),_('Week'),_('Starting with:'),_('Rollover at:'),_('Choose Hemisphere:'),_('Northern'),_('Southern'),
11 _('Autumn'),_('Winter'),_('Spring'),_('Summer'),_('Fall'),_('Season'),_('Year'));
12 var is_season = 0;
13 var is_hemisphere = 1;
14
15 function YMDaToYWDa(S) {
16     with (new Date(Date.UTC(S[0], S[1] - 1, S[2]))) {
17         var DoW = getUTCDay();
18         setUTCDate(getUTCDate() - (DoW + 6) % 7 + 3);
19         var ms = valueOf();
20         setUTCMonth(0, 4);
21         var WN = Math.round((ms - valueOf()) / 604800000) + 1;
22         return [getUTCFullYear(), WN, DoW == 0 ? 7 : DoW];
23     }
24 }
25 function dayofyear(d) { // d is a Date object
26 var yn = d.getFullYear();
27 var mn = d.getMonth();
28 var dn = d.getDate();
29 var d1 = new Date(yn,0,1,12,0,0); // noon on Jan. 1
30 var d2 = new Date(yn,mn,dn,12,0,0); // noon on input date
31 var ddiff = Math.round((d2-d1)/864e5);
32 return ddiff+1;
33 }
34
35
36 // common pre defined number patterns
37 function num_pattern() {
38 var patternchoice = document.getElementById("numberpattern").value;
39     switch(patternchoice){
40     case "2":
41         document.f.add1.value=1;
42         document.f.add2.value=1;
43         document.f.add3.value=1;
44         document.f.every1.value=12;
45         document.f.every2.value=1;
46         document.f.every3.value=1;
47         document.f.whenmorethan1.value=9999999;
48         document.f.whenmorethan2.value=12;
49         document.f.whenmorethan3.value=4;
50         document.f.setto1.value=0;
51         document.f.setto2.value=1;
52         document.f.setto3.value=1;
53 /*        document.f.lastvalue1.value=1;
54         document.f.lastvalue2.value=1;
55         document.f.lastvalue3.value=1;*/
56         document.f.numberingmethod.value=_('Vol {X}, No {Y}, Issue {Z}');
57         moreoptions(text[1],text[0],text[2]);
58         display_table(0); // toggle info box on (1) or off (0)
59         break;
60     case "3":
61         document.f.add1.value=1;
62         document.f.add2.value=1;
63         document.f.add3.value='';
64         document.f.every1.value=12;
65         document.f.every2.value=1;
66         document.f.every3.value='';
67         document.f.whenmorethan1.value=9999999;
68         document.f.whenmorethan2.value=12;
69         document.f.whenmorethan3.value='';
70         document.f.setto1.value=0;
71         document.f.setto2.value=1;
72         document.f.setto3.value='';
73 /*        document.f.lastvalue1.value=1;
74         document.f.lastvalue2.value=1;
75         document.f.lastvalue3.value='';*/
76         document.f.numberingmethod.value=_('Vol {X}, No {Y}');
77         moreoptions(text[1],text[0]);
78         display_table(0);
79         break;
80     case "4":
81         document.f.add1.value=1;
82         document.f.add2.value=1;
83         document.f.add3.value='';
84         document.f.every1.value=12;
85         document.f.every2.value=1;
86         document.f.every3.value='';
87         document.f.whenmorethan1.value=9999999;
88         document.f.whenmorethan2.value=12;
89         document.f.whenmorethan3.value='';
90         document.f.setto1.value=0;
91         document.f.setto2.value=1;
92         document.f.setto3.value='';
93         document.f.numberingmethod.value=_('Vol {X}, Issue {Y}');
94         moreoptions(text[1],text[2]);
95         display_table(0);
96         break;
97     case "5":
98         var d = new Date(document.f.firstacquidate.value);
99         var smonth = d.getMonth();
100         document.f.add1.value=1;
101         document.f.add2.value=1;
102         document.f.add3.value='';
103         document.f.every1.value=12;
104         document.f.every2.value=1;
105         document.f.every3.value='';
106         document.f.whenmorethan1.value=9999999;
107         document.f.whenmorethan2.value=12;
108         document.f.whenmorethan3.value='';
109         document.f.setto1.value=0;
110         document.f.setto2.value=1;
111         document.f.setto3.value='';
112         document.f.numberingmethod.value=_('No {X}, Issue {Y}');
113         moreoptions(text[0],text[2]);
114         display_table(0);
115         break;
116     case "6":
117         moreoptions_seasons(text[15],sYear);
118         var d = new Date(document.f.firstacquidate.value);
119         var sYear = d.getFullYear();
120         document.f.add1.value=1;
121         document.f.add2.value='1';
122         document.f.add3.value='';
123         document.f.every1.value=4;
124         document.f.every2.value='1';
125         document.f.every3.value='';
126         document.f.whenmorethan1.value=9999999;
127         document.f.whenmorethan2.value='4';
128         document.f.whenmorethan3.value='';
129         document.f.setto1.value=0;
130         document.f.setto2.value='1';
131         document.f.setto3.value='';
132         document.f.lastvaluetemp1.value=sYear;
133         document.f.periodicity.value='8';
134         document.f.numberingmethod.value=_('{Y} {X}');
135         display_table(0);
136         is_season = 1;
137         break;
138     case "7":
139         display_table(1);
140         document.getElementById("more_options").innerHTML = '';
141         document.f.irreg_check.value=1; 
142         break;
143     case "8":
144         var d = new Date(document.f.startdate.value);
145         var sYear = d.getFullYear();
146         document.f.add1.value=1;
147         document.f.add2.value=1;
148         document.f.add3.value='';
149         document.f.every1.value=12;
150         document.f.every2.value=1;
151         document.f.every3.value='';
152         document.f.whenmorethan1.value=9999999;
153         document.f.whenmorethan2.value=12;
154         document.f.whenmorethan3.value='';
155         document.f.setto1.value=0;
156         document.f.setto2.value=1;
157         document.f.setto3.value='';
158 //         document.f.setto3.value='';
159         if (document.f.lastvalue1.value==0){document.f.lastvalue1.value=sYear};
160         if (document.f.lastvalue2.value==0 ||document.f.lastvalue2.value=='' ){    
161           switch (document.f.periodicity.value){
162             case 1:              
163               var doy = dayofyear(d);
164               //var Weeknumber=YWDA[1];
165               document.f.lastvalue2.value=doy; 
166               break;      
167             case 12:     
168               var doy = dayofyear(d);
169               //var Weeknumber=YWDA[1];
170               document.f.lastvalue2.value=doy*2; 
171               break;      
172             case 13:     
173               var doy = dayofyear(d);
174               //var Weeknumber=YWDA[1];
175               document.f.lastvalue2.value=doy/3; 
176               break;      
177             case 2:
178             case 3:
179             case 4:
180               var YWDa = YMDaToYWDa(d);
181               //var Weeknumber=YWDA[1];
182               document.f.lastvalue2.value=YWDA[1]/(document.f.periodicity.value-1); 
183               break;      
184             case 5:
185               var smonth = d.getMonth();
186               document.f.lastvalue2.value=smonth;
187               break;      
188             case 6:
189               var smonth = d.getMonth();
190               document.f.lastvalue2.value=smonth/2;
191               break;      
192             case 7:
193             case 8:      
194               var smonth = d.getMonth();
195               document.f.lastvalue2.value=smonth/3;
196               break;      
197             case 9:                        
198               var smonth = d.getMonth();
199               document.f.lastvalue2.value=smonth/6;
200               break;      
201             default:
202           } 
203         }    
204         //         document.f.lastvalue2.value=document.f.lastvaluetemp2.value;
205         document.f.lastvalue3.value='';
206         document.f.numberingmethod.value=_('{X}/{Y}');
207         moreoptions(text[16],text[0]);
208         display_table(0);
209         break;
210     default:
211         document.f.add1.value=1;
212         document.f.add2.value='';
213         document.f.add3.value='';
214         document.f.every1.value=1;
215         document.f.every2.value='';
216         document.f.every3.value='';
217         document.f.whenmorethan1.value=9999999;
218         document.f.whenmorethan2.value='';
219         document.f.whenmorethan3.value='';
220         document.f.setto1.value=0;
221         document.f.setto2.value='';
222         document.f.setto3.value='';
223 /*        document.f.lastvalue1.value=1;
224         document.f.lastvalue2.value='';
225         document.f.lastvalue3.value='';*/
226         document.f.numberingmethod.value='{X}';
227         moreoptions_daily_check(text[0]);
228         document.f.irreg_check.value=1;
229         display_table(0);
230         break;
231     }
232 }
233
234 function display_table(n) {
235     if(n==1){
236         document.getElementById("basetable").style.display = 'block';
237     } else {
238         document.getElementById("basetable").style.display = 'none';
239     }
240 }
241
242 function modify_num_pattern() {
243         if(!document.getElementById("numberpattern")){ return false; }
244     document.getElementById("numberpattern").value = '<!-- TMPL_VAR NAME="numberpattern" -->';
245     num_pattern();
246     
247     document.f.add1.value='<!-- TMPL_VAR NAME="add1" -->';
248     document.f.add2.value='<!-- TMPL_VAR NAME="add2" -->';
249     document.f.add3.value='<!-- TMPL_VAR NAME="add3" -->';
250     document.f.every1.value='<!-- TMPL_VAR NAME="every1" -->';
251     document.f.every2.value='<!-- TMPL_VAR NAME="every2" -->';
252     document.f.every3.value='<!-- TMPL_VAR NAME="every3" -->';
253     document.f.whenmorethan1.value='<!-- TMPL_VAR NAME="whenmorethan1" -->';
254     document.f.whenmorethan2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
255     document.f.whenmorethan3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
256     document.f.setto1.value='<!-- TMPL_VAR NAME="setto1" -->';
257     document.f.setto2.value='<!-- TMPL_VAR NAME="setto2" -->';
258     document.f.setto3.value='<!-- TMPL_VAR NAME="setto3" -->';
259     document.f.lastvalue1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
260     document.f.lastvalue2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
261     document.f.lastvalue3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
262     document.f.numberingmethod.value='<!-- TMPL_VAR NAME="numberingmethod" -->';
263
264     var more_strY;
265     var more_strZ;
266     <!-- TMPL_IF NAME="add2" -->
267     if(<!-- TMPL_VAR NAME="add2" --> > 0){
268         more_strY="Y";
269     }
270     <!-- /TMPL_IF -->
271     <!-- TMPL_IF NAME="add3" -->
272     if(<!-- TMPL_VAR NAME="add3" --> > 0){
273         more_strZ="Z";
274     }
275     <!-- /TMPL_IF -->
276
277     document.f.lastvaluetemp1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
278     if(more_strY){
279         document.f.lastvaluetemp2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
280     document.f.whenmorethantemp2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
281     }
282     if(more_strZ){
283         document.f.lastvaluetemp3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
284     document.f.whenmorethantemp3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
285     }
286 }
287
288 // a pre check with more options to see if 'number' and '1/day' are chosen
289 function moreoptions_daily_check(x) {
290     var periodicity = document.f.periodicity.value;
291     var errortext='';
292     if(periodicity == 1){
293         document.getElementById("irregularity").innerHTML = '';
294         var daynames = new Array(_('Monday'),_('Tuesday'),_('Wednesday'),_('Thursday'),_('Friday'),_('Saturday'),_('Sunday'));
295         errortext =_("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
296         for(var j=0;j<daynames.length;j++){
297             errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+daynames[j]+" &nbsp; ";
298         }
299         var error = errortext;
300         moreoptions(x);
301         document.getElementById("irregularity").innerHTML = error;
302     } else {
303         document.getElementById("irregularity").innerHTML = '';
304         document.getElementById("more_options").innerHTML = '';
305         moreoptions(x);
306     }
307 }
308
309 // to dispaly the more options section
310 function moreoptions(x,y,z){
311 document.getElementById("irregularity").innerHTML = '';
312 document.getElementById("more_options").innerHTML = '';
313 var textbox = '';
314     // alert("X: "+x+"Y: "+y+"Z: "+z);
315     if(x){
316         textbox +="<table>\n<tr><th>&nbsp;<\/th><th>"+x+"<\/th>";
317         if(y){
318             textbox +="<th>"+y+"<\/th>";
319             if(z){
320                 textbox +="<th>"+z+"<\/th>";
321             }
322         }
323         textbox +="<\/tr>\n";
324         textbox +="<tr><th scope=\"row\">"+text[5]+"<\/td><td><input type='text' name='lastvaluetemp1' size='4' onkeyup='moreoptionsupdate(\"lastvalue1\")' value=" + document.f.lastvalue1.value +" /><\/td>\n";
325         if(y){
326             textbox +="<td><input type='text' name='lastvaluetemp2' size='4' onkeyup='moreoptionsupdate(\"lastvalue2\")' value=" + document.f.lastvalue2.value + " /><\/td>\n";
327             if(z){
328                 textbox +="<td><input type='text' name='lastvaluetemp3' size='4' onkeyup='moreoptionsupdate(\"lastvalue3\")' value=" + document.f.lastvalue3.value + " /><\/td>\n";
329             }
330         }
331         textbox +="<\/tr>\n";
332         if(y){
333             textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
334             textbox +="<td><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"<\/a><\/td>\n";
335             textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
336             if(z){
337                 textbox +="<td><input type='text' name='whenmorethantemp3' size='4' onkeyup='moreoptionsupdate(\"whenmorethan3\",1)'><\/td>\n";
338             }
339             textbox +="<\/tr>";
340         } else {
341           textbox +="<tr> <td>"+_('issues expected')+"</td><td><input type='text' name='issuesexpectedtemp1' size='4' onkeyup='moreoptionsupdate(\"issuesexpected1\",0)' value=" + document.f.issuesexpected1.value + " ><br/><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"</a></td></tr>";
342         }
343         textbox +="<\/table>\n";
344     }
345     document.getElementById("more_options").innerHTML = textbox;
346 }
347
348 function hemispheres(chosen){
349 var selbox = document.getElementById("season1");
350     if(selbox){
351     var selboxselected = selbox.options[selbox.selectedIndex].value;
352     selbox.options.length = 0;
353
354     if (chosen == "1") {
355         selbox.options[selbox.options.length] = new Option(text[11],'1');
356         selbox.options[selbox.options.length] = new Option(text[12],'2');
357         selbox.options[selbox.options.length] = new Option(text[13],'3');
358         selbox.options[selbox.options.length] = new Option(text[14],'4');
359         is_hemisphere = 1;
360         selbox.options[selboxselected-1].selected = true;
361     }
362
363     if (chosen == "2") {
364         selbox.options[selbox.options.length] = new Option(text[13],'1');
365         selbox.options[selbox.options.length] = new Option(text[10],'2');
366         selbox.options[selbox.options.length] = new Option(text[11],'3');
367         selbox.options[selbox.options.length] = new Option(text[12],'4');
368         is_hemisphere = 2;
369         selbox.options[selboxselected-1].selected = true;
370     }
371     }
372 }
373
374 // to dispaly the more options section for seasons
375 function moreoptions_seasons(x,y){
376 document.getElementById("irregularity").innerHTML = '';
377 document.getElementById("more_options").innerHTML = '';
378 var textbox = '';
379     // alert("X: "+x+"Year: "+y);
380     if(x){
381         var hemi_select = parseInt('<!-- TMPL_VAR NAME="hemisphere" -->');
382         textbox +="<li><label for=\"hemisphere\">"+ text[7]  +"<\/label><select name='hemisphere' id=\"hemisphere\" onchange='hemispheres(this.options[this.selectedIndex].value)'>";
383         for(var i = 1; i <= 2; i++){
384             textbox +="<option value='"+i+"'";
385             if(i == hemi_select){
386                 textbox += " selected "
387             }
388             textbox +=">"+text[i+7]+"<\/option>";
389         }
390         textbox +="<\/li>\n";
391         textbox +="<table><tr><th>&nbsp;<\/th><th>"+x+"<\/th>";
392         textbox +="<th>"+text[16]+"<\/th>";
393         textbox +="<\/tr>\n";
394         textbox +="<tr><th scope=\"row\">"+text[5]+"<\/th><td><select name='lastvaluetemp2' id='season1' onchange='moreoptionsupdate(\"lastvalue2\")'>";
395         for(var j = 1; j <= 4; j++){
396             textbox +="<option value='"+j+"'>"+text[j+10]+"<\/option>";
397         }
398         textbox +="<\/select><\/td><td><select name='lastvaluetemp1' onchange='moreoptionsupdate(\"lastvalue1\")'>";
399         for(var k = parseInt(y); k <= parseInt(y)+15; k++){
400             textbox +="<option value='"+k+"'>"+k+"<\/option>";
401         }
402         textbox +="<\/select><\/td><\/tr>\n";
403         textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
404         textbox +="<td><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"<\/a><\/td>\n";
405         textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
406                 textbox +="<\/tr><\/table>\n";
407     }
408     document.getElementById("more_options").innerHTML = textbox;
409 }
410
411 function irregularity_check(){
412     document.f.irreg_check.value = 1; // Irregularity button now pushed
413     var periodicity = document.f.periodicity.value;
414     var rollover = document.f.issuesexpected1.value;
415     if(document.f.whenmorethantemp2){
416       rollover = document.f.whenmorethantemp2.value;
417     }
418     if(document.f.whenmorethantemp3){
419         rollover = document.f.whenmorethantemp3.value;
420     }
421     var error='';
422     var toobig;
423     var expected; 
424     var errortext = _("<b>Warning irregularity detected<\/b><br \/>");
425     switch(periodicity){
426     case "12":
427         if(rollover < 730) expected =730;
428         if(rollover > 730) {
429             expectedover=730;
430             toobig=1;
431         }
432         break;
433     case "1":
434         if(rollover < 365) expected =365;
435         if(rollover > 365) {
436             expectedover=365;
437             toobig=1;
438         }
439         break;
440     case "13":
441         if(rollover < 156) expected =156;
442         if(rollover > 156) {
443             expectedover=156;
444             toobig=1;
445         }
446         break;
447     case "2":
448         if(rollover < 52) expected =52;
449         if(rollover > 52){
450             expectedover=52;
451             toobig=1;
452         }
453         break;
454     case "3":
455         if(rollover < 26) expected =26;
456         if(rollover > 26){
457             expectedover=26;
458             toobig=1;
459         }
460         break;
461     case "4":
462         if(rollover < 17) expected =17;
463         if(rollover > 17){
464             expectedover=17;
465             toobig=1;
466         }
467         break;
468     case "5":
469         if(rollover < 12) expected =12;
470         if(rollover > 12){
471             expectedover=12;
472             toobig=1;
473         }
474         break;
475     case "6":
476         if(rollover < 6) expected =6;
477         if(rollover > 6){
478             expectedover=6;
479             toobig=1;
480         }
481         break;
482     case "7":
483         if(rollover < 4) expected =4;
484         if(rollover > 4){
485             expectedover=4;
486             toobig=1;
487         }
488         break;
489     case "8":
490         if(rollover < 4) expected =4;
491         if(rollover > 4){
492             expectedover=4;
493             toobig=1;
494         }
495         break;
496     case "9":
497         if(rollover < 2) expected =2;
498         if(rollover > 2){
499             expectedover=2;
500             toobig=1;
501         }
502         break;
503     case "10":
504         if(rollover < 1) expected =1;
505         if(rollover > 1){
506             expectedover=1;
507             toobig=1;
508         }
509         break;
510     default:
511         break;
512     }
513     if(expected){
514         if(expected == 365 || expected==730){
515             var daynames = new Array(_('Monday'),_('Tuesday'),_('Wednesday'),_('Thursday'),_('Friday'),_('Saturday'),_('Sunday'));
516             errortext += _("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
517             for(var j=0;j<daynames.length;j++){
518                 errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+daynames[j]+" &nbsp; ";
519             }
520             error=errortext;
521         } else {
522             errortext +=expected+_(" issues expected ")+rollover+_(" were entered. <br \/>Please indicate which date(s) an issue is not expected<br \/>");
523             var count=0;
524             for(var i=rollover;i<expected;i++){
525                 errortext +="<select name='irregular' id='irregular"+count+"' onchange='display_example(expected)'>\n";
526                 errortext +=irregular_options(periodicity);
527                 errortext +="<\/select>\n";
528                 count++;
529             }
530             error=errortext;
531         }
532     }
533     if(toobig){
534         errortext +=expectedover+_(" issues expected ")+rollover+_(" were entered.<br \/> You seem to have indicated more issues per year than expected.");
535         error=errortext;
536     }
537     if(error.length ==0){
538         error=_('No irregularities noticed');
539     }
540     display_example(expected);
541     document.getElementById("irregularity").innerHTML = error;
542 }
543
544 function irregular_options(periodicity){
545     var titles;
546     var count;
547 <!-- TMPL_IF NAME="weekarrayjs" -->
548     var weeks = new Array(<!-- TMPL_VAR NAME="weekarrayjs" -->); 
549 <!-- /TMPL_IF -->
550     var months = new Array(_('January'),_('February'),_('March'),_('April'),_('May'),_('June'),_('July'),_('August'),_('September'),_('October'),_('November'),_('December'));
551     var seasons = new Array(_('Autumn'),_('Winter'),_('Spring'),_('Summer'),_('Fall'));
552     var errortext='';
553     if(periodicity == 1) {
554         expected = 366;
555         titles = "Day";
556         count = 1;
557     }
558     if(periodicity == 2 || periodicity == 3 || periodicity == 4) { 
559         expected = 52;
560     <!-- TMPL_IF NAME="weekarrayjs" -->
561         titles = weeks;
562         count = <!-- TMPL_VAR NAME="weekno" -->;
563     <!-- TMPL_ELSE -->
564         titles = "Week";
565         count = 1;
566     <!-- /TMPL_IF -->
567     }
568     if(periodicity == 5 || periodicity == 6 || periodicity == 7 || periodicity == 8 || periodicity == 9) {
569         if(periodicity == 8) {
570             is_season = 1; // setting up from edit page
571         } 
572         if(is_season){
573             titles = seasons;
574             expected = 4;
575             if(is_hemisphere == 2){
576                 count = 2;
577             } else {
578                 count = 1;
579             }
580         } else {
581             titles = months;
582             expected = 12;
583             count = 1;
584         }
585     }
586     for(var j=1;j<=expected;j++){
587         if(isArray(titles)){
588             if(count>expected){
589                 count = count-expected;
590             }
591             if(is_season && is_hemisphere == 1){
592                 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j]+"<\/option>\n";
593 // alert("value: "+((count*3)-2)+" title: "+titles[j]);
594             } else if(is_season && is_hemisphere == 2){
595                 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j-1]+"<\/option>\n";
596 // alert("value: "+((count*3)-2)+" title: "+titles[j-1]);
597             } else {
598                 errortext +="<option value='"+count+"'>"+titles[j-1]+"<\/option>\n";
599             }
600             count++;
601         } else {
602             errortext +="<option value='"+j+"'>"+titles+" "+j+"<\/option>\n";
603         }
604     }
605     return errortext;
606 }
607
608 function irregular_order(){
609     var irregular = '<!-- TMPL_VAR NAME="irregularity" -->';
610     var periodicity = document.f.periodicity.value;
611     var irregarray = irregular.split(',');
612     if(periodicity ==1){
613         for(j=0;j<irregarray.length;j++){
614         document.getElementById("irregular"+irregarray[j]).checked = true; 
615         }
616     } else {
617         for(i=0;i<irregarray.length;i++){    
618             document.getElementById("irregular"+i).value = irregarray[i];
619         }
620     }
621 }
622
623 function display_example(expected){
624     var startfrom1 = parseInt(document.f.lastvalue1.value);
625     var startfrom2 = parseInt(document.f.lastvalue2.value);
626     var startfrom3 = parseInt(document.f.lastvalue3.value);
627     var every1 = parseInt(document.f.every1.value);
628     var every2 = parseInt(document.f.every2.value);
629     var every3 = parseInt(document.f.every3.value);
630     var numberpattern = document.f.numberingmethod.value;
631     var whenmorethan2 = parseInt(document.f.whenmorethan2.value);
632     var whenmorethan3 = parseInt(document.f.whenmorethan3.value);
633     var setto2 = parseInt(document.f.setto2.value);
634     var setto3 = parseInt(document.f.setto3.value);
635     var displaytext = _('Based on the information<br \/>entered the Numbering Pattern<br \/>will look like this<br \/>\n');
636     if(startfrom3>0){
637         var count=startfrom3-1;
638         var count2=startfrom2;
639         for(var i=0;i<12;i++){
640             if(count>=whenmorethan3){
641                 count=setto3;
642                 if(count2>=whenmorethan2){
643                     startfrom1++;
644                     count2=setto2;
645                 } else {
646                     count2++;
647                 }
648             } else {
649                 count++;
650             }
651             displaytext += numberpattern.replace(/{Z}/,count)+'\n';
652             displaytext = displaytext.replace(/{Y}/,count2)+'<br \/>\n';
653             displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
654
655         }
656     }
657     if(startfrom2>0 && !startfrom3){
658         var count=startfrom2-1;
659         for(var i=0;i<12;i++){
660             if(count>=whenmorethan2){
661                 startfrom1++;
662                 count=setto2;
663             } else {
664                 count++;
665             }
666
667             if(is_season){
668                 if(is_hemisphere == 2){
669                     if(count == 1) {
670                         displaytext += numberpattern.replace(/{Y}/,text[count+12])+'\n';
671                     } else {
672                         displaytext += numberpattern.replace(/{Y}/,text[count+8])+'\n';
673                     }
674                 } else {
675                 displaytext += numberpattern.replace(/{Y}/,text[count+10])+'\n';
676                 }
677             } else {
678                 displaytext += numberpattern.replace(/{Y}/,count)+'\n';
679             }
680             displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
681         }
682     }
683     if(startfrom1>0 && !startfrom2 && !startfrom3){
684         var offset=eval(document.f.issuesexpected1.value);
685         if (!offset){
686             offset = 12 
687         }
688         for(var i=startfrom1;i<(startfrom1+offset);i+=every1){
689             displaytext += numberpattern.replace(/{X}/,i)+'<br \/>\n';
690         }
691     }
692     displaytext = "<div style='padding: 5px; background-color: #CCCCCC'>"+displaytext+"<\/div>";
693     document.getElementById("displayexample").innerHTML = displaytext;
694 }
695
696 function isArray(obj) {
697 if (obj.constructor.toString().indexOf("Array") == -1)
698     return false;
699 else
700     return true;
701 }
702
703 function moreoptionsupdate(fieldnames,rollover){
704     fieldname = fieldnames;
705     fld = fieldname.length;
706     fld = fld-1;
707     fieldnametempnumber = fieldname.substr(fld);
708     //alert(fieldnametempnumber);
709     fieldnametemp = fieldname.slice(0,-1)+"temp"+fieldnametempnumber;
710     // alert(fieldnametemp);
711     eval("document.f."+fieldname+".value = document.f."+fieldnametemp+".value");
712 //     alert (fieldname+" : "+eval("document.f."+fieldname+".value") +' '+fieldnametemp+' : ' +eval("document.f."+fieldnametemp+".value"));
713     var patternchoice = document.getElementById("numberpattern").value;
714     switch(patternchoice){
715     case "2":
716     case "4":
717     case "5":
718     case "8":
719        if (document.f.lastvaluetemp2.value>0){document.f.innerloop1.value = document.f.lastvaluetemp2.value;}
720       break;   
721     }  
722     if(rollover){
723         eval("document.f.every"+(fieldnametempnumber-1)+".value = document.f."+fieldnametemp+".value");
724     }
725 }
726
727
728 function check_input(e){
729     var unicode=e.charCode? e.charCode : e.keyCode
730     if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
731         if (unicode<48||unicode>57) { // if not a number
732             alert(_("Needs to be entered in digit form -eg 10"));
733             return false // disable key press
734         }
735     }
736 }
737
738 function addbiblioPopup(biblionumber) {
739         var destination = "/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup";
740         if(biblionumber){ destination += "&biblionumber="+biblionumber; }
741  window.open(destination,'AddBiblioPopup','width=1024,height=768,toolbar=no,scrollbars=yes');
742 }
743
744 function Plugin(f)
745 {
746          window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
747 }
748
749 function FindAcqui(f)
750 {
751          window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
752 }
753
754 function Find_ISSN(f)
755 {
756          window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
757 }
758
759
760 function Check(f) {
761     if (f.aqbooksellerid.value.length==0) {
762         alert(_('You must choose a bookseller'));
763     } else if (f.biblionumber.value.length==0) {
764         alert(_('You must choose or create a biblio'));
765     } else if(f.startdate.value.length != 0 && f.sublength.value > 0) {
766         if (f.irreg_check.value == 1) {
767             document.f.submit();
768         } else {
769             if(f.numbering_pattern.value == ''){
770                 alert(_("Please choose a numbering pattern"));
771             } else {
772                 alert(_("Please check for irregularity by clicking 'Irregularity?'"));
773             }
774         }
775     } else {
776         alert(_('You must choose a start date and a subscription length'));
777     }
778     return false;
779 }
780 <!-- TMPL_IF name="mod" -->
781 window.onload = modify_num_pattern();
782     <!-- TMPL_IF name="hemisphere" -->
783     window.onload = hemispheres(<!-- TMPL_VAR NAME="hemisphere" -->);
784     <!-- /TMPL_IF -->
785 <!-- /TMPL_IF -->
786 <!-- TMPL_IF name="irregularity" -->
787 window.onload = irregularity_check();
788 window.onload = irregular_order();
789 <!-- /TMPL_IF -->
790 -->
791 </script>
792 </head>
793 <body>
794 <!-- TMPL_INCLUDE NAME="header.inc" -->
795 <!-- TMPL_INCLUDE NAME="serials-search.inc" -->
796
797 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/subscription-add.pl">Serials</a> &rsaquo; <!-- TMPL_IF name="mod" --> Modify subscription to <i><!-- TMPL_VAR name="bibliotitle" --></i><!-- TMPL_ELSE -->New subscription<!-- /TMPL_IF --></div>
798
799 <div id="doc3" class="yui-t7">
800    
801    <div id="bd">
802    <div class="yui-g">
803
804 <!-- TMPL_IF name="mod" -->
805     <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
806         <input type="hidden" name="op" value="modsubscription" />
807         <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
808 <!-- TMPL_ELSE -->
809     <form method="post" action="/cgi-bin/koha/serials/subscription-add.pl" name="f">
810         <input type="hidden" name="op" value="addsubscription" />
811 <!-- /TMPL_IF -->
812 <input type="hidden" name="user" value="<!-- TMPL_VAR name="loggedinusername" -->" />
813 <input type="hidden" name="irreg_check" value="0" />
814 <input type="hidden" name="issuesexpected1" value="0" />
815
816         <div class="yui-u first">
817     <fieldset id="subscription_add_information" class="rows">
818         <legend>Subscription information for subscription #<!--TMPL_VAR name="subscriptionid"--></legend>
819         <ol>
820         <li>
821             <span class="label">Librarian: </span>            <!-- TMPL_VAR name="loggedinusername" -->
822         </li>
823         <li>
824             <label for="aqbooksellerid">Supplier: (*)</label>
825             <input type="text" name="aqbooksellerid" id="aqbooksellerid" value="<!-- TMPL_VAR name="aqbooksellerid" -->" size="8" /> (<input type="text" name="aqbooksellername" value="<!-- TMPL_VAR name="aqbooksellername" -->" disabled="disabled" readonly="readonly" />) <div class="inputnote"><a href="#" onclick="FindAcqui(f)">Search for a Supplier</a></div>
826         </li>
827         <li>
828             <label for="biblionumber">Biblio: (*)</label>
829             
830                 <input type="text" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size="8" /> 
831                 (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled="disabled" readonly="readonly" />)
832                <div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a> | <!--TMPL_IF Name="mod"--><a href="#" onclick="addbiblioPopup(<!-- TMPL_VAR NAME="biblionumber" -->); return false;">Edit biblio</a><!-- TMPL_ELSE -->
833                 <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a><!--/TMPL_IF--></div>
834             
835         </li>
836         <li>
837             <label for="callnumber">Call Number</label>
838             <input type="text" name="callnumber" id="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" />
839         </li>
840         <li>
841             <label for="branchcode">Branch</label>
842             
843                 <select name="branchcode" id="branchcode">
844                     <option value="">Any branch</option>
845                     <!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
846                                 <!-- TMPL_ELSE -->
847                                 <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
848                                 <!-- /TMPL_IF -->
849                     <!-- /TMPL_LOOP -->
850                 </select> (select a branch)
851             
852         </li>
853         <li>
854             <label for="notes">Notes</label>
855             <textarea name="notes" id="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea>
856         </li>
857         <li>
858             <label for="internalnotes">Management Notes</label>
859             <textarea name="internalnotes" id="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea>
860         </li>
861         <li>
862             <label for="letter">Patron alert with </label>
863             
864                 <select name="letter" id="letter">
865                     <option value="">un-activated</option>
866                 <!-- TMPL_LOOP name="letterloop" -->
867                                 <!-- TMPL_IF name="selected" -->
868                     <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
869 <!-- TMPL_ELSE -->
870                     <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
871 <!-- /TMPL_IF -->
872                 <!-- /TMPL_LOOP -->
873                 </select> <div class="inputnote">(select a letter &amp; patrons will be able to "follow" this subscription and recieve a mail on every new issue)</div>
874             
875         </li>
876         </ol>
877
878             <div class="warning"><b>Warning:</b>
879             
880                 <ul>
881                     <li>Remember you <b>must</b> have created a biblio <b>before</b> creating a subscription</li>
882                     <li>You also must have selected a supplier if you want to ask for late issues</li>
883                 </ul></div>
884             
885
886         </fieldset>
887         </div>
888         
889 <div class="yui-u">
890 <div id="subscription_form_planning">
891         <fieldset class="rows">
892         <legend>Planning</legend>
893     <ol>
894         <li>
895            <label for="firstacquidate"> First Issue ETA:</label>
896             
897                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button2" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
898                 <input type="text" name="firstacquidate" value="<!-- TMPL_VAR name="firstacquidate" -->" size="13" maxlength="10" id="acqui_date" style="border-width: 0px;" />
899                 <!-- both scripts for calendar must follow the input field --> 
900                 <script type="text/javascript">
901                     Calendar.setup({
902                         inputField:"acqui_date",
903                         ifFormat       :   "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
904                         button         :   "button2",
905                         align          :   "Tl"
906                     });
907                 </script>
908                 <script type="text/javascript">
909                     Calendar.setup({
910                         inputField     :   "acqui_date",
911                         ifFormat       :   "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
912                         button         :   "acqui_date",
913                         align          :   "Tl"
914                     });
915                 </script>
916            
917         </li>
918         <li>
919             <label for="periodicity">Frequency: (*)</label>
920             
921                 <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1);num_pattern;">
922                 <option value="" selected="selected">-- please choose --</option>
923                 <!-- TMPL_IF name="periodicity16" -->
924                 <option value="16" selected="selected">Without Periodicity</option>
925                 <!-- TMPL_ELSE -->
926                     <option value="16">Without Periodicity</option>
927                 <!-- /TMPL_IF -->
928                 <!-- TMPL_IF name="periodicity48" -->
929                 <option value="48" selected="selected">Unknown</option>
930                 <!-- TMPL_ELSE -->
931                 <option value="48">Unknown</option>
932                 <!-- /TMPL_IF -->
933                 <!-- TMPL_IF name="periodicity32" -->
934                 <option value="32" selected="selected">Irregular</option>
935                 <!-- TMPL_ELSE -->
936                     <option value="32">Irregular</option>
937                 <!-- /TMPL_IF -->
938
939                 <!-- TMPL_IF name="periodicity12" -->
940                     <option value="12" selected="selected">2/day</option>
941                 <!-- TMPL_ELSE -->
942                     <option value="12">2/day</option>
943                 <!-- /TMPL_IF -->
944                 <!-- TMPL_IF name="periodicity1" -->
945                     <option value="1" selected="selected">1/day</option>
946                 <!-- TMPL_ELSE -->
947                     <option value="1">1/day</option>
948                 <!-- /TMPL_IF -->
949                 <!-- TMPL_IF name="periodicity13" -->
950                     <option value="13" selected="selected">3/week</option>
951                 <!-- TMPL_ELSE -->
952                     <option value="13">3/week</option>
953                 <!-- /TMPL_IF -->
954                 <!-- TMPL_IF name="periodicity2" -->
955                     <option value="2" selected="selected">1/week</option>
956                 <!-- TMPL_ELSE -->
957                     <option value="2">1/week</option>
958                 <!-- /TMPL_IF -->
959                 <!-- TMPL_IF name="periodicity3" -->
960                     <option value="3" selected="selected">1/2 weeks (2/month)</option>
961                 <!-- TMPL_ELSE -->
962                     <option value="3">1/2 weeks (2/months)</option>
963                 <!-- /TMPL_IF -->
964                 <!-- TMPL_IF name="periodicity4" -->
965                     <option value="4" selected="selected">1/3 weeks</option>
966                 <!-- TMPL_ELSE -->
967                     <option value="4">1/3 weeks</option>
968                 <!-- /TMPL_IF -->
969                 <!-- TMPL_IF name="periodicity5" -->
970                     <option value="5" selected="selected">1/month</option>
971                 <!-- TMPL_ELSE -->
972                     <option value="5">1/month</option>
973                 <!-- /TMPL_IF -->
974                 <!-- TMPL_IF name="periodicity6" -->
975                     <option value="6" selected="selected">1/2 months (6/year)</option>
976                 <!-- TMPL_ELSE -->
977                     <option value="6">1/2 months (6/year)</option>
978                 <!-- /TMPL_IF -->
979                 <!-- TMPL_IF name="periodicity7" -->
980                     <option value="7" selected="selected">1/3 months (1/quarter)</option>
981                 <!-- TMPL_ELSE -->
982                     <option value="7">1/3 months (1/quarter)</option>
983                 <!-- /TMPL_IF -->
984                 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
985                 <!-- TMPL_IF name="periodicity8" -->
986                     <option value="8" selected="selected">1/quarter (seasonal)</option>
987                 <!-- TMPL_ELSE -->
988                     <option value="8">1/quarter (seasonal)</option>
989                 <!-- /TMPL_IF -->
990
991                 <!-- TMPL_IF name="periodicity9" -->
992                     <option value="9" selected="selected">2/years</option>
993                 <!-- TMPL_ELSE -->
994                     <option value="9">2/year</option>
995                 <!-- /TMPL_IF -->
996                 <!-- TMPL_IF name="periodicity10" -->
997                     <option value="10" selected="selected">1/year</option>
998                 <!-- TMPL_ELSE -->
999                     <option value="10">1/year</option>
1000                 <!-- /TMPL_IF -->
1001                 <!-- TMPL_IF name="periodicity11" -->
1002                     <option value="11" selected="selected">1/2 years</option>
1003                 <!-- TMPL_ELSE -->
1004                     <option value="11">1/2 years</option>
1005                 <!-- /TMPL_IF -->
1006                 </select></li>
1007                                 <li><label for="manuallist"> Manual History:</label> <input type="checkbox" name="manualhist" id="manuallist" value="1" /></li>
1008         <li>
1009            <label for="numberpattern"> Numbering Pattern:</label>
1010             
1011                 <select name="numbering_pattern" size="1" id="numberpattern" onchange="num_pattern()">
1012                     <option value="" selected="selected">-- please choose --</option>
1013                     <!-- TMPL_IF name="numberpattern1" -->
1014                         <option value="1" selected="selected">Number</option>
1015                     <!-- TMPL_ELSE -->
1016                         <option value="1">Number</option>
1017                     <!-- /TMPL_IF -->
1018                     <!-- TMPL_IF name="numberpattern2" -->
1019                         <option value="2" selected="selected">Volume, Number, Issue</option>
1020                     <!-- TMPL_ELSE -->
1021                         <option value="2">Volume, Number, Issue</option>
1022                     <!-- /TMPL_IF -->
1023                     <!-- TMPL_IF name="numberpattern3" -->
1024                         <option value="3" selected="selected">Volume, Number</option>
1025                     <!-- TMPL_ELSE -->
1026                         <option value="3">Volume, Number</option>
1027                     <!-- /TMPL_IF -->
1028                     <!-- TMPL_IF name="numberpattern4" -->
1029                         <option value="4" selected="selected">Volume, Issue</option>
1030                     <!-- TMPL_ELSE -->
1031                         <option value="4">Volume, Issue</option>
1032                     <!-- /TMPL_IF -->
1033                     <!-- TMPL_IF name="numberpattern5" -->
1034                         <option value="5" selected="selected">Number, Issue</option>
1035                     <!-- TMPL_ELSE -->
1036                         <option value="5">Number, Issue</option>
1037                     <!-- /TMPL_IF -->
1038                     <!-- TMPL_IF name="numberpattern6" -->
1039                         <option value="6" selected="selected">Seasonal only</option>
1040                     <!-- TMPL_ELSE -->
1041                         <option value="6">Seasonal only</option>
1042                     <!-- /TMPL_IF -->
1043                     <!-- TMPL_IF name="numberpattern8" -->
1044                         <option value="8" selected="selected">Year/Number</option>
1045                     <!-- TMPL_ELSE -->
1046                         <option value="8">Year/Number</option>
1047                     <!-- /TMPL_IF -->          
1048                     <!-- TMPL_IF name="numberpattern7" -->
1049                         <option value="7" selected="selected">None of the above</option>
1050                     <!-- TMPL_ELSE -->
1051                         <option value="7">None of the above</option>
1052                     <!-- /TMPL_IF -->
1053                 </select>
1054         </li>
1055                 <li id="more_options"></li>
1056                 <li id="irregularity"></li>
1057                    <li id="displayexample"></li>
1058         <li>
1059            <label for="startdate"> Begins On: (*)</label>
1060             
1061                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1062                 <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" />
1063                 <!-- both scripts for calendar must follow the input field --> 
1064                 <script type="text/javascript">
1065                     Calendar.setup({
1066                         inputField   : "beginning_date",
1067                         ifFormat     : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1068                         button       : "button1",
1069                         align        : "Tl"
1070                     });
1071                 </script>
1072                 <script type="text/javascript">
1073                     Calendar.setup({
1074                         inputField   : "beginning_date",
1075                         ifFormat     : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1076                         button       : "beginning_date",
1077                         align        : "Tl"
1078                     });
1079                 </script>
1080             
1081         </li>
1082         <li>
1083             <label for="subtype">Subscription length</label>
1084             
1085                 <select name="subtype" id="subtype">
1086                     <!-- TMPL_LOOP NAME="subtype" -->
1087                         <!-- TMPL_IF NAME="selected" -->
1088                         <option value="<!-- TMPL_VAR NAME="name" -->" selected="selected">
1089                         <!-- TMPL_ELSE -->
1090                         <option value="<!-- TMPL_VAR NAME="name" -->">
1091                         <!-- /TMPL_IF -->
1092                         <!-- TMPL_VAR NAME="name" -->
1093                         </option>
1094                     <!-- /TMPL_LOOP -->
1095                 </select>
1096                 <input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (*) (enter amount in numerals)
1097             
1098         </li>
1099     <li><label for="numberingmethod">Numbering formula:</label> <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" />
1100     </li>
1101     <li>
1102            <div id="basetable" style="display: none;">
1103             <table class="small">
1104                 <tr>
1105                     <th>&nbsp;</th>
1106                     <th>X</th>
1107                     <th>Y</th>
1108                     <th>Z</th>
1109                 </tr>
1110                 <tr>
1111                     <td>Add</td>
1112                     <td>
1113                         <input type="text" name="add1" value="<!-- TMPL_VAR name="add1" -->" />
1114                     </td>
1115                     <td>
1116                         <input type="text" name="add2" value="<!-- TMPL_VAR name="add2" -->" />
1117                     </td>
1118                     <td>
1119                         <input type="text" name="add3" value="<!-- TMPL_VAR name="add3" -->" />
1120                     </td>
1121                 </tr>
1122                 <tr>
1123                     <td>once every</td>
1124                     <td><input type="text" name="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
1125                     <td><input type="text" name="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
1126                     <td><input type="text" name="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
1127                 </tr>
1128                 <tr>
1129                     <td>When more than</td>
1130                     <td><input type="text" name="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
1131                     <td><input type="text" name="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
1132                     <td><input type="text" name="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
1133                 </tr>
1134                 <tr>
1135                     <td>inner counter</td>
1136                     <td><input type="text" name="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
1137                     <td><input type="text" name="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
1138                     <td><input type="text" name="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
1139                 </tr>
1140                 <tr>
1141                     <td>Set back to</td>
1142                     <td><input type="text" name="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
1143                     <td><input type="text" name="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
1144                     <td><input type="text" name="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
1145                 </tr>
1146                 <tr>
1147                     <td>
1148                         <!-- TMPL_IF name="mod" -->
1149                             Last value
1150                         <!-- TMPL_ELSE -->
1151                             Begins with
1152                         <!-- /TMPL_IF -->
1153                     </td>
1154                     <td><input type="text" name="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
1155                     <td><input type="text" name="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
1156                     <td><input type="text" name="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
1157                 </tr>
1158             </table>
1159         </div>
1160         </li>
1161     </ol>
1162         </fieldset>
1163 </div>
1164 <!--TMPL_IF Name="history"-->
1165 <div id="subscription_form_history">
1166     <h2>History</h2>
1167     <table>
1168         <tr>
1169           <td>Starting date:</td>
1170           <td><input type="text" name="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /> (the date of the 1st subscription)</td>
1171         </tr>
1172         <tr>
1173           <td>Ending date:</td>
1174           <td><input type="text" name="enddate" value="<!-- TMPL_VAR name="enddate" -->" />(if empty : subscription still active)</td>
1175         </tr>
1176         <tr>
1177             <td>Received issues</td>
1178             <td><textarea name="recievedlist" cols="60" rows="5"><!-- TMPL_VAR name="recievedlist" --></textarea></td>
1179         </tr>
1180         <tr>
1181             <td>Missing issues</td>
1182             <td><textarea name="missinglist" cols="60" rows="5"><!-- TMPL_VAR name="missinglist" --></textarea></td>
1183         </tr>
1184         <tr>
1185             <td>Opac's notes</td>
1186             <td><textarea name="opacnote" cols="60" rows="5"><!-- TMPL_VAR name="opacnote" --></textarea></td>
1187         </tr>
1188         <tr>
1189             <td>Librarian notes</td>
1190             <td><textarea name="librariannote" cols="60" rows="5"><!-- TMPL_VAR name="librariannote" --></textarea></td>
1191         </tr>
1192     </table>
1193 </div>
1194 <!--/TMPL_IF-->
1195
1196
1197     <input type="button" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1198 </div>
1199
1200 </form>
1201
1202 </div>
1203 </div>
1204
1205 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->