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 input_box = confirm(_("If you wish to claim late or missing issues you must link this subscription to a vendor. Click OK to ignore or Cancel to return and enter a vendor"));
767 if (input_box==true) {
773 if (f.biblionumber.value.length==0) {
774 alert(_("You must choose or create a biblio"));
775 } else if(f.startdate.value.length != 0 && f.sublength.value > 0) {
776 if (f.irreg_check.value == 1) {
779 if(f.numbering_pattern.value == ''){
780 alert(_("Please choose a numbering pattern"));
782 alert(_("Please check for irregularity by clicking 'Irregularity?'"));
786 alert(_("You must choose a start date and a subscription length"));
790 <!-- TMPL_IF name="mod" -->
791 window.onload = modify_num_pattern();
792 <!-- TMPL_IF name="hemisphere" -->
793 window.onload = hemispheres(<!-- TMPL_VAR NAME="hemisphere" -->);
796 <!-- TMPL_IF name="irregularity" -->
797 window.onload = irregularity_check();
798 window.onload = irregular_order();
804 <!-- TMPL_INCLUDE NAME="header.inc" -->
805 <!-- TMPL_INCLUDE NAME="serials-search.inc" -->
807 <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>
809 <div id="doc3" class="yui-t7">
813 <h1><!-- TMPL_IF name="mod" --> Modify subscription for <i><!-- TMPL_VAR name="bibliotitle" --></i><!-- TMPL_ELSE -->Add a new subscription<!-- /TMPL_IF --></h1>
814 <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
815 <!-- TMPL_IF name="mod" -->
816 <input type="hidden" name="op" value="modsubscription" />
817 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
819 <input type="hidden" name="op" value="addsubscription" />
821 <input type="hidden" name="user" value="<!-- TMPL_VAR name="loggedinusername" -->" />
822 <input type="hidden" name="irreg_check" value="0" />
823 <input type="hidden" name="issuesexpected1" value="0" />
825 <div class="yui-u first">
826 <fieldset id="subscription_add_information" class="rows">
827 <legend>Subscription details</legend>
829 <li><span class="label">Subscription #</span> <!--TMPL_VAR name="subscriptionid"--></li>
831 <span class="label">Librarian: </span> <!-- TMPL_VAR name="loggedinusername" -->
834 <label for="aqbooksellerid">Vendor: </label>
835 <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>
838 <label for="biblionumber">Biblio: (*)</label>
840 <input type="text" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR name="bibnum" -->" size="8" />
841 (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled="disabled" readonly="readonly" />)
842 <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 -->
843 <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a><!--/TMPL_IF--></div>
847 <!-- TMPL_IF name="serialsadditems" -->
848 <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1" checked="checked" /><label for="serialsadditems-yes">create an item record when receiving this serial</label></p>
849 <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" /><label for="serialsadditems-no">do not create an item record when receiving this serial </label></p>
851 <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1"/><label for="serialsadditems-yes">create an item record when receiving this serial</label></p>
852 <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" checked="checked" /><label for="serialsadditems-no">do not create an item record when receiving this serial</label></p>
856 <label for="callnumber">Call Number</label>
857 <input type="text" name="callnumber" id="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" />
860 <label for="branchcode">Library</label>
862 <select name="branchcode" id="branchcode" style="width: 20em;">
863 <!-- TMPL_UNLESS NAME="Independantbranches" --><option value="">None</option><!-- /TMPL_UNLESS -->
864 <!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
866 <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
869 </select> (select a library)
873 <label for="notes">Public note</label>
874 <textarea name="notes" id="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea>
877 <label for="internalnotes">Nonpublic note</label>
878 <textarea name="internalnotes" id="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea>
881 <label for="letter">Patron notification </label>
883 <!-- TMPL_IF NAME="letterloop" -->
884 <select name="letter" id="letter">
885 <option value="">None</option>
886 <!-- TMPL_LOOP name="letterloop" -->
887 <!-- TMPL_IF name="selected" -->
888 <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
890 <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
894 <div class="inputnote">Select a notice and patrons on the routing list will be notified when new issues are received.</div>
896 <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>
901 <div class="warning"><b>Note:</b>
904 <li>The subscription <b>must</b> be associated with a bibliographic record.</li>
905 <li>You <b>must</b> select a vendor if you wish to generate claims.</li>
913 <div id="subscription_form_planning">
914 <fieldset class="rows">
915 <legend>Serials planning</legend>
918 <label for="firstacquidate"> First issue publication date:</label>
920 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button2" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
921 <input type="text" name="firstacquidate" value="<!-- TMPL_VAR name="firstacquidate" -->" size="13" maxlength="10" id="acqui_date" style="border-width: 0px;" />
922 <!-- both scripts for calendar must follow the input field -->
923 <script type="text/javascript">
925 inputField:"acqui_date",
926 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
931 <script type="text/javascript">
933 inputField : "acqui_date",
934 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
935 button : "acqui_date",
942 <label for="periodicity">Frequency: (*)</label>
944 <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1); num_pattern();">
945 <option value="" selected="selected">-- please choose --</option>
946 <!-- TMPL_IF name="periodicity16" -->
947 <option value="16" selected="selected">Without periodicity</option>
949 <option value="16">Without periodicity</option>
951 <!-- TMPL_IF name="periodicity48" -->
952 <option value="48" selected="selected">Unknown</option>
954 <option value="48">Unknown</option>
956 <!-- TMPL_IF name="periodicity32" -->
957 <option value="32" selected="selected">Irregular</option>
959 <option value="32">Irregular</option>
962 <!-- TMPL_IF name="periodicity12" -->
963 <option value="12" selected="selected">2/day</option>
965 <option value="12">2/day</option>
967 <!-- TMPL_IF name="periodicity1" -->
968 <option value="1" selected="selected">1/day</option>
970 <option value="1">1/day</option>
972 <!-- TMPL_IF name="periodicity13" -->
973 <option value="13" selected="selected">3/week</option>
975 <option value="13">3/week</option>
977 <!-- TMPL_IF name="periodicity2" -->
978 <option value="2" selected="selected">1/week</option>
980 <option value="2">1/week</option>
982 <!-- TMPL_IF name="periodicity3" -->
983 <option value="3" selected="selected">1/2 weeks </option>
985 <option value="3">1/2 weeks </option>
987 <!-- TMPL_IF name="periodicity4" -->
988 <option value="4" selected="selected">1/3 weeks</option>
990 <option value="4">1/3 weeks</option>
992 <!-- TMPL_IF name="periodicity5" -->
993 <option value="5" selected="selected">1/month</option>
995 <option value="5">1/month</option>
997 <!-- TMPL_IF name="periodicity6" -->
998 <option value="6" selected="selected">1/2 months (6/year)</option>
1000 <option value="6">1/2 months (6/year)</option>
1002 <!-- TMPL_IF name="periodicity7" -->
1003 <option value="7" selected="selected">1/3 months (1/quarter)</option>
1005 <option value="7">1/3 months (1/quarter)</option>
1007 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
1008 <!-- TMPL_IF name="periodicity8" -->
1009 <option value="8" selected="selected">1/quarter (seasonal)</option>
1011 <option value="8">1/quarter (seasonal)</option>
1014 <!-- TMPL_IF name="periodicity9" -->
1015 <option value="9" selected="selected">2/years</option>
1017 <option value="9">2/year</option>
1019 <!-- TMPL_IF name="periodicity10" -->
1020 <option value="10" selected="selected">1/year</option>
1022 <option value="10">1/year</option>
1024 <!-- TMPL_IF name="periodicity11" -->
1025 <option value="11" selected="selected">1/2 years</option>
1027 <option value="11">1/2 years</option>
1030 <li><label for="manuallist"> Manual history:</label> <input type="checkbox" name="manualhist" id="manuallist" value="1" /></li>
1032 <label for="numberpattern"> Numbering pattern:</label>
1034 <select name="numbering_pattern" size="1" id="numberpattern" onchange="num_pattern()">
1035 <option value="" selected="selected">-- please choose --</option>
1036 <!-- TMPL_IF name="numberpattern1" -->
1037 <option value="1" selected="selected">Number</option>
1039 <option value="1">Number</option>
1041 <!-- TMPL_IF name="numberpattern2" -->
1042 <option value="2" selected="selected">Volume, Number, Issue</option>
1044 <option value="2">Volume, Number, Issue</option>
1046 <!-- TMPL_IF name="numberpattern3" -->
1047 <option value="3" selected="selected">Volume, Number</option>
1049 <option value="3">Volume, Number</option>
1051 <!-- TMPL_IF name="numberpattern4" -->
1052 <option value="4" selected="selected">Volume, Issue</option>
1054 <option value="4">Volume, Issue</option>
1056 <!-- TMPL_IF name="numberpattern5" -->
1057 <option value="5" selected="selected">Number, Issue</option>
1059 <option value="5">Number, Issue</option>
1061 <!-- TMPL_IF name="numberpattern6" -->
1062 <option value="6" selected="selected">Seasonal only</option>
1064 <option value="6">Seasonal only</option>
1066 <!-- TMPL_IF name="numberpattern8" -->
1067 <option value="8" selected="selected">Year/Number</option>
1069 <option value="8">Year/Number</option>
1071 <!-- TMPL_IF name="numberpattern7" -->
1072 <option value="7" selected="selected">None of the above</option>
1074 <option value="7">None of the above</option>
1078 <li id="more_options"></li>
1079 <li id="irregularity"></li>
1080 <li id="displayexample"></li>
1082 <label for="startdate"> Subscription start date: (*)</label>
1084 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1085 <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" style="border-width: 0px;" />
1086 <!-- both scripts for calendar must follow the input field -->
1087 <script type="text/javascript">
1089 inputField : "beginning_date",
1090 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1095 <script type="text/javascript">
1097 inputField : "beginning_date",
1098 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1099 button : "beginning_date",
1106 <label for="subtype">Subscription length:</label>
1108 <select name="subtype" id="subtype">
1109 <!-- TMPL_LOOP NAME="subtype" -->
1110 <!-- TMPL_IF NAME="selected" -->
1111 <option value="<!-- TMPL_VAR NAME="name" -->" selected="selected">
1113 <option value="<!-- TMPL_VAR NAME="name" -->">
1115 <!-- TMPL_VAR NAME="name" -->
1119 <input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (*) (enter amount in numerals)
1122 <li><label for="numberingmethod">Numbering formula:</label> <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" />
1125 <div id="basetable" style="display: none;">
1126 <table class="small">
1136 <input type="text" name="add1" value="<!-- TMPL_VAR name="add1" -->" />
1139 <input type="text" name="add2" value="<!-- TMPL_VAR name="add2" -->" />
1142 <input type="text" name="add3" value="<!-- TMPL_VAR name="add3" -->" />
1147 <td><input type="text" name="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
1148 <td><input type="text" name="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
1149 <td><input type="text" name="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
1152 <td>When more than</td>
1153 <td><input type="text" name="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
1154 <td><input type="text" name="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
1155 <td><input type="text" name="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
1158 <td>inner counter</td>
1159 <td><input type="text" name="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
1160 <td><input type="text" name="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
1161 <td><input type="text" name="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
1164 <td>Set back to</td>
1165 <td><input type="text" name="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
1166 <td><input type="text" name="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
1167 <td><input type="text" name="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
1171 <!-- TMPL_IF name="mod" -->
1177 <td><input type="text" name="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
1178 <td><input type="text" name="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
1179 <td><input type="text" name="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
1187 <fieldset class="action">
1188 <input type="button" value="Save subscription" onclick="Check(this.form)" accesskey="w" /></fieldset>
1194 <!--TMPL_IF Name="history"-->
1195 <div id="subscription_form_history">
1196 <h2>Subscription history</h2>
1197 <form method="post" action="/cgi-bin/koha/serials/subscription-add.pl">
1198 <input type="hidden" name="op" value="modsubscription" />
1199 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
1200 <input type="hidden" name="history_only" value="1" />
1201 <p>Hint : you can update the serial history manually. This can be useful for an old subscription or to clean the existing history. Modify those fields with care, as future serial recieve will continue to update them automatically.</p>
1204 <td>Subscription start date</td>
1205 <td><input type="text" name="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /> (start date of the 1st subscription)</td>
1208 <td>Subscription end date</td>
1209 <td><input type="text" name="histenddate" value="<!-- TMPL_VAR name="histenddate" -->" />(if empty, subscription is still active)</td>
1212 <td>Received issues</td>
1213 <td><textarea name="recievedlist" cols="60" rows="5"><!-- TMPL_VAR name="recievedlist" --></textarea></td>
1216 <td>Missing issues</td>
1217 <td><textarea name="missinglist" cols="60" rows="5"><!-- TMPL_VAR name="missinglist" --></textarea></td>
1220 <td>Note for OPAC</td>
1221 <td><textarea name="opacnote" cols="60" rows="5"><!-- TMPL_VAR name="opacnote" --></textarea></td>
1224 <td>Note for staff</td>
1225 <td><textarea name="librariannote" cols="60" rows="5"><!-- TMPL_VAR name="librariannote" --></textarea></td>
1228 <input type="submit" value="Save subscription history" />
1235 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->