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