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 moreoptions_seasons(text[15],sYear);
118 var d = new Date(document.f.firstacquidate.value);
119 var sYear = d.getFullYear();
120 document.f.add1.value=1;
121 document.f.add2.value='1';
122 document.f.add3.value='';
123 document.f.every1.value=4;
124 document.f.every2.value='1';
125 document.f.every3.value='';
126 document.f.whenmorethan1.value=9999999;
127 document.f.whenmorethan2.value='4';
128 document.f.whenmorethan3.value='';
129 document.f.setto1.value=0;
130 document.f.setto2.value='1';
131 document.f.setto3.value='';
132 document.f.lastvaluetemp1.value=sYear;
133 document.f.periodicity.value='8';
134 document.f.numberingmethod.value=_('{Y} {X}');
140 document.getElementById("more_options").innerHTML = '';
141 document.f.irreg_check.value=1;
144 var d = new Date(document.f.startdate.value);
145 var sYear = d.getFullYear();
146 document.f.add1.value=1;
147 document.f.add2.value=1;
148 document.f.add3.value='';
149 document.f.every1.value=12;
150 document.f.every2.value=1;
151 document.f.every3.value='';
152 document.f.whenmorethan1.value=9999999;
153 document.f.whenmorethan2.value=12;
154 document.f.whenmorethan3.value='';
155 document.f.setto1.value=0;
156 document.f.setto2.value=1;
157 document.f.setto3.value='';
158 // document.f.setto3.value='';
159 if (document.f.lastvalue1.value==0){document.f.lastvalue1.value=sYear};
160 if (document.f.lastvalue2.value==0 ||document.f.lastvalue2.value=='' ){
161 switch (document.f.periodicity.value){
163 var doy = dayofyear(d);
164 //var Weeknumber=YWDA[1];
165 document.f.lastvalue2.value=doy;
168 var doy = dayofyear(d);
169 //var Weeknumber=YWDA[1];
170 document.f.lastvalue2.value=doy*2;
173 var doy = dayofyear(d);
174 //var Weeknumber=YWDA[1];
175 document.f.lastvalue2.value=doy/3;
180 var YWDa = YMDaToYWDa(d);
181 //var Weeknumber=YWDA[1];
182 document.f.lastvalue2.value=YWDA[1]/(document.f.periodicity.value-1);
185 var smonth = d.getMonth();
186 document.f.lastvalue2.value=smonth;
189 var smonth = d.getMonth();
190 document.f.lastvalue2.value=smonth/2;
194 var smonth = d.getMonth();
195 document.f.lastvalue2.value=smonth/3;
198 var smonth = d.getMonth();
199 document.f.lastvalue2.value=smonth/6;
204 // document.f.lastvalue2.value=document.f.lastvaluetemp2.value;
205 document.f.lastvalue3.value='';
206 document.f.numberingmethod.value=_('{X}/{Y}');
207 moreoptions(text[16],text[0]);
211 document.f.add1.value=1;
212 document.f.add2.value='';
213 document.f.add3.value='';
214 document.f.every1.value=1;
215 document.f.every2.value='';
216 document.f.every3.value='';
217 document.f.whenmorethan1.value=9999999;
218 document.f.whenmorethan2.value='';
219 document.f.whenmorethan3.value='';
220 document.f.setto1.value=0;
221 document.f.setto2.value='';
222 document.f.setto3.value='';
223 /* document.f.lastvalue1.value=1;
224 document.f.lastvalue2.value='';
225 document.f.lastvalue3.value='';*/
226 document.f.numberingmethod.value='{X}';
227 moreoptions_daily_check(text[0]);
228 document.f.irreg_check.value=1;
234 function display_table(n) {
236 document.getElementById("basetable").style.display = 'block';
238 document.getElementById("basetable").style.display = 'none';
242 function modify_num_pattern() {
243 if(!document.getElementById("numberpattern")){ return false; }
244 document.getElementById("numberpattern").value = '<!-- TMPL_VAR NAME="numberpattern" -->';
247 document.f.add1.value='<!-- TMPL_VAR NAME="add1" -->';
248 document.f.add2.value='<!-- TMPL_VAR NAME="add2" -->';
249 document.f.add3.value='<!-- TMPL_VAR NAME="add3" -->';
250 document.f.every1.value='<!-- TMPL_VAR NAME="every1" -->';
251 document.f.every2.value='<!-- TMPL_VAR NAME="every2" -->';
252 document.f.every3.value='<!-- TMPL_VAR NAME="every3" -->';
253 document.f.whenmorethan1.value='<!-- TMPL_VAR NAME="whenmorethan1" -->';
254 document.f.whenmorethan2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
255 document.f.whenmorethan3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
256 document.f.setto1.value='<!-- TMPL_VAR NAME="setto1" -->';
257 document.f.setto2.value='<!-- TMPL_VAR NAME="setto2" -->';
258 document.f.setto3.value='<!-- TMPL_VAR NAME="setto3" -->';
259 document.f.lastvalue1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
260 document.f.lastvalue2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
261 document.f.lastvalue3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
262 document.f.numberingmethod.value='<!-- TMPL_VAR NAME="numberingmethod" -->';
266 <!-- TMPL_IF NAME="add2" -->
267 if(<!-- TMPL_VAR NAME="add2" --> > 0){
271 <!-- TMPL_IF NAME="add3" -->
272 if(<!-- TMPL_VAR NAME="add3" --> > 0){
277 document.f.lastvaluetemp1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
279 document.f.lastvaluetemp2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
280 document.f.whenmorethantemp2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
283 document.f.lastvaluetemp3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
284 document.f.whenmorethantemp3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
288 // a pre check with more options to see if 'number' and '1/day' are chosen
289 function moreoptions_daily_check(x) {
290 var periodicity = document.f.periodicity.value;
292 if(periodicity == 1){
293 document.getElementById("irregularity").innerHTML = '';
294 var daynames = new Array(_('Monday'),_('Tuesday'),_('Wednesday'),_('Thursday'),_('Friday'),_('Saturday'),_('Sunday'));
295 errortext =_("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
296 for(var j=0;j<daynames.length;j++){
297 errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+daynames[j]+" ";
299 var error = errortext;
301 document.getElementById("irregularity").innerHTML = error;
303 document.getElementById("irregularity").innerHTML = '';
304 document.getElementById("more_options").innerHTML = '';
309 // to dispaly the more options section
310 function moreoptions(x,y,z){
311 document.getElementById("irregularity").innerHTML = '';
312 document.getElementById("more_options").innerHTML = '';
314 // alert("X: "+x+"Y: "+y+"Z: "+z);
316 textbox +="<table>\n<tr><th> <\/th><th>"+x+"<\/th>";
318 textbox +="<th>"+y+"<\/th>";
320 textbox +="<th>"+z+"<\/th>";
323 textbox +="<\/tr>\n";
324 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";
326 textbox +="<td><input type='text' name='lastvaluetemp2' size='4' onkeyup='moreoptionsupdate(\"lastvalue2\")' value=" + document.f.lastvalue2.value + " /><\/td>\n";
328 textbox +="<td><input type='text' name='lastvaluetemp3' size='4' onkeyup='moreoptionsupdate(\"lastvalue3\")' value=" + document.f.lastvalue3.value + " /><\/td>\n";
331 textbox +="<\/tr>\n";
333 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
334 textbox +="<td><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"<\/a><\/td>\n";
335 textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
337 textbox +="<td><input type='text' name='whenmorethantemp3' size='4' onkeyup='moreoptionsupdate(\"whenmorethan3\",1)'><\/td>\n";
341 textbox +="<tr> <td>"+_('issues expected')+"</td><td><input type='text' name='issuesexpectedtemp1' size='4' onkeyup='moreoptionsupdate(\"issuesexpected1\",0)' value=" + document.f.issuesexpected1.value + " ><br/><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"</a></td></tr>";
343 textbox +="<\/table>\n";
345 document.getElementById("more_options").innerHTML = textbox;
348 function hemispheres(chosen){
349 var selbox = document.getElementById("season1");
351 var selboxselected = selbox.options[selbox.selectedIndex].value;
352 selbox.options.length = 0;
355 selbox.options[selbox.options.length] = new Option(text[11],'1');
356 selbox.options[selbox.options.length] = new Option(text[12],'2');
357 selbox.options[selbox.options.length] = new Option(text[13],'3');
358 selbox.options[selbox.options.length] = new Option(text[14],'4');
360 selbox.options[selboxselected-1].selected = true;
364 selbox.options[selbox.options.length] = new Option(text[13],'1');
365 selbox.options[selbox.options.length] = new Option(text[10],'2');
366 selbox.options[selbox.options.length] = new Option(text[11],'3');
367 selbox.options[selbox.options.length] = new Option(text[12],'4');
369 selbox.options[selboxselected-1].selected = true;
374 // to dispaly the more options section for seasons
375 function moreoptions_seasons(x,y){
376 document.getElementById("irregularity").innerHTML = '';
377 document.getElementById("more_options").innerHTML = '';
379 // alert("X: "+x+"Year: "+y);
381 var hemi_select = parseInt('<!-- TMPL_VAR NAME="hemisphere" -->');
382 textbox +="<li><label for=\"hemisphere\">"+ text[7] +"<\/label><select name='hemisphere' id=\"hemisphere\" onchange='hemispheres(this.options[this.selectedIndex].value)'>";
383 for(var i = 1; i <= 2; i++){
384 textbox +="<option value='"+i+"'";
385 if(i == hemi_select){
386 textbox += " selected "
388 textbox +=">"+text[i+7]+"<\/option>";
390 textbox +="<\/li>\n";
391 textbox +="<table><tr><th> <\/th><th>"+x+"<\/th>";
392 textbox +="<th>"+text[16]+"<\/th>";
393 textbox +="<\/tr>\n";
394 textbox +="<tr><th scope=\"row\">"+text[5]+"<\/th><td><select name='lastvaluetemp2' id='season1' onchange='moreoptionsupdate(\"lastvalue2\")'>";
395 for(var j = 1; j <= 4; j++){
396 textbox +="<option value='"+j+"'>"+text[j+10]+"<\/option>";
398 textbox +="<\/select><\/td><td><select name='lastvaluetemp1' onchange='moreoptionsupdate(\"lastvalue1\")'>";
399 for(var k = parseInt(y); k <= parseInt(y)+15; k++){
400 textbox +="<option value='"+k+"'>"+k+"<\/option>";
402 textbox +="<\/select><\/td><\/tr>\n";
403 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
404 textbox +="<td><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"<\/a><\/td>\n";
405 textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
406 textbox +="<\/tr><\/table>\n";
408 document.getElementById("more_options").innerHTML = textbox;
411 function irregularity_check(){
412 document.f.irreg_check.value = 1; // Irregularity button now pushed
413 var periodicity = document.f.periodicity.value;
414 var rollover = document.f.issuesexpected1.value;
415 if(document.f.whenmorethantemp2){
416 rollover = document.f.whenmorethantemp2.value;
418 if(document.f.whenmorethantemp3){
419 rollover = document.f.whenmorethantemp3.value;
424 var errortext = _("<b>Warning irregularity detected<\/b><br \/>");
427 if(rollover < 730) expected =730;
434 if(rollover < 365) expected =365;
441 if(rollover < 156) expected =156;
448 if(rollover < 52) expected =52;
455 if(rollover < 26) expected =26;
462 if(rollover < 17) expected =17;
469 if(rollover < 12) expected =12;
476 if(rollover < 6) expected =6;
483 if(rollover < 4) expected =4;
490 if(rollover < 4) expected =4;
497 if(rollover < 2) expected =2;
504 if(rollover < 1) expected =1;
514 if(expected == 365 || expected==730){
515 var daynames = new Array(_('Monday'),_('Tuesday'),_('Wednesday'),_('Thursday'),_('Friday'),_('Saturday'),_('Sunday'));
516 errortext += _("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
517 for(var j=0;j<daynames.length;j++){
518 errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+daynames[j]+" ";
522 errortext +=expected+_(" issues expected ")+rollover+_(" were entered. <br \/>Please indicate which date(s) an issue is not expected<br \/>");
524 for(var i=rollover;i<expected;i++){
525 errortext +="<select name='irregular' id='irregular"+count+"' onchange='display_example(expected)'>\n";
526 errortext +=irregular_options(periodicity);
527 errortext +="<\/select>\n";
534 errortext +=expectedover+_(" issues expected ")+rollover+_(" were entered.<br \/> You seem to have indicated more issues per year than expected.");
537 if(error.length ==0){
538 error=_('No irregularities noticed');
540 display_example(expected);
541 document.getElementById("irregularity").innerHTML = error;
544 function irregular_options(periodicity){
547 <!-- TMPL_IF NAME="weekarrayjs" -->
548 var weeks = new Array(<!-- TMPL_VAR NAME="weekarrayjs" -->);
550 var months = new Array(_('January'),_('February'),_('March'),_('April'),_('May'),_('June'),_('July'),_('August'),_('September'),_('October'),_('November'),_('December'));
551 var seasons = new Array(_('Autumn'),_('Winter'),_('Spring'),_('Summer'),_('Fall'));
553 if(periodicity == 1) {
558 if(periodicity == 2 || periodicity == 3 || periodicity == 4) {
560 <!-- TMPL_IF NAME="weekarrayjs" -->
562 count = <!-- TMPL_VAR NAME="weekno" -->;
568 if(periodicity == 5 || periodicity == 6 || periodicity == 7 || periodicity == 8 || periodicity == 9) {
569 if(periodicity == 8) {
570 is_season = 1; // setting up from edit page
575 if(is_hemisphere == 2){
586 for(var j=1;j<=expected;j++){
589 count = count-expected;
591 if(is_season && is_hemisphere == 1){
592 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j]+"<\/option>\n";
593 // alert("value: "+((count*3)-2)+" title: "+titles[j]);
594 } else if(is_season && is_hemisphere == 2){
595 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j-1]+"<\/option>\n";
596 // alert("value: "+((count*3)-2)+" title: "+titles[j-1]);
598 errortext +="<option value='"+count+"'>"+titles[j-1]+"<\/option>\n";
602 errortext +="<option value='"+j+"'>"+titles+" "+j+"<\/option>\n";
608 function irregular_order(){
609 var irregular = '<!-- TMPL_VAR NAME="irregularity" -->';
610 var periodicity = document.f.periodicity.value;
611 var irregarray = irregular.split(',');
613 for(j=0;j<irregarray.length;j++){
614 document.getElementById("irregular"+irregarray[j]).checked = true;
617 for(i=0;i<irregarray.length;i++){
618 document.getElementById("irregular"+i).value = irregarray[i];
623 function display_example(expected){
624 var startfrom1 = parseInt(document.f.lastvalue1.value);
625 var startfrom2 = parseInt(document.f.lastvalue2.value);
626 var startfrom3 = parseInt(document.f.lastvalue3.value);
627 var every1 = parseInt(document.f.every1.value);
628 var every2 = parseInt(document.f.every2.value);
629 var every3 = parseInt(document.f.every3.value);
630 var numberpattern = document.f.numberingmethod.value;
631 var whenmorethan2 = parseInt(document.f.whenmorethan2.value);
632 var whenmorethan3 = parseInt(document.f.whenmorethan3.value);
633 var setto2 = parseInt(document.f.setto2.value);
634 var setto3 = parseInt(document.f.setto3.value);
635 var displaytext = _('Based on the information<br \/>entered the Numbering Pattern<br \/>will look like this<br \/>\n');
637 var count=startfrom3-1;
638 var count2=startfrom2;
639 for(var i=0;i<12;i++){
640 if(count>=whenmorethan3){
642 if(count2>=whenmorethan2){
651 displaytext += numberpattern.replace(/{Z}/,count)+'\n';
652 displaytext = displaytext.replace(/{Y}/,count2)+'<br \/>\n';
653 displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
657 if(startfrom2>0 && !startfrom3){
658 var count=startfrom2-1;
659 for(var i=0;i<12;i++){
660 if(count>=whenmorethan2){
668 if(is_hemisphere == 2){
670 displaytext += numberpattern.replace(/{Y}/,text[count+12])+'\n';
672 displaytext += numberpattern.replace(/{Y}/,text[count+8])+'\n';
675 displaytext += numberpattern.replace(/{Y}/,text[count+10])+'\n';
678 displaytext += numberpattern.replace(/{Y}/,count)+'\n';
680 displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
683 if(startfrom1>0 && !startfrom2 && !startfrom3){
684 var offset=eval(document.f.issuesexpected1.value);
688 for(var i=startfrom1;i<(startfrom1+offset);i+=every1){
689 displaytext += numberpattern.replace(/{X}/,i)+'<br \/>\n';
692 displaytext = "<div style='padding: 5px; background-color: #CCCCCC'>"+displaytext+"<\/div>";
693 document.getElementById("displayexample").innerHTML = displaytext;
696 function isArray(obj) {
697 if (obj.constructor.toString().indexOf("Array") == -1)
703 function moreoptionsupdate(fieldnames,rollover){
704 fieldname = fieldnames;
705 fld = fieldname.length;
707 fieldnametempnumber = fieldname.substr(fld);
708 //alert(fieldnametempnumber);
709 fieldnametemp = fieldname.slice(0,-1)+"temp"+fieldnametempnumber;
710 // alert(fieldnametemp);
711 eval("document.f."+fieldname+".value = document.f."+fieldnametemp+".value");
712 // alert (fieldname+" : "+eval("document.f."+fieldname+".value") +' '+fieldnametemp+' : ' +eval("document.f."+fieldnametemp+".value"));
713 var patternchoice = document.getElementById("numberpattern").value;
714 switch(patternchoice){
719 if (document.f.lastvaluetemp2.value>0){document.f.innerloop1.value = document.f.lastvaluetemp2.value;}
723 eval("document.f.every"+(fieldnametempnumber-1)+".value = document.f."+fieldnametemp+".value");
728 function check_input(e){
729 var unicode=e.charCode? e.charCode : e.keyCode
730 if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
731 if (unicode<48||unicode>57) { // if not a number
732 alert(_("Needs to be entered in digit form -eg 10"));
733 return false // disable key press
738 function addbiblioPopup(biblionumber) {
739 var destination = "/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup";
740 if(biblionumber){ destination += "&biblionumber="+biblionumber; }
741 window.open(destination,'AddBiblioPopup','width=1024,height=768,toolbar=no,scrollbars=yes');
746 window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
749 function FindAcqui(f)
751 window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
754 function Find_ISSN(f)
756 window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
761 if (f.aqbooksellerid.value.length==0) {
762 alert(_('You must choose a bookseller'));
763 } else if (f.biblionumber.value.length==0) {
764 alert(_('You must choose or create a biblio'));
765 } else if(f.startdate.value.length != 0 && f.sublength.value > 0) {
766 if (f.irreg_check.value == 1) {
769 if(f.numbering_pattern.value == ''){
770 alert(_("Please choose a numbering pattern"));
772 alert(_("Please check for irregularity by clicking 'Irregularity?'"));
776 alert(_('You must choose a start date and a subscription length'));
780 <!-- TMPL_IF name="mod" -->
781 window.onload = modify_num_pattern();
782 <!-- TMPL_IF name="hemisphere" -->
783 window.onload = hemispheres(<!-- TMPL_VAR NAME="hemisphere" -->);
786 <!-- TMPL_IF name="irregularity" -->
787 window.onload = irregularity_check();
788 window.onload = irregular_order();
794 <!-- TMPL_INCLUDE NAME="header.inc" -->
795 <!-- TMPL_INCLUDE NAME="serials-search.inc" -->
797 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/serials/subscription-add.pl">Serials</a> › <!-- TMPL_IF name="mod" --> Modify subscription to <i><!-- TMPL_VAR name="bibliotitle" --></i><!-- TMPL_ELSE -->New subscription<!-- /TMPL_IF --></div>
799 <div id="doc3" class="yui-t7">
804 <!-- TMPL_IF name="mod" -->
805 <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
806 <input type="hidden" name="op" value="modsubscription" />
807 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
809 <form method="post" action="/cgi-bin/koha/serials/subscription-add.pl" name="f">
810 <input type="hidden" name="op" value="addsubscription" />
812 <input type="hidden" name="user" value="<!-- TMPL_VAR name="loggedinusername" -->" />
813 <input type="hidden" name="irreg_check" value="0" />
814 <input type="hidden" name="issuesexpected1" value="0" />
816 <div class="yui-u first">
817 <fieldset id="subscription_add_information" class="rows">
818 <legend>Subscription information for subscription #<!--TMPL_VAR name="subscriptionid"--></legend>
821 <span class="label">Librarian: </span> <!-- TMPL_VAR name="loggedinusername" -->
824 <label for="aqbooksellerid">Supplier: (*)</label>
825 <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 Supplier</a></div>
828 <label for="biblionumber">Biblio: (*)</label>
830 <input type="text" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size="8" />
831 (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled="disabled" readonly="readonly" />)
832 <div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a> | <!--TMPL_IF Name="mod"--><a href="#" onclick="addbiblioPopup(<!-- TMPL_VAR NAME="biblionumber" -->); return false;">Edit biblio</a><!-- TMPL_ELSE -->
833 <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a><!--/TMPL_IF--></div>
837 <label for="callnumber">Call Number</label>
838 <input type="text" name="callnumber" id="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" />
841 <label for="branchcode">Branch</label>
843 <select name="branchcode" id="branchcode">
844 <option value="">Any branch</option>
845 <!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
847 <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
850 </select> (select a branch)
854 <label for="notes">Notes</label>
855 <textarea name="notes" id="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea>
858 <label for="internalnotes">Management Notes</label>
859 <textarea name="internalnotes" id="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea>
862 <label for="letter">Patron alert with </label>
864 <select name="letter" id="letter">
865 <option value="">un-activated</option>
866 <!-- TMPL_LOOP name="letterloop" -->
867 <!-- TMPL_IF name="selected" -->
868 <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
870 <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
873 </select> <div class="inputnote">(select a letter & patrons will be able to "follow" this subscription and recieve a mail on every new issue)</div>
878 <div class="warning"><b>Warning:</b>
881 <li>Remember you <b>must</b> have created a biblio <b>before</b> creating a subscription</li>
882 <li>You also must have selected a supplier if you want to ask for late issues</li>
890 <div id="subscription_form_planning">
891 <fieldset class="rows">
892 <legend>Planning</legend>
895 <label for="firstacquidate"> First Issue ETA:</label>
897 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button2" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
898 <input type="text" name="firstacquidate" value="<!-- TMPL_VAR name="firstacquidate" -->" size="13" maxlength="10" id="acqui_date" style="border-width: 0px;" />
899 <!-- both scripts for calendar must follow the input field -->
900 <script type="text/javascript">
902 inputField:"acqui_date",
903 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
908 <script type="text/javascript">
910 inputField : "acqui_date",
911 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
912 button : "acqui_date",
919 <label for="periodicity">Frequency: (*)</label>
921 <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1);num_pattern;">
922 <option value="" selected="selected">-- please choose --</option>
923 <!-- TMPL_IF name="periodicity16" -->
924 <option value="16" selected="selected">Without Periodicity</option>
926 <option value="16">Without Periodicity</option>
928 <!-- TMPL_IF name="periodicity48" -->
929 <option value="48" selected="selected">Unknown</option>
931 <option value="48">Unknown</option>
933 <!-- TMPL_IF name="periodicity32" -->
934 <option value="32" selected="selected">Irregular</option>
936 <option value="32">Irregular</option>
939 <!-- TMPL_IF name="periodicity12" -->
940 <option value="12" selected="selected">2/day</option>
942 <option value="12">2/day</option>
944 <!-- TMPL_IF name="periodicity1" -->
945 <option value="1" selected="selected">1/day</option>
947 <option value="1">1/day</option>
949 <!-- TMPL_IF name="periodicity13" -->
950 <option value="13" selected="selected">3/week</option>
952 <option value="13">3/week</option>
954 <!-- TMPL_IF name="periodicity2" -->
955 <option value="2" selected="selected">1/week</option>
957 <option value="2">1/week</option>
959 <!-- TMPL_IF name="periodicity3" -->
960 <option value="3" selected="selected">1/2 weeks (2/month)</option>
962 <option value="3">1/2 weeks (2/months)</option>
964 <!-- TMPL_IF name="periodicity4" -->
965 <option value="4" selected="selected">1/3 weeks</option>
967 <option value="4">1/3 weeks</option>
969 <!-- TMPL_IF name="periodicity5" -->
970 <option value="5" selected="selected">1/month</option>
972 <option value="5">1/month</option>
974 <!-- TMPL_IF name="periodicity6" -->
975 <option value="6" selected="selected">1/2 months (6/year)</option>
977 <option value="6">1/2 months (6/year)</option>
979 <!-- TMPL_IF name="periodicity7" -->
980 <option value="7" selected="selected">1/3 months (1/quarter)</option>
982 <option value="7">1/3 months (1/quarter)</option>
984 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
985 <!-- TMPL_IF name="periodicity8" -->
986 <option value="8" selected="selected">1/quarter (seasonal)</option>
988 <option value="8">1/quarter (seasonal)</option>
991 <!-- TMPL_IF name="periodicity9" -->
992 <option value="9" selected="selected">2/years</option>
994 <option value="9">2/year</option>
996 <!-- TMPL_IF name="periodicity10" -->
997 <option value="10" selected="selected">1/year</option>
999 <option value="10">1/year</option>
1001 <!-- TMPL_IF name="periodicity11" -->
1002 <option value="11" selected="selected">1/2 years</option>
1004 <option value="11">1/2 years</option>
1007 <li><label for="manuallist"> Manual History:</label> <input type="checkbox" name="manualhist" id="manuallist" value="1" /></li>
1009 <label for="numberpattern"> Numbering Pattern:</label>
1011 <select name="numbering_pattern" size="1" id="numberpattern" onchange="num_pattern()">
1012 <option value="" selected="selected">-- please choose --</option>
1013 <!-- TMPL_IF name="numberpattern1" -->
1014 <option value="1" selected="selected">Number</option>
1016 <option value="1">Number</option>
1018 <!-- TMPL_IF name="numberpattern2" -->
1019 <option value="2" selected="selected">Volume, Number, Issue</option>
1021 <option value="2">Volume, Number, Issue</option>
1023 <!-- TMPL_IF name="numberpattern3" -->
1024 <option value="3" selected="selected">Volume, Number</option>
1026 <option value="3">Volume, Number</option>
1028 <!-- TMPL_IF name="numberpattern4" -->
1029 <option value="4" selected="selected">Volume, Issue</option>
1031 <option value="4">Volume, Issue</option>
1033 <!-- TMPL_IF name="numberpattern5" -->
1034 <option value="5" selected="selected">Number, Issue</option>
1036 <option value="5">Number, Issue</option>
1038 <!-- TMPL_IF name="numberpattern6" -->
1039 <option value="6" selected="selected">Seasonal only</option>
1041 <option value="6">Seasonal only</option>
1043 <!-- TMPL_IF name="numberpattern8" -->
1044 <option value="8" selected="selected">Year/Number</option>
1046 <option value="8">Year/Number</option>
1048 <!-- TMPL_IF name="numberpattern7" -->
1049 <option value="7" selected="selected">None of the above</option>
1051 <option value="7">None of the above</option>
1055 <li id="more_options"></li>
1056 <li id="irregularity"></li>
1057 <li id="displayexample"></li>
1059 <label for="startdate"> Begins On: (*)</label>
1061 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1062 <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" />
1063 <!-- both scripts for calendar must follow the input field -->
1064 <script type="text/javascript">
1066 inputField : "beginning_date",
1067 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1072 <script type="text/javascript">
1074 inputField : "beginning_date",
1075 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1076 button : "beginning_date",
1083 <label for="subtype">Subscription length</label>
1085 <select name="subtype" id="subtype">
1086 <!-- TMPL_LOOP NAME="subtype" -->
1087 <!-- TMPL_IF NAME="selected" -->
1088 <option value="<!-- TMPL_VAR NAME="name" -->" selected="selected">
1090 <option value="<!-- TMPL_VAR NAME="name" -->">
1092 <!-- TMPL_VAR NAME="name" -->
1096 <input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (*) (enter amount in numerals)
1099 <li><label for="numberingmethod">Numbering formula:</label> <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" />
1102 <div id="basetable" style="display: none;">
1103 <table class="small">
1113 <input type="text" name="add1" value="<!-- TMPL_VAR name="add1" -->" />
1116 <input type="text" name="add2" value="<!-- TMPL_VAR name="add2" -->" />
1119 <input type="text" name="add3" value="<!-- TMPL_VAR name="add3" -->" />
1124 <td><input type="text" name="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
1125 <td><input type="text" name="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
1126 <td><input type="text" name="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
1129 <td>When more than</td>
1130 <td><input type="text" name="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
1131 <td><input type="text" name="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
1132 <td><input type="text" name="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
1135 <td>inner counter</td>
1136 <td><input type="text" name="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
1137 <td><input type="text" name="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
1138 <td><input type="text" name="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
1141 <td>Set back to</td>
1142 <td><input type="text" name="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
1143 <td><input type="text" name="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
1144 <td><input type="text" name="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
1148 <!-- TMPL_IF name="mod" -->
1154 <td><input type="text" name="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
1155 <td><input type="text" name="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
1156 <td><input type="text" name="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
1164 <!--TMPL_IF Name="history"-->
1165 <div id="subscription_form_history">
1169 <td>Starting date:</td>
1170 <td><input type="text" name="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /> (the date of the 1st subscription)</td>
1173 <td>Ending date:</td>
1174 <td><input type="text" name="enddate" value="<!-- TMPL_VAR name="enddate" -->" />(if empty : subscription still active)</td>
1177 <td>Received issues</td>
1178 <td><textarea name="recievedlist" cols="60" rows="5"><!-- TMPL_VAR name="recievedlist" --></textarea></td>
1181 <td>Missing issues</td>
1182 <td><textarea name="missinglist" cols="60" rows="5"><!-- TMPL_VAR name="missinglist" --></textarea></td>
1185 <td>Opac's notes</td>
1186 <td><textarea name="opacnote" cols="60" rows="5"><!-- TMPL_VAR name="opacnote" --></textarea></td>
1189 <td>Librarian notes</td>
1190 <td><textarea name="librariannote" cols="60" rows="5"><!-- TMPL_VAR name="librariannote" --></textarea></td>
1197 <input type="button" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1205 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->