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