1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha › Serials › <!-- TMPL_IF name="mod" --> Modify subscription to <!-- TMPL_VAR name="bibliotitle" --><!-- TMPL_ELSE -->New subscription<!-- /TMPL_IF --></title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
6 <script type="text/javascript">
9 // the english words used in display purposes
10 var text = new Array(_('Number'),_('Volume'),_('Issue'),_('Month'),_('Week'),_('Starting with:'),_('Rollover at:'),_('Choose Hemisphere:'),_('Northern'),_('Southern'),
11 _('Autumn'),_('Winter'),_('Spring'),_('Summer'),_('Fall'),_('Season'),_('Year'));
13 var is_hemisphere = 1;
15 function YMDaToYWDa(S) {
16 with (new Date(Date.UTC(S[0], S[1] - 1, S[2]))) {
17 var DoW = getUTCDay();
18 setUTCDate(getUTCDate() - (DoW + 6) % 7 + 3);
21 var WN = Math.round((ms - valueOf()) / 604800000) + 1;
22 return [getUTCFullYear(), WN, DoW == 0 ? 7 : DoW];
25 function dayofyear(d) { // d is a Date object
26 var yn = d.getFullYear();
27 var mn = d.getMonth();
29 var d1 = new Date(yn,0,1,12,0,0); // noon on Jan. 1
30 var d2 = new Date(yn,mn,dn,12,0,0); // noon on input date
31 var ddiff = Math.round((d2-d1)/864e5);
36 // common pre defined number patterns
37 function num_pattern() {
38 var patternchoice = document.getElementById("numberpattern").value;
39 switch(patternchoice){
41 document.f.add1.value=1;
42 document.f.add2.value=1;
43 document.f.add3.value=1;
44 document.f.every1.value=12;
45 document.f.every2.value=1;
46 document.f.every3.value=1;
47 document.f.whenmorethan1.value=9999999;
48 document.f.whenmorethan2.value=12;
49 document.f.whenmorethan3.value=4;
50 document.f.setto1.value=0;
51 document.f.setto2.value=1;
52 document.f.setto3.value=1;
53 /* document.f.lastvalue1.value=1;
54 document.f.lastvalue2.value=1;
55 document.f.lastvalue3.value=1;*/
56 document.f.numberingmethod.value=_('Vol {X}, No {Y}, Issue {Z}');
57 moreoptions(text[1],text[0],text[2]);
58 display_table(0); // toggle info box on (1) or off (0)
61 document.f.add1.value=1;
62 document.f.add2.value=1;
63 document.f.add3.value='';
64 document.f.every1.value=12;
65 document.f.every2.value=1;
66 document.f.every3.value='';
67 document.f.whenmorethan1.value=9999999;
68 document.f.whenmorethan2.value=12;
69 document.f.whenmorethan3.value='';
70 document.f.setto1.value=0;
71 document.f.setto2.value=1;
72 document.f.setto3.value='';
73 /* document.f.lastvalue1.value=1;
74 document.f.lastvalue2.value=1;
75 document.f.lastvalue3.value='';*/
76 document.f.numberingmethod.value=_('Vol {X}, No {Y}');
77 moreoptions(text[1],text[0]);
81 document.f.add1.value=1;
82 document.f.add2.value=1;
83 document.f.add3.value='';
84 document.f.every1.value=12;
85 document.f.every2.value=1;
86 document.f.every3.value='';
87 document.f.whenmorethan1.value=9999999;
88 document.f.whenmorethan2.value=12;
89 document.f.whenmorethan3.value='';
90 document.f.setto1.value=0;
91 document.f.setto2.value=1;
92 document.f.setto3.value='';
93 document.f.numberingmethod.value=_('Vol {X}, Issue {Y}');
94 moreoptions(text[1],text[2]);
98 var d = new Date(document.f.firstacquidate.value);
99 var smonth = d.getMonth();
100 document.f.add1.value=1;
101 document.f.add2.value=1;
102 document.f.add3.value='';
103 document.f.every1.value=12;
104 document.f.every2.value=1;
105 document.f.every3.value='';
106 document.f.whenmorethan1.value=9999999;
107 document.f.whenmorethan2.value=12;
108 document.f.whenmorethan3.value='';
109 document.f.setto1.value=0;
110 document.f.setto2.value=1;
111 document.f.setto3.value='';
112 document.f.numberingmethod.value=_('No {X}, Issue {Y}');
113 moreoptions(text[0],text[2]);
117 var d = new Date(document.f.firstacquidate.value);
118 var sYear = d.getFullYear();
119 moreoptions_seasons(text[15],sYear);
120 var d = new Date(document.f.firstacquidate.value);
121 var sYear = d.getFullYear();
122 document.f.add1.value=1;
123 document.f.add2.value='1';
124 document.f.add3.value='';
125 document.f.every1.value=4;
126 document.f.every2.value='1';
127 document.f.every3.value='';
128 document.f.whenmorethan1.value=9999999;
129 document.f.whenmorethan2.value='4';
130 document.f.whenmorethan3.value='';
131 document.f.setto1.value=0;
132 document.f.setto2.value='1';
133 document.f.setto3.value='';
134 document.f.lastvaluetemp1.value=sYear;
135 document.f.periodicity.value='8';
136 document.f.numberingmethod.value=_('{Y} {X}');
137 moreoptions_seasons(text[15],sYear);
143 document.getElementById("more_options").innerHTML = '';
144 document.f.irreg_check.value=1;
147 var d = new Date(document.f.startdate.value);
148 var sYear = d.getFullYear();
149 document.f.add1.value=1;
150 document.f.add2.value=1;
151 document.f.add3.value='';
152 document.f.every1.value=12;
153 document.f.every2.value=1;
154 document.f.every3.value='';
155 document.f.whenmorethan1.value=9999999;
156 document.f.whenmorethan2.value=12;
157 document.f.whenmorethan3.value='';
158 document.f.setto1.value=0;
159 document.f.setto2.value=1;
160 document.f.setto3.value='';
161 // document.f.setto3.value='';
162 if (document.f.lastvalue1.value==0){document.f.lastvalue1.value=sYear};
163 if (document.f.lastvalue2.value==0 ||document.f.lastvalue2.value=='' ){
164 switch (document.f.periodicity.value){
166 var doy = dayofyear(d);
167 //var Weeknumber=YWDA[1];
168 document.f.lastvalue2.value=doy;
171 var doy = dayofyear(d);
172 //var Weeknumber=YWDA[1];
173 document.f.lastvalue2.value=doy*2;
176 var doy = dayofyear(d);
177 //var Weeknumber=YWDA[1];
178 document.f.lastvalue2.value=doy/3;
183 var YWDa = YMDaToYWDa(d);
184 //var Weeknumber=YWDA[1];
185 document.f.lastvalue2.value=YWDA[1]/(document.f.periodicity.value-1);
188 var smonth = d.getMonth();
189 document.f.lastvalue2.value=smonth;
192 var smonth = d.getMonth();
193 document.f.lastvalue2.value=smonth/2;
197 var smonth = d.getMonth();
198 document.f.lastvalue2.value=smonth/3;
201 var smonth = d.getMonth();
202 document.f.lastvalue2.value=smonth/6;
207 // document.f.lastvalue2.value=document.f.lastvaluetemp2.value;
208 document.f.lastvalue3.value='';
209 document.f.numberingmethod.value=_('{X}/{Y}');
210 moreoptions(text[16],text[0]);
214 document.f.add1.value=1;
215 document.f.add2.value='';
216 document.f.add3.value='';
217 document.f.every1.value=1;
218 document.f.every2.value='';
219 document.f.every3.value='';
220 document.f.whenmorethan1.value=9999999;
221 document.f.whenmorethan2.value='';
222 document.f.whenmorethan3.value='';
223 document.f.setto1.value=0;
224 document.f.setto2.value='';
225 document.f.setto3.value='';
226 /* document.f.lastvalue1.value=1;
227 document.f.lastvalue2.value='';
228 document.f.lastvalue3.value='';*/
229 document.f.numberingmethod.value='{X}';
230 moreoptions_daily_check(text[0]);
231 document.f.irreg_check.value=1;
237 function display_table(n) {
239 document.getElementById("basetable").style.display = 'block';
241 document.getElementById("basetable").style.display = 'none';
245 function modify_num_pattern() {
246 if(!document.getElementById("numberpattern")){ return false; }
247 document.getElementById("numberpattern").value = '<!-- TMPL_VAR NAME="numberpattern" -->';
250 document.f.add1.value='<!-- TMPL_VAR NAME="add1" -->';
251 document.f.add2.value='<!-- TMPL_VAR NAME="add2" -->';
252 document.f.add3.value='<!-- TMPL_VAR NAME="add3" -->';
253 document.f.every1.value='<!-- TMPL_VAR NAME="every1" -->';
254 document.f.every2.value='<!-- TMPL_VAR NAME="every2" -->';
255 document.f.every3.value='<!-- TMPL_VAR NAME="every3" -->';
256 document.f.whenmorethan1.value='<!-- TMPL_VAR NAME="whenmorethan1" -->';
257 document.f.whenmorethan2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
258 document.f.whenmorethan3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
259 document.f.setto1.value='<!-- TMPL_VAR NAME="setto1" -->';
260 document.f.setto2.value='<!-- TMPL_VAR NAME="setto2" -->';
261 document.f.setto3.value='<!-- TMPL_VAR NAME="setto3" -->';
262 document.f.lastvalue1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
263 document.f.lastvalue2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
264 document.f.lastvalue3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
265 document.f.numberingmethod.value='<!-- TMPL_VAR NAME="numberingmethod" -->';
269 <!-- TMPL_IF NAME="add2" -->
270 if(<!-- TMPL_VAR NAME="add2" --> > 0){
274 <!-- TMPL_IF NAME="add3" -->
275 if(<!-- TMPL_VAR NAME="add3" --> > 0){
280 document.f.lastvaluetemp1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
282 document.f.lastvaluetemp2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
283 document.f.whenmorethantemp2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
286 document.f.lastvaluetemp3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
287 document.f.whenmorethantemp3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
291 // a pre check with more options to see if 'number' and '1/day' are chosen
292 function moreoptions_daily_check(x) {
293 var periodicity = document.f.periodicity.value;
295 if(periodicity == 1){
296 document.getElementById("irregularity").innerHTML = '';
297 var daynames = new Array(_('Monday'),_('Tuesday'),_('Wednesday'),_('Thursday'),_('Friday'),_('Saturday'),_('Sunday'));
298 errortext =_("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
299 for(var j=0;j<daynames.length;j++){
300 errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+daynames[j]+" ";
302 var error = errortext;
304 document.getElementById("irregularity").innerHTML = error;
306 document.getElementById("irregularity").innerHTML = '';
307 document.getElementById("more_options").innerHTML = '';
312 // to dispaly the more options section
313 function moreoptions(x,y,z){
314 document.getElementById("irregularity").innerHTML = '';
315 document.getElementById("more_options").innerHTML = '';
317 // alert("X: "+x+"Y: "+y+"Z: "+z);
319 textbox +="<table>\n<tr><th> <\/th><th>"+x+"<\/th>";
321 textbox +="<th>"+y+"<\/th>";
323 textbox +="<th>"+z+"<\/th>";
326 textbox +="<\/tr>\n";
327 textbox +="<tr><th scope=\"row\">"+text[5]+"<\/td><td><input type='text' name='lastvaluetemp1' size='4' onkeyup='moreoptionsupdate(\"lastvalue1\")' value=\"" + document.f.lastvalue1.value + "\" /><\/td>\n";
329 textbox +="<td><input type='text' name='lastvaluetemp2' size='4' onkeyup='moreoptionsupdate(\"lastvalue2\")' value=\"" + document.f.lastvalue2.value + "\" /><\/td>\n";
331 textbox +="<td><input type='text' name='lastvaluetemp3' size='4' onkeyup='moreoptionsupdate(\"lastvalue3\")' value=\"" + document.f.lastvalue3.value + "\" /><\/td>\n";
334 textbox +="<\/tr>\n";
336 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
337 textbox +="<td><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"<\/a><\/td>\n";
338 textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
340 textbox +="<td><input type='text' name='whenmorethantemp3' size='4' onkeyup='moreoptionsupdate(\"whenmorethan3\",1)'><\/td>\n";
344 textbox +="<tr> <td>"+_('issues expected')+"</td><td><input type='text' name='issuesexpectedtemp1' size='4' onkeyup='moreoptionsupdate(\"issuesexpected1\",0)' value=\"" + document.f.issuesexpected1.value + "\" ><br/><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"</a></td></tr>";
346 textbox +="<\/table>\n";
348 document.getElementById("more_options").innerHTML = textbox;
351 function hemispheres(chosen){
352 var selbox = document.getElementById("season1");
354 var selboxselected = selbox.options[selbox.selectedIndex].value;
355 selbox.options.length = 0;
358 selbox.options[selbox.options.length] = new Option(text[11],'1');
359 selbox.options[selbox.options.length] = new Option(text[12],'2');
360 selbox.options[selbox.options.length] = new Option(text[13],'3');
361 selbox.options[selbox.options.length] = new Option(text[14],'4');
363 selbox.options[selboxselected-1].selected = true;
367 selbox.options[selbox.options.length] = new Option(text[13],'1');
368 selbox.options[selbox.options.length] = new Option(text[10],'2');
369 selbox.options[selbox.options.length] = new Option(text[11],'3');
370 selbox.options[selbox.options.length] = new Option(text[12],'4');
372 selbox.options[selboxselected-1].selected = true;
377 // to dispaly the more options section for seasons
378 function moreoptions_seasons(x,y){
379 document.getElementById("irregularity").innerHTML = '';
380 document.getElementById("more_options").innerHTML = '';
382 //alert("X: "+x+"Year: "+y);
384 var hemi_select = parseInt('<!-- TMPL_VAR NAME="hemisphere" -->');
385 textbox +="<li><label for=\"hemisphere\">"+ text[7] +"<\/label><select name='hemisphere' id=\"hemisphere\" onchange='hemispheres(this.options[this.selectedIndex].value)'>";
386 for(var i = 1; i <= 2; i++){
387 textbox +="<option value='"+i+"'";
388 if(i == hemi_select){
389 textbox += " selected "
391 textbox +=">"+text[i+7]+"<\/option>";
393 textbox +="<\/li>\n";
394 textbox +="<table><tr><th> <\/th><th>"+x+"<\/th>";
395 textbox +="<th>"+text[16]+"<\/th>";
396 textbox +="<\/tr>\n";
397 textbox +="<tr><th scope=\"row\">"+text[5]+"<\/th><td><select name='lastvaluetemp2' id='season1' onchange='moreoptionsupdate(\"lastvalue2\")'>";
398 for(var j = 1; j <= 4; j++){
399 textbox +="<option value='"+j+"'>"+text[j+10]+"<\/option>";
401 textbox +="<\/select><\/td><td><select name='lastvaluetemp1' onchange='moreoptionsupdate(\"lastvalue1\")'>";
402 for(var k = parseInt(y); k <= parseInt(y)+15; k++){
403 textbox +="<option value='"+k+"'>"+k+"<\/option>";
405 textbox +="<\/select><\/td><\/tr>\n";
406 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
407 textbox +="<td><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"<\/a><\/td>\n";
408 textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
409 textbox +="<\/tr><\/table>\n";
412 document.getElementById("more_options").innerHTML = textbox;
415 function irregularity_check(){
416 document.f.irreg_check.value = 1; // Irregularity button now pushed
417 var periodicity = document.f.periodicity.value;
418 var rollover = document.f.issuesexpected1.value;
419 if(document.f.whenmorethantemp2){
420 rollover = document.f.whenmorethantemp2.value;
422 if(document.f.whenmorethantemp3){
423 rollover = document.f.whenmorethantemp3.value;
428 var errortext = _("<b>Warning irregularity detected<\/b><br \/>");
431 if(rollover < 730) expected =730;
438 if(rollover < 365) expected =365;
445 if(rollover < 156) expected =156;
452 if(rollover < 52) expected =52;
459 if(rollover < 26) expected =26;
466 if(rollover < 17) expected =17;
473 if(rollover < 12) expected =12;
480 if(rollover < 6) expected =6;
487 if(rollover < 4) expected =4;
494 if(rollover < 4) expected =4;
501 if(rollover < 2) expected =2;
508 if(rollover < 1) expected =1;
518 if(expected == 365 || expected==730){
519 var daynames = new Array(_('Monday'),_('Tuesday'),_('Wednesday'),_('Thursday'),_('Friday'),_('Saturday'),_('Sunday'));
520 errortext += _("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
521 for(var j=0;j<daynames.length;j++){
522 errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+daynames[j]+" ";
526 errortext +=expected+_(" issues expected, ")+rollover+_(" were entered. <br \/>Please indicate which date(s) an issue is not expected<br \/>");
528 for(var i=rollover;i<expected;i++){
529 errortext +="<select name='irregular' id='irregular"+count+"' onchange='display_example(expected)'>\n";
530 errortext +=irregular_options(periodicity);
531 errortext +="<\/select>\n";
538 errortext +=expectedover+_(" issues expected, ")+rollover+_(" were entered.<br \/> You seem to have indicated more issues per year than expected.");
541 if(error.length ==0){
542 error=_('No irregularities noticed');
544 display_example(expected);
545 document.getElementById("irregularity").innerHTML = error;
548 function irregular_options(periodicity){
551 <!-- TMPL_IF NAME="weekarrayjs" -->
552 var weeks = new Array(<!-- TMPL_VAR NAME="weekarrayjs" -->);
554 var months = new Array(_('January'),_('February'),_('March'),_('April'),_('May'),_('June'),_('July'),_('August'),_('September'),_('October'),_('November'),_('December'));
555 var seasons = new Array(_('Autumn'),_('Winter'),_('Spring'),_('Summer'),_('Fall'));
557 if(periodicity == 1) {
562 if(periodicity == 2 || periodicity == 3 || periodicity == 4) {
564 <!-- TMPL_IF NAME="weekarrayjs" -->
566 count = <!-- TMPL_VAR NAME="weekno" -->;
572 if(periodicity == 5 || periodicity == 6 || periodicity == 7 || periodicity == 8 || periodicity == 9) {
573 if(periodicity == 8) {
574 is_season = 1; // setting up from edit page
579 if(is_hemisphere == 2){
590 for(var j=1;j<=expected;j++){
593 count = count-expected;
595 if(is_season && is_hemisphere == 1){
596 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j]+"<\/option>\n";
597 // alert("value: "+((count*3)-2)+" title: "+titles[j]);
598 } else if(is_season && is_hemisphere == 2){
599 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j-1]+"<\/option>\n";
600 // alert("value: "+((count*3)-2)+" title: "+titles[j-1]);
602 errortext +="<option value='"+count+"'>"+titles[j-1]+"<\/option>\n";
606 errortext +="<option value='"+j+"'>"+titles+" "+j+"<\/option>\n";
612 function irregular_order(){
613 var irregular = '<!-- TMPL_VAR NAME="irregularity" -->';
614 var periodicity = document.f.periodicity.value;
615 var irregarray = irregular.split(',');
617 for(j=0;j<irregarray.length;j++){
618 document.getElementById("irregular"+irregarray[j]).checked = true;
621 for(i=0;i<irregarray.length;i++){
622 document.getElementById("irregular"+i).value = irregarray[i];
627 function display_example(expected){
628 var startfrom1 = parseInt(document.f.lastvalue1.value);
629 var startfrom2 = parseInt(document.f.lastvalue2.value);
630 var startfrom3 = parseInt(document.f.lastvalue3.value);
631 var every1 = parseInt(document.f.every1.value);
632 var every2 = parseInt(document.f.every2.value);
633 var every3 = parseInt(document.f.every3.value);
634 var numberpattern = document.f.numberingmethod.value;
635 var whenmorethan2 = parseInt(document.f.whenmorethan2.value);
636 var whenmorethan3 = parseInt(document.f.whenmorethan3.value);
637 var setto2 = parseInt(document.f.setto2.value);
638 var setto3 = parseInt(document.f.setto3.value);
639 var displaytext = _('Based on the information<br \/>entered the Numbering Pattern<br \/>will look like this<br \/>\n');
641 var count=startfrom3-1;
642 var count2=startfrom2;
643 for(var i=0;i<12;i++){
644 if(count>=whenmorethan3){
646 if(count2>=whenmorethan2){
655 displaytext += numberpattern.replace(/{Z}/,count)+'\n';
656 displaytext = displaytext.replace(/{Y}/,count2)+'<br \/>\n';
657 displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
661 if(startfrom2>0 && !startfrom3){
662 var count=startfrom2-1;
663 for(var i=0;i<12;i++){
664 if(count>=whenmorethan2){
672 if(is_hemisphere == 2){
674 displaytext += numberpattern.replace(/{Y}/,text[count+12])+'\n';
676 displaytext += numberpattern.replace(/{Y}/,text[count+8])+'\n';
679 displaytext += numberpattern.replace(/{Y}/,text[count+10])+'\n';
682 displaytext += numberpattern.replace(/{Y}/,count)+'\n';
684 displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
687 if(startfrom1>0 && !startfrom2 && !startfrom3){
688 var offset=eval(document.f.issuesexpected1.value);
692 for(var i=startfrom1;i<(startfrom1+offset);i+=every1){
693 displaytext += numberpattern.replace(/{X}/,i)+'<br \/>\n';
696 displaytext = "<div style='padding: 5px; background-color: #CCCCCC'>"+displaytext+"<\/div>";
697 document.getElementById("displayexample").innerHTML = displaytext;
700 function isArray(obj) {
701 if (obj.constructor.toString().indexOf("Array") == -1)
707 function moreoptionsupdate(fieldnames,rollover){
708 fieldname = fieldnames;
709 fld = fieldname.length;
711 fieldnametempnumber = fieldname.substr(fld);
712 //alert(fieldnametempnumber);
713 fieldnametemp = fieldname.slice(0,-1)+"temp"+fieldnametempnumber;
714 // alert(fieldnametemp);
715 eval("document.f."+fieldname+".value = document.f."+fieldnametemp+".value");
716 // alert (fieldname+" : "+eval("document.f."+fieldname+".value") +' '+fieldnametemp+' : ' +eval("document.f."+fieldnametemp+".value"));
717 var patternchoice = document.getElementById("numberpattern").value;
718 switch(patternchoice){
723 if (document.f.lastvaluetemp2.value>0){document.f.innerloop1.value = document.f.lastvaluetemp2.value - 1;}
727 eval("document.f.every"+(fieldnametempnumber-1)+".value = document.f."+fieldnametemp+".value");
732 function check_input(e){
733 var unicode=e.charCode? e.charCode : e.keyCode
734 if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
735 if (unicode<48||unicode>57) { // if not a number
736 alert(_("Needs to be entered in digit form -eg 10"));
737 return false // disable key press
742 function addbiblioPopup(biblionumber) {
743 var destination = "/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup";
744 if(biblionumber){ destination += "&biblionumber="+biblionumber; }
745 window.open(destination,'AddBiblioPopup','width=1024,height=768,toolbar=no,scrollbars=yes');
750 window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
753 function FindAcqui(f)
755 window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
758 function Find_ISSN(f)
760 window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
765 if (f.aqbooksellerid.value.length==0) {
766 alert(_('You must choose a supplier'));
767 } else if (f.biblionumber.value.length==0) {
768 alert(_('You must choose or create a biblio'));
769 } else if(f.startdate.value.length != 0 && f.sublength.value > 0) {
770 if (f.irreg_check.value == 1) {
773 if(f.numbering_pattern.value == ''){
774 alert(_("Please choose a numbering pattern"));
776 alert(_("Please check for irregularity by clicking 'Irregularity?'"));
780 alert(_('You must choose a start date and a subscription length'));
784 <!-- TMPL_IF name="mod" -->
785 window.onload = modify_num_pattern();
786 <!-- TMPL_IF name="hemisphere" -->
787 window.onload = hemispheres(<!-- TMPL_VAR NAME="hemisphere" -->);
790 <!-- TMPL_IF name="irregularity" -->
791 window.onload = irregularity_check();
792 window.onload = irregular_order();
798 <!-- TMPL_INCLUDE NAME="header.inc" -->
799 <!-- TMPL_INCLUDE NAME="serials-search.inc" -->
801 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › <!-- TMPL_IF name="mod" --> Modify subscription for <span class="title"><!-- TMPL_VAR name="bibliotitle" --></span><!-- TMPL_ELSE -->New subscription<!-- /TMPL_IF --></div>
803 <div id="doc3" class="yui-t7">
807 <h1><!-- TMPL_IF name="mod" --> Modify subscription for <i><!-- TMPL_VAR name="bibliotitle" --></i><!-- TMPL_ELSE -->Add a new subscription<!-- /TMPL_IF --></h1>
808 <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
809 <!-- TMPL_IF name="mod" -->
810 <input type="hidden" name="op" value="modsubscription" />
811 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
813 <input type="hidden" name="op" value="addsubscription" />
815 <input type="hidden" name="user" value="<!-- TMPL_VAR name="loggedinusername" -->" />
816 <input type="hidden" name="irreg_check" value="0" />
817 <input type="hidden" name="issuesexpected1" value="0" />
819 <div class="yui-u first">
820 <fieldset id="subscription_add_information" class="rows">
821 <legend>Subscription details</legend>
823 <li><span class="label">Subscription #</span> <!--TMPL_VAR name="subscriptionid"--></li>
825 <span class="label">Librarian: </span> <!-- TMPL_VAR name="loggedinusername" -->
828 <label for="aqbooksellerid">Vendor: </label>
829 <input type="text" name="aqbooksellerid" id="aqbooksellerid" value="<!-- TMPL_VAR name="aqbooksellerid" -->" size="8" /> (<input type="text" name="aqbooksellername" value="<!-- TMPL_VAR name="aqbooksellername" -->" disabled="disabled" readonly="readonly" />) <div class="inputnote"><a href="#" onclick="FindAcqui(f)">Search for a vendor</a></div>
832 <label for="biblionumber">Biblio: (*)</label>
834 <input type="text" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR name="bibnum" -->" size="8" />
835 (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled="disabled" readonly="readonly" />)
836 <div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a> | <!--TMPL_IF Name="mod"--><a href="#" onclick="addbiblioPopup(<!-- TMPL_VAR NAME="bibnum" -->); return false;">Edit biblio</a><!-- TMPL_ELSE -->
837 <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a><!--/TMPL_IF--></div>
841 <label for="callnumber">Call Number</label>
842 <input type="text" name="callnumber" id="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" />
845 <label for="branchcode">Library</label>
847 <select name="branchcode" id="branchcode">
848 <!-- TMPL_UNLESS NAME="Independantbranches" --><option value="">Any branch</option><!-- /TMPL_UNLESS -->
849 <!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
851 <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
854 </select> (select a library)
858 <label for="notes">Public note</label>
859 <textarea name="notes" id="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea>
862 <label for="internalnotes">Nonpublic note</label>
863 <textarea name="internalnotes" id="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea>
866 <label for="letter">Patron notification </label>
868 <!-- TMPL_IF NAME="letterloop" -->
869 <select name="letter" id="letter">
870 <option value="">none</option>
871 <!-- TMPL_LOOP name="letterloop" -->
872 <!-- TMPL_IF name="selected" -->
873 <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
875 <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
879 <div class="inputnote">Select a notice and patrons on the routing list will be notified when new issues are received.</div>
881 <div class="inputnote">To notify patrons of new serial issues, you must <a href="/cgi-bin/koha/tools/letter.pl">define a notice</a>.</div>
886 <div class="warning"><b>Note:</b>
889 <li>The subscription <b>must</b> be associated with a bibliographic record.</li>
890 <li>You <b>must</b> select a vendor if you wish to generate claims.</li>
898 <div id="subscription_form_planning">
899 <fieldset class="rows">
900 <legend>Serials planning</legend>
903 <label for="firstacquidate"> First issue publication date:</label>
905 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button2" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
906 <input type="text" name="firstacquidate" value="<!-- TMPL_VAR name="firstacquidate" -->" size="13" maxlength="10" id="acqui_date" style="border-width: 0px;" />
907 <!-- both scripts for calendar must follow the input field -->
908 <script type="text/javascript">
910 inputField:"acqui_date",
911 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
916 <script type="text/javascript">
918 inputField : "acqui_date",
919 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
920 button : "acqui_date",
927 <label for="periodicity">Frequency: (*)</label>
929 <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1);num_pattern;">
930 <option value="" selected="selected">-- please choose --</option>
931 <!-- TMPL_IF name="periodicity16" -->
932 <option value="16" selected="selected">Without periodicity</option>
934 <option value="16">Without periodicity</option>
936 <!-- TMPL_IF name="periodicity48" -->
937 <option value="48" selected="selected">Unknown</option>
939 <option value="48">Unknown</option>
941 <!-- TMPL_IF name="periodicity32" -->
942 <option value="32" selected="selected">Irregular</option>
944 <option value="32">Irregular</option>
947 <!-- TMPL_IF name="periodicity12" -->
948 <option value="12" selected="selected">2/day</option>
950 <option value="12">2/day</option>
952 <!-- TMPL_IF name="periodicity1" -->
953 <option value="1" selected="selected">1/day</option>
955 <option value="1">1/day</option>
957 <!-- TMPL_IF name="periodicity13" -->
958 <option value="13" selected="selected">3/week</option>
960 <option value="13">3/week</option>
962 <!-- TMPL_IF name="periodicity2" -->
963 <option value="2" selected="selected">1/week</option>
965 <option value="2">1/week</option>
967 <!-- TMPL_IF name="periodicity3" -->
968 <option value="3" selected="selected">1/2 weeks </option>
970 <option value="3">1/2 weeks </option>
972 <!-- TMPL_IF name="periodicity4" -->
973 <option value="4" selected="selected">1/3 weeks</option>
975 <option value="4">1/3 weeks</option>
977 <!-- TMPL_IF name="periodicity5" -->
978 <option value="5" selected="selected">1/month</option>
980 <option value="5">1/month</option>
982 <!-- TMPL_IF name="periodicity6" -->
983 <option value="6" selected="selected">1/2 months (6/year)</option>
985 <option value="6">1/2 months (6/year)</option>
987 <!-- TMPL_IF name="periodicity7" -->
988 <option value="7" selected="selected">1/3 months (1/quarter)</option>
990 <option value="7">1/3 months (1/quarter)</option>
992 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
993 <!-- TMPL_IF name="periodicity8" -->
994 <option value="8" selected="selected">1/quarter (seasonal)</option>
996 <option value="8">1/quarter (seasonal)</option>
999 <!-- TMPL_IF name="periodicity9" -->
1000 <option value="9" selected="selected">2/years</option>
1002 <option value="9">2/year</option>
1004 <!-- TMPL_IF name="periodicity10" -->
1005 <option value="10" selected="selected">1/year</option>
1007 <option value="10">1/year</option>
1009 <!-- TMPL_IF name="periodicity11" -->
1010 <option value="11" selected="selected">1/2 years</option>
1012 <option value="11">1/2 years</option>
1015 <li><label for="manuallist"> Manual history:</label> <input type="checkbox" name="manualhist" id="manuallist" value="1" /></li>
1017 <label for="numberpattern"> Numbering pattern:</label>
1019 <select name="numbering_pattern" size="1" id="numberpattern" onchange="num_pattern()">
1020 <option value="" selected="selected">-- please choose --</option>
1021 <!-- TMPL_IF name="numberpattern1" -->
1022 <option value="1" selected="selected">Number</option>
1024 <option value="1">Number</option>
1026 <!-- TMPL_IF name="numberpattern2" -->
1027 <option value="2" selected="selected">Volume, Number, Issue</option>
1029 <option value="2">Volume, Number, Issue</option>
1031 <!-- TMPL_IF name="numberpattern3" -->
1032 <option value="3" selected="selected">Volume, Number</option>
1034 <option value="3">Volume, Number</option>
1036 <!-- TMPL_IF name="numberpattern4" -->
1037 <option value="4" selected="selected">Volume, Issue</option>
1039 <option value="4">Volume, Issue</option>
1041 <!-- TMPL_IF name="numberpattern5" -->
1042 <option value="5" selected="selected">Number, Issue</option>
1044 <option value="5">Number, Issue</option>
1046 <!-- TMPL_IF name="numberpattern6" -->
1047 <option value="6" selected="selected">Seasonal only</option>
1049 <option value="6">Seasonal only</option>
1051 <!-- TMPL_IF name="numberpattern8" -->
1052 <option value="8" selected="selected">Year/Number</option>
1054 <option value="8">Year/Number</option>
1056 <!-- TMPL_IF name="numberpattern7" -->
1057 <option value="7" selected="selected">None of the above</option>
1059 <option value="7">None of the above</option>
1063 <li id="more_options"></li>
1064 <li id="irregularity"></li>
1065 <li id="displayexample"></li>
1067 <label for="startdate"> Subscription start date: (*)</label>
1069 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1070 <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" style="border-width: 0px;" />
1071 <!-- both scripts for calendar must follow the input field -->
1072 <script type="text/javascript">
1074 inputField : "beginning_date",
1075 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1080 <script type="text/javascript">
1082 inputField : "beginning_date",
1083 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1084 button : "beginning_date",
1091 <label for="subtype">Subscription length:</label>
1093 <select name="subtype" id="subtype">
1094 <!-- TMPL_LOOP NAME="subtype" -->
1095 <!-- TMPL_IF NAME="selected" -->
1096 <option value="<!-- TMPL_VAR NAME="name" -->" selected="selected">
1098 <option value="<!-- TMPL_VAR NAME="name" -->">
1100 <!-- TMPL_VAR NAME="name" -->
1104 <input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (*) (enter amount in numerals)
1107 <li><label for="numberingmethod">Numbering formula:</label> <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" />
1110 <div id="basetable" style="display: none;">
1111 <table class="small">
1121 <input type="text" name="add1" value="<!-- TMPL_VAR name="add1" -->" />
1124 <input type="text" name="add2" value="<!-- TMPL_VAR name="add2" -->" />
1127 <input type="text" name="add3" value="<!-- TMPL_VAR name="add3" -->" />
1132 <td><input type="text" name="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
1133 <td><input type="text" name="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
1134 <td><input type="text" name="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
1137 <td>When more than</td>
1138 <td><input type="text" name="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
1139 <td><input type="text" name="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
1140 <td><input type="text" name="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
1143 <td>inner counter</td>
1144 <td><input type="text" name="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
1145 <td><input type="text" name="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
1146 <td><input type="text" name="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
1149 <td>Set back to</td>
1150 <td><input type="text" name="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
1151 <td><input type="text" name="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
1152 <td><input type="text" name="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
1156 <!-- TMPL_IF name="mod" -->
1162 <td><input type="text" name="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
1163 <td><input type="text" name="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
1164 <td><input type="text" name="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
1172 <input type="button" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1178 <!--TMPL_IF Name="history"-->
1179 <div id="subscription_form_history">
1180 <h2>Subscription history</h2>
1183 <td>Subscription start date</td>
1184 <td><input type="text" name="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /> (start date of the 1st subscription)</td>
1187 <td>Subscription end date</td>
1188 <td><input type="text" name="enddate" value="<!-- TMPL_VAR name="enddate" -->" />(if empty, subscription is still active)</td>
1191 <td>Received issues</td>
1192 <td><textarea name="recievedlist" cols="60" rows="5" disabled="true" ><!-- TMPL_VAR name="recievedlist" --></textarea></td>
1195 <td>Missing issues</td>
1196 <td><textarea name="missinglist" cols="60" rows="5" disabled="true"><!-- TMPL_VAR name="missinglist" --></textarea></td>
1204 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->