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