moving _( function to header
[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 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
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><td>&nbsp;<\/td><td>"+x+"<\/td>";
317         if(y){
318             textbox +="<td>"+y+"<\/td>";
319             if(z){
320                 textbox +="<td>"+z+"<\/td>";
321             }
322         }
323         textbox +="<\/tr>\n";
324         textbox +="<tr><td>"+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><td>"+text[6]+"<\/td>";
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 +="<table>\n<tr><td>"+ text[7]  +"<\/td><td colspan='2'><select name='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 +="<\/select><\/td><\/tr>\n";
391         textbox +="<tr><td>&nbsp;<\/td><td>"+x+"<\/td>";
392         textbox +="<td>"+text[16]+"<\/td>";
393         textbox +="<\/tr>\n";
394         textbox +="<tr><td>"+text[5]+"<\/td><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><td>"+text[6]+"<\/td>";
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 Create_biblio(f)
739 {
740    window.open('/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup','FindABibIndex','width=1024,height=768,toolbar=no,scrollbars=yes');
741 }
742
743 function Plugin(f)
744 {
745          window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
746 }
747
748 function FindAcqui(f)
749 {
750          window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
751 }
752
753 function Find_ISSN(f)
754 {
755          window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
756 }
757
758
759 function Check(f) {
760     if (f.startdate.value.length != 0 && f.sublength.value > 0) {
761         if (f.irreg_check.value == 1) {
762             document.f.submit();
763         } else {
764             if(f.numbering_pattern.value == ''){
765                 alert(_("need to choose a numbering pattern"));
766             } else {
767                 alert(_("need to check for irregularity by clicking 'Irregularity?'"));
768             }
769         }
770     } else {
771         alert(_('field marked with * are mandatory'));
772     }
773     return false;
774 }
775 <!-- TMPL_IF name="mod" -->
776 window.onload = modify_num_pattern();
777     <!-- TMPL_IF name="hemisphere" -->
778     window.onload = hemispheres(<!-- TMPL_VAR NAME="hemisphere" -->);
779     <!-- /TMPL_IF -->
780 <!-- /TMPL_IF -->
781 <!-- TMPL_IF name="irregularity" -->
782 window.onload = irregularity_check();
783 window.onload = irregular_order();
784 <!-- /TMPL_IF -->
785 -->
786 </script>
787 </head>
788 <body>
789 <!-- TMPL_INCLUDE NAME="header.inc" -->
790 <!-- TMPL_INCLUDE NAME="serials-search.inc" -->
791
792 <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>
793
794 <div id="doc3" class="yui-t2">
795    
796    <div id="bd">
797         <div id="yui-main">
798         <div class="yui-b">
799
800
801
802 <!-- TMPL_IF name="mod" -->
803     <h1>Modify a subscription</h1>
804     <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
805         <input type="hidden" name="op" value="modsubscription" />
806         <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
807 <!-- TMPL_ELSE -->
808     <h1>Add a subscription (Serial Holdings Record)</h1>
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     <h2>Subscription information for subscription #<!--TMPL_VAR name="subscriptionid"--></h2>
817     <table>
818         <tr>
819             <td>Librarian:</td>
820             <td><!-- TMPL_VAR name="loggedinusername" --></td>
821         </tr>
822         <tr>
823             <td><label>Supplier:</label></td>
824             <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>
825         </tr>
826         <tr>
827             <td><label>Biblio</label></td>
828             <td>
829                 <input type="text" name="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size="8" /> 
830                 (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled="disabled" readonly="readonly" />)
831                 <a href="#" onclick="Plugin(f)">Search for Biblio</a> <!--TMPL_UNLESS Name="mod"--> |
832                 <a href="#" onclick="Create_biblio(f)">Create Biblio</a><!--/TMPL_UNLESS-->
833             </td>
834         </tr>
835         <tr>
836             <td><label>Call Number</label></td>
837             <td><input type="text" name="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" /></td>
838         </tr>
839         <tr>
840             <td>Branch</td>
841             <td>
842                 <select name="branchcode">
843                     <option value="">Any branch</option>
844                     <!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
845                                 <!-- TMPL_ELSE -->
846                                 <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
847                                 <!-- /TMPL_IF -->
848                     <!-- /TMPL_LOOP -->
849                 </select> (select a branch)
850             </td>
851         </tr>
852         <tr>
853             <td><label>Notes</label></td>
854             <td><textarea name="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea></td>
855         </tr>
856         <tr>
857             <td><label>Management Notes</label></td>
858             <td><textarea name="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea></td>
859         </tr>
860         <tr>
861             <td>Patron alert with </td>
862             <td>
863                 <select name="letter">
864                     <option value="">un-activated</option>
865                 <!-- TMPL_LOOP name="letterloop" -->
866                                 <!-- TMPL_IF name="selected" -->
867                     <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
868 <!-- TMPL_ELSE -->
869                     <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
870 <!-- /TMPL_IF -->
871                 <!-- /TMPL_LOOP -->
872                 </select> (select a letter &amp; patrons will be able to "follow" this subscription and recieve a mail on every new issue)
873             </td>
874         </tr>
875         <tr>
876             <td><b>Warning:</b></td>
877             <td>
878                 <ul>
879                     <li>Remember you <b>must</b> have created a biblio <b>before</b> creating a subscription</li>
880                     <li>You also must have selected a supplier if you want to ask for late issues</li>
881                 </ul>
882             </td>
883         </tr>
884     </table>
885 <div id="subscription_form_planning">
886     <h2>Planning</h2>
887     <table>
888         <tr>
889             <td>First Issue ETA:</td>
890             <td>
891                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button2" style="cursor: pointer;"  alt=""/>
892                 <input type="text" name="firstacquidate" value="<!-- TMPL_VAR name="firstacquidate" -->" size=13 maxlength=10 id="acqui_date" style="border-width: 0px;" />
893                 <!-- both scripts for calendar must follow the input field --> 
894                 <script type="text/javascript">
895                     Calendar.setup({
896                         inputField:"acqui_date",
897                         ifFormat       :   "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
898                         button         :   "button2",
899                         align          :   "Tl"
900                     });
901                 </script>
902                 <script type="text/javascript">
903                     Calendar.setup({
904                         inputField     :   "acqui_date",
905                         ifFormat       :   "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
906                         button         :   "acqui_date",
907                         align          :   "Tl"
908                     });
909                 </script>
910             </td>
911             <td rowspan="5">
912                 <div id="displayexample"></div>
913             </td>
914         </tr>
915         <tr>
916             <td>Frequency: (*)</td>
917             <td>
918                 <select name="periodicity" size="1" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1);num_pattern;">
919                 <option value="" selected="selected">-- please choose --</option>
920                 <!-- TMPL_IF name="periodicity16" -->
921                 <option value="16" selected="selected">Without Periodicity</option>
922                 <!-- TMPL_ELSE -->
923                     <option value="16">Without Periodicity</option>
924                 <!-- /TMPL_IF -->
925                 <!-- TMPL_IF name="periodicity48" -->
926                 <option value="48" selected="selected">Unknown</option>
927                 <!-- TMPL_ELSE -->
928                 <option value="48">Unknown</option>
929                 <!-- /TMPL_IF -->
930                 <!-- TMPL_IF name="periodicity32" -->
931                 <option value="32" selected="selected">Irregular</option>
932                 <!-- TMPL_ELSE -->
933                     <option value="32">Irregular</option>
934                 <!-- /TMPL_IF -->
935
936                 <!-- TMPL_IF name="periodicity12" -->
937                     <option value="12" selected="selected">2/day</option>
938                 <!-- TMPL_ELSE -->
939                     <option value="12">2/day</option>
940                 <!-- /TMPL_IF -->
941                 <!-- TMPL_IF name="periodicity1" -->
942                     <option value="1" selected="selected">1/day</option>
943                 <!-- TMPL_ELSE -->
944                     <option value="1">1/day</option>
945                 <!-- /TMPL_IF -->
946                 <!-- TMPL_IF name="periodicity13" -->
947                     <option value="13" selected="selected">3/week</option>
948                 <!-- TMPL_ELSE -->
949                     <option value="13">3/week</option>
950                 <!-- /TMPL_IF -->
951                 <!-- TMPL_IF name="periodicity2" -->
952                     <option value="2" selected="selected">1/week</option>
953                 <!-- TMPL_ELSE -->
954                     <option value="2">1/week</option>
955                 <!-- /TMPL_IF -->
956                 <!-- TMPL_IF name="periodicity3" -->
957                     <option value="3" selected="selected">1/2 weeks (2/month)</option>
958                 <!-- TMPL_ELSE -->
959                     <option value="3">1/2 weeks (2/months)</option>
960                 <!-- /TMPL_IF -->
961                 <!-- TMPL_IF name="periodicity4" -->
962                     <option value="4" selected="selected">1/3 weeks</option>
963                 <!-- TMPL_ELSE -->
964                     <option value="4">1/3 weeks</option>
965                 <!-- /TMPL_IF -->
966                 <!-- TMPL_IF name="periodicity5" -->
967                     <option value="5" selected="selected">1/month</option>
968                 <!-- TMPL_ELSE -->
969                     <option value="5">1/month</option>
970                 <!-- /TMPL_IF -->
971                 <!-- TMPL_IF name="periodicity6" -->
972                     <option value="6" selected="selected">1/2 months (6/year)</option>
973                 <!-- TMPL_ELSE -->
974                     <option value="6">1/2 months (6/year)</option>
975                 <!-- /TMPL_IF -->
976                 <!-- TMPL_IF name="periodicity7" -->
977                     <option value="7" selected="selected">1/3 months (1/quarter)</option>
978                 <!-- TMPL_ELSE -->
979                     <option value="7">1/3 months (1/quarter)</option>
980                 <!-- /TMPL_IF -->
981                 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
982                 <!-- TMPL_IF name="periodicity8" -->
983                     <option value="8" selected="selected">1/quarter (seasonal)</option>
984                 <!-- TMPL_ELSE -->
985                     <option value="8">1/quarter (seasonal)</option>
986                 <!-- /TMPL_IF -->
987
988                 <!-- TMPL_IF name="periodicity9" -->
989                     <option value="9" selected="selected">2/years</option>
990                 <!-- TMPL_ELSE -->
991                     <option value="9">2/year</option>
992                 <!-- /TMPL_IF -->
993                 <!-- TMPL_IF name="periodicity10" -->
994                     <option value="10" selected="selected">1/year</option>
995                 <!-- TMPL_ELSE -->
996                     <option value="10">1/year</option>
997                 <!-- /TMPL_IF -->
998                 <!-- TMPL_IF name="periodicity11" -->
999                     <option value="11" selected="selected">1/2 years</option>
1000                 <!-- TMPL_ELSE -->
1001                     <option value="11">1/2 years</option>
1002                 <!-- /TMPL_IF -->
1003                 </select>
1004                 Manual History :<input type="checkbox" name="manualhist" value="1" />
1005             </td>
1006         </tr>
1007         <tr>
1008             <td>Numbering Pattern:</td>
1009             <td>
1010                 <select name="numbering_pattern" size="1" id="numberpattern" onchange="num_pattern()">
1011                     <option value="" selected="selected">-- please choose --</option>
1012                     <!-- TMPL_IF name="numberpattern1" -->
1013                         <option value="1" selected="selected">Number</option>
1014                     <!-- TMPL_ELSE -->
1015                         <option value="1">Number</option>
1016                     <!-- /TMPL_IF -->
1017                     <!-- TMPL_IF name="numberpattern2" -->
1018                         <option value="2" selected="selected">Volume, Number, Issue</option>
1019                     <!-- TMPL_ELSE -->
1020                         <option value="2">Volume, Number, Issue</option>
1021                     <!-- /TMPL_IF -->
1022                     <!-- TMPL_IF name="numberpattern3" -->
1023                         <option value="3" selected="selected">Volume, Number</option>
1024                     <!-- TMPL_ELSE -->
1025                         <option value="3">Volume, Number</option>
1026                     <!-- /TMPL_IF -->
1027                     <!-- TMPL_IF name="numberpattern4" -->
1028                         <option value="4" selected="selected">Volume, Issue</option>
1029                     <!-- TMPL_ELSE -->
1030                         <option value="4">Volume, Issue</option>
1031                     <!-- /TMPL_IF -->
1032                     <!-- TMPL_IF name="numberpattern5" -->
1033                         <option value="5" selected="selected">Number, Issue</option>
1034                     <!-- TMPL_ELSE -->
1035                         <option value="5">Number, Issue</option>
1036                     <!-- /TMPL_IF -->
1037                     <!-- TMPL_IF name="numberpattern6" -->
1038                         <option value="6" selected="selected">Seasonal only</option>
1039                     <!-- TMPL_ELSE -->
1040                         <option value="6">Seasonal only</option>
1041                     <!-- /TMPL_IF -->
1042                     <!-- TMPL_IF name="numberpattern8" -->
1043                         <option value="8" selected="selected">Year/Number</option>
1044                     <!-- TMPL_ELSE -->
1045                         <option value="8">Year/Number</option>
1046                     <!-- /TMPL_IF -->          
1047                     <!-- TMPL_IF name="numberpattern7" -->
1048                         <option value="7" selected="selected">None of the above</option>
1049                     <!-- TMPL_ELSE -->
1050                         <option value="7">None of the above</option>
1051                     <!-- /TMPL_IF -->
1052                 </select>
1053                 <div id="more_options"></div>
1054                 <div id="irregularity"></div>
1055             </td>
1056         </tr>
1057         <tr>
1058             <td>Begins On: (*)</td>
1059             <td>
1060                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt=""  />
1061                 <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" />
1062                 <!-- both scripts for calendar must follow the input field --> 
1063                 <script type="text/javascript">
1064                     Calendar.setup({
1065                         inputField   : "beginning_date",
1066                         ifFormat     : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1067                         button       : "button1",
1068                         align        : "Tl"
1069                     });
1070                 </script>
1071                 <script type="text/javascript">
1072                     Calendar.setup({
1073                         inputField   : "beginning_date",
1074                         ifFormat     : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1075                         button       : "beginning_date",
1076                         align        : "Tl"
1077                     });
1078                 </script>
1079             </td>
1080         </tr>
1081         <tr>
1082             <td>Subscription length</td>
1083             <td>
1084                 <select name="subtype">
1085                     <!-- TMPL_LOOP NAME="subtype" -->
1086                         <!-- TMPL_IF NAME="selected" -->
1087                         <option value="<!-- TMPL_VAR NAME="name" -->" selected="selected">
1088                         <!-- TMPL_ELSE -->
1089                         <option value="<!-- TMPL_VAR NAME="name" -->">
1090                         <!-- /TMPL_IF -->
1091                         <!-- TMPL_VAR NAME="name" -->
1092                         </option>
1093                     <!-- /TMPL_LOOP -->
1094                 </select>
1095                 <input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (*) (enter amount in numerals)
1096             </td>
1097         </tr>
1098     <tr>
1099         <td>Numbering calculation</td>
1100         <td>Numbering formula: <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" /></td>
1101     </tr>
1102     <tr>
1103     <td colspan="3">
1104         <div id="basetable" style="display: none;">
1105             <table class="small">
1106                 <tr>
1107                     <th>&nbsp;</th>
1108                     <th>X</th>
1109                     <th>Y</th>
1110                     <th>Z</th>
1111                 </tr>
1112                 <tr>
1113                     <td>Add</td>
1114                     <td>
1115                         <input type="text" name="add1" value="<!-- TMPL_VAR name="add1" -->" />
1116                     </td>
1117                     <td>
1118                         <input type="text" name="add2" value="<!-- TMPL_VAR name="add2" -->" />
1119                     </td>
1120                     <td>
1121                         <input type="text" name="add3" value="<!-- TMPL_VAR name="add3" -->" />
1122                     </td>
1123                 </tr>
1124                 <tr>
1125                     <td>once every</td>
1126                     <td><input type="text" name="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
1127                     <td><input type="text" name="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
1128                     <td><input type="text" name="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
1129                 </tr>
1130                 <tr>
1131                     <td>When more than</td>
1132                     <td><input type="text" name="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
1133                     <td><input type="text" name="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
1134                     <td><input type="text" name="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
1135                 </tr>
1136                 <tr>
1137                     <td>inner counter</td>
1138                     <td><input type="text" name="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
1139                     <td><input type="text" name="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
1140                     <td><input type="text" name="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
1141                 </tr>
1142                 <tr>
1143                     <td>Set back to</td>
1144                     <td><input type="text" name="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
1145                     <td><input type="text" name="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
1146                     <td><input type="text" name="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
1147                 </tr>
1148                 <tr>
1149                     <td>
1150                         <!-- TMPL_IF name="mod" -->
1151                             Last value
1152                         <!-- TMPL_ELSE -->
1153                             Begins with
1154                         <!-- /TMPL_IF -->
1155                     </td>
1156                     <td><input type="text" name="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
1157                     <td><input type="text" name="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
1158                     <td><input type="text" name="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
1159                 </tr>
1160             </table>
1161         </div>
1162         </td></tr>
1163     </table>
1164 </div>
1165 <!--TMPL_IF Name="history"-->
1166 <div id="subscription_form_history">
1167     <h2>History</h2>
1168     <table>
1169         <tr>
1170           <td>Starting date:</td>
1171           <td><input type="text" name="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /> (the date of the 1st subscription)</td>
1172         </tr>
1173         <tr>
1174           <td>Ending date:</td>
1175           <td><input type="text" name="enddate" value="<!-- TMPL_VAR name="enddate" -->" />(if empty : subscription still active)</td>
1176         </tr>
1177         <tr>
1178             <td>Recieved issues</td>
1179             <td><textarea name="recievedlist" cols="60" rows="5"><!-- TMPL_VAR name="recievedlist" --></textarea></td>
1180         </tr>
1181         <tr>
1182             <td>Missing issues</td>
1183             <td><textarea name="missinglist" cols="60" rows="5"><!-- TMPL_VAR name="missinglist" --></textarea></td>
1184         </tr>
1185         <tr>
1186             <td>Opac's notes</td>
1187             <td><textarea name="opacnote" cols="60" rows="5"><!-- TMPL_VAR name="opacnote" --></textarea></td>
1188         </tr>
1189         <tr>
1190             <td>Librarian notes</td>
1191             <td><textarea name="librariannote" cols="60" rows="5"><!-- TMPL_VAR name="librariannote" --></textarea></td>
1192         </tr>
1193     </table>
1194 </div>
1195 <!--/TMPL_IF-->
1196 <!-- TMPL_IF name="mod" -->
1197     <input type="button" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1198 <!-- TMPL_ELSE -->
1199     <input type="button" value="Add subscription" onclick="Check(this.form)" accesskey="w" />
1200 <!-- /TMPL_IF -->
1201 </form>
1202
1203 </div>
1204 </div>
1205
1206 <div class="yui-b">
1207 <!-- TMPL_INCLUDE NAME="serials-menu.inc" -->
1208 </div>
1209 </div>
1210 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->