1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Serials › [% IF ( modify ) %][% bibliotitle |html %] › Modify subscription[% ELSE %]New subscription[% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
6 <style type="text/css">
7 fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
8 .yui-u li p label.widelabel {
9 width: 300px; /* not enough for IE7 apparently */
12 <script type="text/javascript">
15 // the english words used in display purposes
16 var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern"),
17 _("Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
18 var weekno_label = _("Week # ");
20 var is_hemisphere = 1;
21 var irregular_issues; // will hold irregularity object.
23 function formatDate(myDate) {
24 var d = new Array( myDate.getFullYear(), myDate.getMonth() + 1 ,myDate.getDate());
25 if(d[1].toString().length == 1) { d[1] = '0'+d[1] };
26 if(d[2].toString().length == 1) { d[2] = '0'+d[2] };
27 [% IF ( dateformat_us ) %]
28 return(d[1] + '/' + d[2] + '/' + d[0]) ;
29 [% ELSIF ( dateformat_metric ) %]
30 return(d[2] + '/' + d[1] + '/' + d[0]) ;
32 return(''+d[0] + '-' + d[1] + '-' + d[2]) ;
36 Date.prototype.addDays = function(days) {
37 this.setDate(this.getDate()+days);
40 function getWeeksArray(startDate,periodicity) {
41 // returns an array of syspref-formatted dates starting at the first day of startDate's year.
42 // This prediction method will not accurately predict irregularites beyond the first year.
43 // FIXME : Should replace with ajax query to get the first Monday of the year so that week numbers have correct dates.
45 if(periodicity==3) { // 1/2 wks
47 } else if(periodicity == 4) { // 1/3 wks
50 var weeksArray = new Array;
51 var jan01 = new Date();
54 jan01.setFullYear(startDate.getFullYear());
55 for(var i=0;i<52;i++) {
56 weeksArray[i] = formatDate(jan01) + ' ' + weekno_label + (i + 1);
62 function YMDaToYWDa(S) {
63 with (new Date(Date.UTC(S[0], S[1] - 1, S[2]))) {
64 var DoW = getUTCDay();
65 setUTCDate(getUTCDate() - (DoW + 6) % 7 + 3);
68 var WN = Math.round((ms - valueOf()) / 604800000) + 1;
69 return [getUTCFullYear(), WN, DoW == 0 ? 7 : DoW];
72 function dayofyear(d) { // d is a Date object
73 var yn = d.getFullYear();
74 var mn = d.getMonth();
76 var d1 = new Date(yn,0,1,12,0,0); // noon on Jan. 1
77 var d2 = new Date(yn,mn,dn,12,0,0); // noon on input date
78 var ddiff = Math.round((d2-d1)/864e5);
83 // create irregularity object.
84 function IrregularPattern() {
85 this.months = new Array(_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December"));
86 this.seasons = new Array(_("Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"));
87 this.daynames = new Array(_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday"),_("Sunday"));
88 // create weeks irregularity selection array:
89 this.firstissue = new Date();
90 this.firstissue.setDate(1);
91 this.firstissue.setMonth(0);
92 [% IF ( firstacquiyear ) %] // it's a mod, we already have a start date.
93 this.firstissue.setFullYear( [% firstacquiyear %] );
95 this.weeks = getWeeksArray(this.firstissue);
99 var irregular = '[% irregularity %]';
100 this.skipped = irregular.split(',');
103 IrregularPattern.prototype.update = function() {
104 this.skipped= new Array;
106 // daily periodicity, we interpret irregular array as which days of week to skip.
107 // else if weekly periodicity, week numbers (starting from 01 Jan) to skip.
108 // else irregular array is list of issues to skip
109 var summary_str = '';
111 if(document.f.irregularity_select) {
112 //$("#irregularity_select option:selected").each(...); //jquery can combine both conditionals and the for loop
113 for( var i in document.f.irregularity_select.options ) {
114 if( document.f.irregularity_select.options[i].selected ) {
115 this.skipped[cnt] = document.f.irregularity_select.options[i].value ;
116 summary_str += document.f.irregularity_select.options[i].text + "\n" ;
121 var summary = document.getElementById("irregularity_summary");
123 summary.value = summary_str;
124 summary.rows= ( cnt > 6 ) ? cnt : 6 ; // textarea will bre resized, but not more than 6 lines will show.
129 IrregularPattern.prototype.irregular = function(index) {
130 for( var i in this.skipped) {
131 if( this.skipped[i] == index) {
138 function init_pattern() {
139 irregular_issues = new IrregularPattern();
141 function reset_pattern() {
142 document.getElementById("numberpattern").value = '';
143 document.getElementById("irregularity").innerHTML = '';
148 // common pre defined number patterns
149 function reset_num_pattern() {
150 var patternchoice = document.getElementById("numberpattern").value;
151 switch(patternchoice){
153 document.f.add1.value=1;
154 document.f.add2.value=1;
155 document.f.add3.value=1;
156 document.f.every1.value=12;
157 document.f.every2.value=1;
158 document.f.every3.value=1;
159 document.f.whenmorethan1.value=9999999;
160 document.f.whenmorethan2.value=12;
161 document.f.whenmorethan3.value=4;
162 document.f.setto1.value=0;
163 document.f.setto2.value=1;
164 document.f.setto3.value=1;
165 document.f.lastvalue1.value=1;
166 document.f.lastvalue2.value=1;
167 document.f.lastvalue3.value=1;
168 document.f.numberingmethod.value=_("Vol {X}, No {Y}, Issue {Z}");
169 moreoptions(text[1],text[0],text[2]);
170 display_table(0); // toggle info box on (1) or off (0)
173 document.f.add1.value=1;
174 document.f.add2.value=1;
175 document.f.add3.value='';
176 document.f.every1.value=12;
177 document.f.every2.value=1;
178 document.f.every3.value='';
179 document.f.whenmorethan1.value=9999999;
180 document.f.whenmorethan2.value=12;
181 document.f.whenmorethan3.value='';
182 document.f.setto1.value=0;
183 document.f.setto2.value=1;
184 document.f.setto3.value='';
185 document.f.lastvalue1.value=1;
186 document.f.lastvalue2.value=1;
187 document.f.lastvalue3.value='';
188 document.f.numberingmethod.value=_("Vol {X}, No {Y}");
189 moreoptions(text[1],text[0]);
193 document.f.add1.value=1;
194 document.f.add2.value=1;
195 document.f.add3.value='';
196 document.f.every1.value=12;
197 document.f.every2.value=1;
198 document.f.every3.value='';
199 document.f.whenmorethan1.value=9999999;
200 document.f.whenmorethan2.value=12;
201 document.f.whenmorethan3.value='';
202 document.f.setto1.value=0;
203 document.f.setto2.value=1;
204 document.f.setto3.value='';
205 document.f.lastvalue1.value=1;
206 document.f.lastvalue2.value=1;
207 document.f.lastvalue3.value='';
208 document.f.numberingmethod.value=_("Vol {X}, Issue {Y}");
209 moreoptions(text[1],text[2]);
213 // var d = new Date(document.f.firstacquidate.value);
214 // var smonth = d.getMonth();
215 document.f.add1.value=1;
216 document.f.add2.value=1;
217 document.f.add3.value='';
218 document.f.every1.value=12;
219 document.f.every2.value=1;
220 document.f.every3.value='';
221 document.f.whenmorethan1.value=9999999;
222 document.f.whenmorethan2.value=12;
223 document.f.whenmorethan3.value='';
224 document.f.setto1.value=0;
225 document.f.setto2.value=1;
226 document.f.setto3.value='';
227 document.f.numberingmethod.value=_("No {X}, Issue {Y}");
228 moreoptions(text[0],text[2]);
232 var d = new Date(document.f.firstacquidate.value);
233 var sYear = d.getFullYear();
234 moreoptions_seasons(text[15],sYear);
235 var d = new Date(document.f.firstacquidate.value);
236 var sYear = d.getFullYear();
237 document.f.add1.value=1;
238 document.f.add2.value='1';
239 document.f.add3.value='';
240 document.f.every1.value=4;
241 document.f.every2.value='1';
242 document.f.every3.value='';
243 document.f.whenmorethan1.value=9999999;
244 document.f.whenmorethan2.value='4';
245 document.f.whenmorethan3.value='';
246 document.f.setto1.value=0;
247 document.f.setto2.value='1';
248 document.f.setto3.value='';
249 document.f.periodicity.value='8';
250 document.f.numberingmethod.value=_("{Y} {X}");
251 moreoptions_seasons(text[15],sYear);
252 document.f.lastvalue1temp.value=document.f.lastvalue1.value=sYear;
258 document.getElementById("more_options").innerHTML = '';
259 document.f.irreg_check.value=1;
261 case "8": // Year/Number
262 var d = (document.f.firstacquidate.value) ? new Date( document.f.firstacquidate.value) : new Date() ;
263 var sYear = d.getFullYear();
264 document.f.add1.value=1;
265 document.f.add2.value=1;
266 document.f.add3.value='';
267 document.f.every1.value=12;
268 document.f.every2.value=1;
269 document.f.every3.value='';
270 document.f.whenmorethan1.value=9999999;
271 document.f.whenmorethan2.value=12;
272 document.f.whenmorethan3.value='';
273 document.f.setto1.value=0;
274 document.f.setto2.value=1;
275 document.f.setto3.value='';
276 document.f.lastvalue1.value=sYear;
277 switch (document.f.periodicity.value){
279 var doy = dayofyear(d);
280 document.f.lastvalue2.value=doy;
281 document.f.whenmorethan2.value=365;
284 var doy = dayofyear(d);
285 document.f.lastvalue2.value=doy*2;
286 document.f.whenmorethan2.value=730;
291 var YWDa = YMDaToYWDa(d);
292 document.f.lastvalue2.value=YWDA[1]/(document.f.periodicity.value-1);
295 var smonth = d.getMonth();
296 document.f.lastvalue2.value=smonth;
299 var smonth = d.getMonth();
300 document.f.lastvalue2.value=smonth/2;
301 document.f.whenmorethan2.value=6;
305 var smonth = d.getMonth();
306 document.f.lastvalue2.value=smonth/3;
307 document.f.whenmorethan2.value=4;
310 var smonth = d.getMonth();
311 document.f.lastvalue2.value=smonth/6;
312 document.f.whenmorethan2.value=2;
316 document.f.lastvalue3.value='';
317 document.f.numberingmethod.value=_("{X} / {Y}");
318 moreoptions(text[16],text[0]);
319 // document.f.lastvalue1temp.value=sYear;
320 // document.f.lastvalue2temp.value=document.f.lastvalue2.value;
324 document.f.add1.value=1;
325 document.f.add2.value='';
326 document.f.add3.value='';
327 document.f.every1.value=1;
328 document.f.every2.value='';
329 document.f.every3.value='';
330 document.f.whenmorethan1.value=9999999;
331 document.f.whenmorethan2.value='';
332 document.f.whenmorethan3.value='';
333 document.f.setto1.value=0;
334 document.f.setto2.value='';
335 document.f.setto3.value='';
336 document.f.lastvalue1.value=1;
337 document.f.lastvalue2.value='';
338 document.f.lastvalue3.value='';
339 document.f.numberingmethod.value='{X}';
340 // moreoptions_daily_check(text[0]);
341 moreoptions(text[0]);
342 document.f.irreg_check.value=1;
348 function display_table(n) {
350 document.getElementById("basetable").style.display = 'block';
352 document.getElementById("basetable").style.display = 'none';
354 var disp_val = ( document.getElementById("basetable").style.display == 'none' ) ? 'block' : 'none' ;
355 document.getElementById("basetable").style.display = disp_val;
359 function set_num_pattern_from_template_vars() {
360 if(!document.getElementById("numberpattern")){ return false; }
361 document.getElementById("numberpattern").value = '[% numberpattern %]';
364 document.f.add1.value='[% add1 %]';
365 document.f.add2.value='[% add2 %]';
366 document.f.add3.value='[% add3 %]';
367 document.f.every1.value='[% every1 %]';
368 document.f.every2.value='[% every2 %]';
369 document.f.every3.value='[% every3 %]';
370 document.f.whenmorethan1.value='[% whenmorethan1 %]';
371 document.f.whenmorethan2.value='[% whenmorethan2 %]';
372 document.f.whenmorethan3.value='[% whenmorethan3 %]';
373 document.f.setto1.value='[% setto1 %]';
374 document.f.setto2.value='[% setto2 %]';
375 document.f.setto3.value='[% setto3 %]';
376 document.f.lastvalue1.value='[% lastvalue1 %]';
377 document.f.lastvalue2.value='[% lastvalue2 %]';
378 document.f.lastvalue3.value='[% lastvalue3 %]';
379 document.f.numberingmethod.value='[% numberingmethod %]';
393 document.f.lastvalue1temp.value='[% lastvalue1 %]';
395 document.f.lastvalue2temp.value='[% lastvalue2 %]';
396 document.f.whenmorethan2temp.value='[% whenmorethan2 %]';
399 document.f.lastvalue3temp.value='[% lastvalue3 %]';
400 document.f.whenmorethan3temp.value='[% whenmorethan3 %]';
404 // a pre check with more options to see if 'number' and '1/day' are chosen
405 function moreoptions_daily_check(x) {
406 var periodicity = document.f.periodicity.value;
408 if(periodicity == 1){ // i.e. daily
409 document.getElementById("irregularity").innerHTML = '';
410 errortext =_("Please indicate which days of the week you DO NOT expect to receive issues.")+"<br \/>";
411 for(var j=0;j<irregular_issues.daynames.length;j++){
412 errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+irregular_issues.daynames[j]+" ";
414 var error = errortext;
416 document.getElementById("irregularity").innerHTML = error;
418 document.getElementById("irregularity").innerHTML = '';
419 document.getElementById("more_options").innerHTML = '';
424 // to dispaly the more options section
425 function moreoptions(x,y,z){
426 document.getElementById("irregularity").innerHTML = '';
427 document.getElementById("more_options").innerHTML = '';
429 // alert("X: "+x+"Y: "+y+"Z: "+z);
431 textbox +="<table id='irregularity_table'>\n<tr><th> <\/th><th>"+x+"<\/th>";
433 textbox +="<th>"+y+"<\/th>";
435 textbox +="<th>"+z+"<\/th>";
438 textbox +="<\/tr>\n";
439 textbox +="<tr><th scope=\"row\">"+text[5]+"<\/td><td><input type='text' name='lastvalue1temp' id='lastvalue1temp' size='4' onkeyup='moreoptionsupdate(this)' value=\"" + document.f.lastvalue1.value + "\" /><\/td>\n";
441 textbox +="<td><input type=\"text\" name=\"lastvalue2temp\" id=\"lastvalue2temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this)\" value=\"" + document.f.lastvalue2.value + "\" /><\/td>\n";
443 textbox +="<td><input type=\"text\" name=\"lastvalue3temp\" id=\"lastvalue3temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this)\" value=\"" + document.f.lastvalue3.value + "\" /><\/td>\n";
446 textbox +="<\/tr>\n";
448 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
449 textbox +="<td> <\/td>\n";
450 textbox +="<td><input type=\"text\" name=\"whenmorethan2temp\" id=\"whenmorethan2temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this,1)\"><\/td>\n";
452 textbox +="<td><input type=\"text\" name=\"whenmorethan3temp\" id=\"whenmorethan3temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this,1)\"><\/td>\n";
456 textbox +="<tr> <td>"+_("issues expected")+"<\/td><td><input type=\"text\" name=\"issuesexpected1temp\" id=\"issuesexpected1temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this,0)\" value=\"" + document.f.issuesexpected1.value + "\" ><\/td><\/tr>";
458 textbox +="<\/table>\n";
460 document.getElementById("more_options").innerHTML = textbox;
463 function hemispheres(chosen){
464 var selbox = document.getElementById("season1");
466 var selboxselected = selbox.options[selbox.selectedIndex].value;
467 selbox.options.length = 0;
469 if ( (chosen == "1") || ( ! (chosen) && is_hemisphere == 1 )) {
470 selbox.options[selbox.options.length] = new Option(text[11],'1');
471 selbox.options[selbox.options.length] = new Option(text[12],'2');
472 selbox.options[selbox.options.length] = new Option(text[13],'3');
473 selbox.options[selbox.options.length] = new Option(text[14],'4');
475 selbox.options[selboxselected-1].selected = true;
478 if ( (chosen == "2") || ( ! (chosen) && is_hemisphere == 2 )) {
479 selbox.options[selbox.options.length] = new Option(text[13],'1');
480 selbox.options[selbox.options.length] = new Option(text[10],'2');
481 selbox.options[selbox.options.length] = new Option(text[11],'3');
482 selbox.options[selbox.options.length] = new Option(text[12],'4');
484 selbox.options[selboxselected-1].selected = true;
489 // to display the more options section for seasons
490 function moreoptions_seasons(x,y){
491 // x = 'Season'. y = 'Year'.
492 document.getElementById("irregularity").innerHTML = '';
493 document.getElementById("more_options").innerHTML = '';
495 //alert("X: "+x+"Year: "+y);
497 var hemi_select = parseInt('[% hemisphere %]');
498 textbox +="<li><label for=\"hemisphere\">"+ text[7] +"<\/label><select name=\"hemisphere\" id=\"hemisphere\" onchange=\"hemispheres(this.options[this.selectedIndex].value)\">";
499 for(var i = 1; i <= 2; i++){
500 textbox +="<option value='"+i+"'";
501 if(i == hemi_select){
502 textbox += " selected "
504 textbox +=">"+text[i+7]+"<\/option>";
506 textbox +="<\/li>\n";
507 textbox +="<table id=\"seasonal_irregularity\"><tr><th> <\/th><th>"+x+"<\/th>";
508 textbox +="<th>"+text[16]+"<\/th>";
509 textbox +="<\/tr>\n";
510 textbox +="<tr><th scope=\"row\">"+text[5]+"<\/th><td><select name=\"lastvalue2temp\" id=\"lastvalue2temp\" id=\"season1\" onchange=\"moreoptionsupdate(this)\">";
511 for(var j = 1; j <= 4; j++){
512 textbox +="<option value='"+j+"'>"+text[j+9]+"<\/option>";
514 textbox +="<\/select><\/td>";
515 var isyr = irregular_issues.firstissue;
516 textbox += "<td>" + irregular_issues.firstissue.getFullYear() + "<\/td><\/tr>\n";
517 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
518 textbox +="<td><input type=\"text\" name=\"whenmorethan2temp\" id=\"whenmorethan2temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this,1)\"><\/td>\n";
519 textbox +="<\/tr><\/table>\n";
521 document.getElementById("more_options").innerHTML = textbox;
524 function irregularity_check(){
525 document.f.irreg_check.value = 1; // Irregularity button now pushed
526 var periodicity = document.f.periodicity.value;
527 var rollover = document.f.issuesexpected1.value;
528 if( (document.f.whenmorethan2) && ( document.f.whenmorethan2.value > 0) ){
529 rollover = document.f.whenmorethan2.value;
531 if((document.f.whenmorethan3) && document.f.whenmorethan3.value > 0 ){
532 // FIXME: Irregularity check assumes that the full prediction pattern repeats each year.
533 // In cases where the outermost periodicity is > 1 year,
534 // e.g. where a volume spans two years, the irregularity check will be incorrect,
535 // but you can safely ignore the check, submit the form, and the prediction pattern should be correct.
536 // a way to distinguish between these two cases is needed.
537 rollover = document.f.whenmorethan3.value * document.f.whenmorethan2.value;
542 var errortext = "<b>"+_("Warning irregularity detected")+"</b><br \/>";
545 if(rollover < 730) expected =730;
552 if(rollover < 365) expected =365;
559 if(rollover < 52) expected =52;
566 if(rollover < 26) expected =26;
573 if(rollover < 17) expected =17;
580 if(rollover < 12) expected =12;
587 if(rollover < 6) expected =6;
594 if(rollover < 4) expected =4;
601 if(rollover < 4) expected =4;
608 if(rollover < 2) expected =2;
615 if(rollover < 1) expected =1;
625 if(expected == 365 || expected==730){ // what about leap years ?
626 // FIXME: We interpret irregularity as which days per week for periodicity==1.
627 // We need two cases: one in which we're published n days/week, in which case irregularity should be per week,
628 // and a regular daily pub, where irregularity should be per year.
629 errortext += _("Please indicate which days of the week you DO NOT expect to receive issues.")+"<br \/>";
631 errortext +=expected+_(" issues expected, ")+rollover+_(" were entered.")+"<br \/>"+_("Please indicate which date(s) an issue is not expected")+"<br \/>";
632 irregular_issues.numskipped = expected - rollover;
634 errortext +="<select multiple id=\"irregularity_select\" name=\"irregularity_select\" onchange=\"irregular_issues.update();\">\n";
635 errortext +=irregular_options(periodicity);
636 errortext += "<\/select>\n <textarea rows=\"6\" width=\"18\" id=\"irregularity_summary\" name=\"irregularity_summary\" value=\"foo\"><\/textarea>";
640 errortext +=expectedover+_(" issues expected, ")+rollover+_(" were entered")+"<p class=\"warning\">"+_("You seem to have indicated more issues per year than expected.<\/p>");
643 if(error.length ==0){
644 error=_("No irregularities noticed");
646 display_example(expected);
647 document.getElementById("irregularity").innerHTML = error;
648 irregular_issues.update();
651 function irregular_options(periodicity){
655 var numberpattern = document.getElementById('numberpattern').value;
656 if(periodicity == 1) {
658 titles = irregular_issues.daynames;
661 if(periodicity == 2 || periodicity == 3 || periodicity == 4) {
662 titles = irregular_issues.weeks;
664 if(periodicity==3) { // 1/2 wks
666 } else if(periodicity == 4) { // 1/3 wks
672 if(periodicity == 5 || periodicity == 6 || periodicity == 7 || periodicity == 8 || periodicity == 9) {
673 if(periodicity == 8 && numberpattern==8) {
674 is_season = 1; // setting up from edit page
677 titles = irregular_issues.seasons;
679 if(is_hemisphere == 2){
685 titles = irregular_issues.months;
691 return ''; // don't know how to deal with irregularity.
693 for(var j=0;j<expected;j++){ // rch - changed frrom (1..expected).
696 count = count-expected;
698 if(is_season && is_hemisphere == 1){
699 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j]+"<\/option>\n";
700 // alert("value: "+((count*3)-2)+" title: "+titles[j]);
701 } else if(is_season && is_hemisphere == 2){
702 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j-1]+"<\/option>\n";
703 // alert("value: "+((count*3)-2)+" title: "+titles[j-1]);
704 } else { // all non-seasonal periodicities:
705 var incr=1; // multiplier for ( 1/n weeks) patterns; in this case the irreg calc relies on the week# , not the issue#.
706 if(periodicity==3) { // 1/2 wks
708 } else if(periodicity == 4) { // 1/3 wks
711 errortext += "<option value='" + (1+j*incr) ;
712 if(irregular_issues.irregular(1+incr*j)) {
713 errortext += "' selected='selected" ;
715 errortext += "'>"+titles[incr*j]+"<\/option>\n";
719 errortext +="<option value='"+j+"'>"+titles+" "+j+"<\/option>\n";
726 function display_example(expected){
727 var startfrom1 = parseInt(document.f.lastvalue1.value);
728 var startfrom2 = parseInt(document.f.lastvalue2.value);
729 var startfrom3 = parseInt(document.f.lastvalue3.value);
730 var every1 = parseInt(document.f.every1.value);
731 var every2 = parseInt(document.f.every2.value);
732 var every3 = parseInt(document.f.every3.value);
733 var numberpattern = document.f.numberingmethod.value;
734 var whenmorethan2 = parseInt(document.f.whenmorethan2.value);
735 var whenmorethan3 = parseInt(document.f.whenmorethan3.value);
736 var setto2 = parseInt(document.f.setto2.value);
737 var setto3 = parseInt(document.f.setto3.value);
738 var displaytext = _("Based on the information entered, the Numbering Pattern will look like this: ") + "<br \/><ul class=\"numpattern_preview\">";
740 var count=startfrom3-1;
741 var count2=startfrom2;
742 for(var i = 0 ; i < 12; i++){
743 if(count>=whenmorethan3){
745 if(count2>=whenmorethan2){
754 displaytext += '<li>' + numberpattern.replace(/{Z}/,count) + '<\/li>\n';
755 displaytext = displaytext.replace(/{Y}/,count2);
756 displaytext = displaytext.replace(/{X}/,startfrom1);
760 if(startfrom2>0 && !startfrom3){
761 var count=startfrom2-1;
762 for(var i=0;i<12;i++){
763 if(count>=whenmorethan2){
771 if(is_hemisphere == 2){
773 displaytext += numberpattern.replace(/{Y}/,text[count+12])+'\n';
775 displaytext += numberpattern.replace(/{Y}/,text[count+8])+'\n';
778 displaytext += numberpattern.replace(/{Y}/,text[count+10])+'\n';
781 displaytext += numberpattern.replace(/{Y}/,count)+'\n';
783 displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
786 if(startfrom1>0 && !startfrom2 && !startfrom3){
787 var offset=eval(document.f.issuesexpected1.value);
791 for(var i=startfrom1;i<(startfrom1+offset);i+=every1){
792 displaytext += numberpattern.replace(/{X}/,i)+'<br \/>\n';
795 // displaytext = "<div style='padding: 5px; background-color: #CCCCCC'>"+displaytext+"<\/div>";
796 document.getElementById("displayexample").innerHTML = displaytext;
799 function isArray(obj) {
800 if (obj.constructor.toString().indexOf("Array") == -1)
806 function moreoptionsupdate(inputfield,rollover){
807 fieldname = inputfield.name;
808 // find parent element in base table by stripping 'temp' from element name.
809 basefield = document.getElementById(fieldname.slice(0,-4));
810 var fieldnumber = fieldname.slice(-5,-4);
812 basefield.value = inputfield.value;
813 var patternchoice = document.getElementById("numberpattern").value;
814 switch(patternchoice){
818 case "8": // Year, Number. -- Why not just use Vol, Number withvol==year??
819 // FIXME: this my conflict with innerloop calc below.
820 if (document.f.lastvalue2temp.value > 0){document.f.innerloop1.value = document.f.lastvalue2temp.value - 1;}
823 if(basefield.name.slice(0,-1) == 'lastvalue' || 'whenmorethan' ) {
824 // The enumeration string is held in a positional numeral notation with three positions, X,Y,Z.
825 // The last values lastvalue1, lastvalue2,lastvalue3 should match the last received serial's X,Y,Z enumeration.
826 // make array indexes start with 1 for consistency with variable names.
827 var innerloop = new Array( undefined, document.getElementById('innerloop1'), document.getElementById('innerloop2'), document.getElementById('innerloop3') );
828 var lastvalue = new Array( undefined, document.getElementById('lastvalue1').value *1 , document.getElementById('lastvalue2').value *1 , document.getElementById('lastvalue3').value *1 );
829 var every = new Array( undefined, document.getElementById('every1').value *1 , document.getElementById('every2').value *1 , document.getElementById('every3').value *1 );
830 var add = new Array( undefined, document.getElementById('add1').value *1 , document.getElementById('add2').value *1 , document.getElementById('add3').value *1 );
831 var whenmorethan = new Array( undefined, document.getElementById('whenmorethan1').value *1 , document.getElementById('whenmorethan2').value *1 , document.getElementById('whenmorethan3').value *1 );
834 // calculate rollover for higher level of periodicity.
835 // if there are two levels of periodicity, (e.g. vol{X},num{Y},issue{Z}, then every1=every2*whenmorethan2 / add2 .
836 for(var N=3;N>1;N--){
838 var addN = (add[N]) ? add[N] : 1 ;
839 var everyN = (document.getElementById('every'+N)) ? document.getElementById('every'+N).value : 1 ;
840 document.getElementById('every'+(N-1)).value = whenmorethan[N] * everyN / addN ;
844 innerloop[3].value = ( every[3] > 1 ) ? lastvalue[3] % every[3] : 0 ;
845 innerloop[2].value = ( every[2] > 1 ) ? lastvalue[3] - 1 : 0 ;
846 innerloop[1].value = ( every[1] > 1 ) ?
847 ( whenmorethan[3] > 0 ) ? (lastvalue[2] - 1) * every[2] + 1* innerloop[2].value
851 //FIXME : add checks for innerloop || lastvalue .gt. rollover
855 function check_input(e){
856 var unicode=e.charCode? e.charCode : e.keyCode
857 if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
858 if (unicode<48||unicode>57) { // if not a number
859 alert(_("Needs to be entered in digit form -eg 10"));
860 return false // disable key press
865 function addbiblioPopup(biblionumber) {
866 var destination = "/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup";
867 if(biblionumber){ destination += "&biblionumber="+biblionumber; }
868 window.open(destination,'AddBiblioPopup','width=1024,height=768,toolbar=no,scrollbars=yes');
873 window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
876 function FindAcqui(f)
878 window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
881 function Find_ISSN(f)
883 window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
888 if (f.aqbooksellerid.value.length==0) {
889 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"));
890 if (input_box==true) {
896 if (f.biblionumber.value.length==0) {
897 alert(_("You must choose or create a biblio"));
898 } else if(f.startdate.value.length != 0 && f.sublength.value > 0) {
899 if (f.irreg_check.value == 1) {
902 if(f.numbering_pattern.value == ''){
903 alert(_("Please choose a numbering pattern"));
905 alert(_("Please check for irregularity by clicking 'Test Prediction Pattern'"));
909 alert(_("You must choose a start date and a subscription length"));
911 if(irregular_issues.numskipped < irregular_issues.skipped.length ) {
912 alert(_("You have not accounted for all missing issues."));
917 $(document).ready(function() {
920 [% IF ( history ) %] $("#subscription_form_history").show();[% END %]
921 $("#cancel_manual_history").click(function(){
922 $("#subscription_form_history").hide();
923 $("#manuallist").removeAttr("checked");
925 $("#manuallist").click( function(){
926 if($(this).attr("checked")){
927 $("#subscription_form_history").show();
929 $("#subscription_form_history").hide();
933 // $(".widelabel").attr("width", "300px"); // labels stay skinny in IE7 anyway.
935 set_num_pattern_from_template_vars();
936 [% IF ( hemisphere ) %]
937 is_hemisphere = [% hemisphere %] ;
941 [% IF ( irregularity ) %]
942 irregularity_check();
944 $('#numberpattern').change( function() {
949 [% FOREACH field IN dont_export_field_loop %]
950 node = $("#[% field.fieldid %]");
951 if ( $(node).is('input') || $(node).is('textarea') ) {
953 } else if ( $(node).is('select') ) {
954 $(node).find("option:first").attr('selected','selected');
961 <body id="ser_subscription-add" class="ser">
962 [% INCLUDE 'header.inc' %]
963 [% INCLUDE 'serials-search.inc' %]
965 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › [% IF ( modify ) %]<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]"><i>[% bibliotitle |html %]</i></a> › Modify subscription[% ELSE %]New subscription[% END %]</div>
967 <div id="doc3" class="yui-t7">
970 <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle |html %]</i>[% ELSE %]Add a new subscription[% END %]</h1>
972 <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
974 <input type="hidden" name="op" value="modsubscription" />
975 <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
977 <input type="hidden" name="op" value="addsubscription" />
979 <input type="hidden" name="user" value="[% loggedinusername %]" />
980 <input type="hidden" name="irreg_check" value="0" />
981 <input type="hidden" name="issuesexpected1" id="issuesexpected1" value="0" />
983 <div class="yui-u first">
984 <fieldset id="subscription_add_information" class="rows">
985 <legend>Subscription details</legend>
987 [% IF ( subscriptionid ) %]
988 <li><span class="label">Subscription #</span> [% subscriptionid %]</li>
991 <label for="aqbooksellerid">Vendor: </label>
992 <input type="text" name="aqbooksellerid" id="aqbooksellerid" value="[% aqbooksellerid %]" size="8" /> (<input type="text" name="aqbooksellername" value="[% aqbooksellername %]" disabled="disabled" readonly="readonly" />) <a href="#" onclick="FindAcqui(f)">Search for a vendor</a>
995 <label for="biblionumber" class="required" title="Subscriptions must be associated with a bibliographic record">Biblio:</label>
997 <input type="text" name="biblionumber" id="biblionumber" value="[% bibnum %]" size="8" />
998 (<input type="text" name="title" value="[% bibliotitle %]" disabled="disabled" readonly="readonly" />) <span class="required" title="Subscriptions must be associated with a bibliographic record">Required</span>
999 <div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a>
1000 [% IF ( CAN_user_editcatalogue ) %]
1002 | <a href="#" onclick="addbiblioPopup([% bibnum %]); return false;">Edit biblio</a>
1004 | <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a>
1011 [% IF ( serialsadditems ) %]
1012 <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1" checked="checked" /><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p>
1013 <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial </label></p>
1015 <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1"/><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p>
1016 <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" checked="checked" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial</label></p>
1020 <label for="branchcode">Library:</label>
1022 <select name="branchcode" id="branchcode" style="width: 20em;">
1023 [% UNLESS ( Independantbranches ) %]<option value="">None</option>[% END %]
1024 [% FOREACH branchloo IN branchloop %][% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
1026 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
1029 </select> (select a library)
1033 <label for="location">Location:</label>
1034 <select name="location" id="location">
1035 <option value="">None</option>
1036 [% FOREACH locations_loo IN locations_loop %][% IF ( locations_loo.selected ) %]<option value="[% locations_loo.authorised_value %]" selected="selected">[% locations_loo.lib %]</option>[% ELSE %]<option value="[% locations_loo.authorised_value %]">[% locations_loo.lib %]</option>[% END %][% END %]
1040 <label for="callnumber">Call number:</label>
1041 <input type="text" name="callnumber" id="callnumber" value="[% callnumber %]" size="20" />
1044 <label for="graceperiod">Grace period:</label> <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod %]" size="5"/> day(s)
1047 <label for="notes">OPAC note:</label>
1048 <textarea name="notes" id="notes" cols="30" rows="2">[% notes %]</textarea>
1051 <label for="internalnotes">Nonpublic note:</label>
1052 <textarea name="internalnotes" id="internalnotes" cols="30" rows="2">[% internalnotes %]</textarea>
1056 [% IF ( letterloop ) %]
1057 <label for="letter">Patron notification: </label>
1058 <select name="letter" id="letter">
1059 <option value="">None</option>
1060 [% FOREACH letterloo IN letterloop %]
1061 [% IF ( letterloo.selected ) %]
1062 <option value="[% letterloo.value %]" selected="selected">[% letterloo.lettername %]</option>
1064 <option value="[% letterloo.value %]">[% letterloo.lettername %]</option>
1068 <div class="hint">Select a notice and subscribers will be notified when new issues are received.</div>
1070 <span class="label">Patron notification: </span>
1071 <div class="hint">To notify patrons of new serial issues, you must <a href="/cgi-bin/koha/tools/letter.pl">define a notice</a>.</div>
1075 <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label>
1076 <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount %]" size="4"/>
1079 <label class="widelabel" for="opacdisplaycount">Number of issues to display in OPAC: </label>
1080 <input type="text" name="opacdisplaycount" id="opacdisplaycount" value="[% opacdisplaycount %]" size="4"/>
1086 <div id="subscription_form_history" class="yui-u" style="display:none">
1087 <div><h3 style="display:inline">Subscription history</h3> <a href="#" id="cancel_manual_history">[cancel manual history]</a></div>
1088 <p>Hint: you can update the serial history manually. This can be useful for an old subscription or to clean the existing history. Modify these fields with care, as future serial receive will continue to update them automatically.</p>
1089 <fieldset class="rows">
1092 <label for="histstartdate">Subscription start date</label>
1093 <input type="text" name="histstartdate" id="histstartdate" value="[% histstartdate %]" /><div class="hint"> (start date of the 1st subscription)</div>
1096 <label for="histenddate">Subscription end date</label>
1097 <input type="text" name="histenddate" id="histenddate" value="[% histenddate %]" /> <div class="hint">(if empty, subscription is still active)</div>
1100 <label for="recievedlist">Received issues</label>
1101 <textarea name="recievedlist" id="recievedlist" cols="60" rows="5">[% recievedlist %]</textarea>
1104 <label for="missinglist">Missing issues</label>
1105 <textarea name="missinglist" id="missinglist" cols="60" rows="5">[% missinglist %]</textarea>
1108 <label for="opacnote">Note for OPAC</label>
1109 <textarea name="opacnote" id="opacnote" cols="60" rows="5">[% opacnote %]</textarea>
1112 <label for="librariannote">Note for staff</label>
1113 <textarea name="librariannote" id="librariannote" cols="60" rows="5">[% librariannote %]</textarea>
1117 <fieldset class="action"><input type="submit" value="Save subscription history" /></fieldset>
1121 <div id="subscription_form_planning">
1122 <fieldset class="rows">
1123 <legend>Serials planning</legend>
1126 <label for="acqui_date"> First issue publication date:</label>
1127 [% UNLESS ( modify ) %]<img src="[% themelang %]/lib/calendar/cal.gif" id="acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />[% END %]
1128 [% IF ( modify ) %]<input type="text" name="firstacquidate" value="[% firstacquidate %]" size="13" maxlength="10" id="acqui_date" disabled="disabled" />
1129 [% ELSE %]<input type="text" name="firstacquidate" value="[% firstacquidate %]" size="13" maxlength="10" id="acqui_date" />[% END %]
1131 [% IF ( modify ) %]<li><label for="next_acqui_date"> Next issue publication date:</label>
1132 <img src="[% themelang %]/lib/calendar/cal.gif" id="next_acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1133 <input type="text" name="nextacquidate" value="[% nextacquidate %]" size="13" maxlength="10" id="next_acqui_date" />
1136 <li><!-- both scripts for calendar must follow the input field -->
1137 <script type="text/javascript">
1139 inputField : "[% IF ( modify ) %]next_[% END %]acqui_date",
1140 ifFormat : "[% DHTMLcalendar_dateformat %]",
1141 button : "[% IF ( modify ) %]next_[% END %]acqui_button",
1143 onUpdate : function(cal) {
1144 irregular_issues.weeks = getWeeksArray(cal.date);
1145 irregular_issues.firstissue = cal.date;
1146 if(document.irregularity_summary) {
1147 irregular_issues.update();
1149 if(document.getElementById("seasonal_irregularity")) {
1150 moreoptions_seasons(text[15]);
1155 inputField : "[% IF ( modify ) %]next_[% END %]acqui_date",
1156 ifFormat : "[% DHTMLcalendar_dateformat %]",
1157 button : "[% IF ( modify ) %]next_[% END %]acqui_date",
1159 onUpdate : function(cal) { irregular_issues.weeks = getWeeksArray(cal.date);
1160 irregular_issues.firstissue = cal.date;
1161 if(document.irregularity_summary) {
1162 irregular_issues.update();
1164 if(document.getElementById("seasonal_irregularity")) {
1165 moreoptions_seasons(text[15]);
1170 <label for="periodicity" class="required">Frequency:</label>
1172 <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1); reset_num_pattern();">
1173 <option value="" selected="selected">-- please choose --</option>
1174 [% IF ( periodicity16 ) %]
1175 <option value="16" selected="selected">Without periodicity</option>
1177 <option value="16">Without periodicity</option>
1179 [% IF ( periodicity48 ) %]
1180 <option value="48" selected="selected">Unknown</option>
1182 <option value="48">Unknown</option>
1184 [% IF ( periodicity32 ) %]
1185 <option value="32" selected="selected">Irregular</option>
1187 <option value="32">Irregular</option>
1190 [% IF ( periodicity12 ) %]
1191 <option value="12" selected="selected">2/day</option>
1193 <option value="12">2/day</option>
1195 [% IF ( periodicity1 ) %]
1196 <option value="1" selected="selected">daily (n/week)</option>
1198 <option value="1">daily (n/week)</option>
1200 [% IF ( periodicity2 ) %]
1201 <option value="2" selected="selected">1/week</option>
1203 <option value="2">1/week</option>
1205 [% IF ( periodicity3 ) %]
1206 <option value="3" selected="selected">1/2 weeks </option>
1208 <option value="3">1/2 weeks </option>
1210 [% IF ( periodicity4 ) %]
1211 <option value="4" selected="selected">1/3 weeks</option>
1213 <option value="4">1/3 weeks</option>
1215 [% IF ( periodicity5 ) %]
1216 <option value="5" selected="selected">1/month</option>
1218 <option value="5">1/month</option>
1220 [% IF ( periodicity6 ) %]
1221 <option value="6" selected="selected">1/2 months (6/year)</option>
1223 <option value="6">1/2 months (6/year)</option>
1225 [% IF ( periodicity7 ) %]
1226 <option value="7" selected="selected">1/3 months (1/quarter)</option>
1228 <option value="7">1/3 months (1/quarter)</option>
1230 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
1231 [% IF ( periodicity8 ) %]
1232 <option value="8" selected="selected">1/quarter (seasonal)</option>
1234 <option value="8">1/quarter (seasonal)</option>
1236 [% IF ( periodicity13 ) %]
1237 <option value="13" selected="selected">1/4 months (3/year)</option>
1239 <option value="13">1/4 months (3/year)</option>
1242 [% IF ( periodicity9 ) %]
1243 <option value="9" selected="selected">2/years</option>
1245 <option value="9">2/year</option>
1247 [% IF ( periodicity10 ) %]
1248 <option value="10" selected="selected">1/year</option>
1250 <option value="10">1/year</option>
1252 [% IF ( periodicity11 ) %]
1253 <option value="11" selected="selected">1/2 years</option>
1255 <option value="11">1/2 years</option>
1257 </select> <span class="required">Required</span></li>
1259 <label for="manuallist"> Manual history:</label>
1260 [% IF ( manualhistory ) %]
1261 <input type="checkbox" name="manualhist" id="manuallist" value="1" checked="checked" />
1263 <input type="checkbox" name="manualhist" id="manuallist" value="1" />
1267 <label for="numberpattern"> Numbering pattern:</label>
1269 <select name="numbering_pattern" size="1" id="numberpattern" >
1270 <option value="" selected="selected">-- please choose --</option>
1271 [% IF ( numberpattern1 ) %]
1272 <option value="1" selected="selected">Number</option>
1274 <option value="1">Number</option>
1276 [% IF ( numberpattern2 ) %]
1277 <option value="2" selected="selected">Volume, number, issue</option>
1279 <option value="2">Volume, number, issue</option>
1281 [% IF ( numberpattern3 ) %]
1282 <option value="3" selected="selected">Volume, number</option>
1284 <option value="3">Volume, number</option>
1286 [% IF ( numberpattern4 ) %]
1287 <option value="4" selected="selected">Volume, issue</option>
1289 <option value="4">Volume, issue</option>
1291 [% IF ( numberpattern5 ) %]
1292 <option value="5" selected="selected">Number, issue</option>
1294 <option value="5">Number, issue</option>
1296 [% IF ( numberpattern6 ) %]
1297 <option value="6" selected="selected">Seasonal only</option>
1299 <option value="6">Seasonal only</option>
1301 [% IF ( numberpattern8 ) %]
1302 <option value="8" selected="selected">Year/Number</option>
1304 <option value="8">Year/Number</option>
1306 [% IF ( numberpattern7 ) %]
1307 <option value="7" selected="selected">None of the above</option>
1309 <option value="7">None of the above</option>
1313 <li id="more_options"></li>
1314 <li id="irregularity"></li>
1315 <li id="displayexample"></li>
1317 <label for="beginning_date" class="required"> Subscription start date:</label>
1319 <img src="[% themelang %]/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="Show calendar" title="Show calendar" />
1320 <input type="text" name="startdate" value="[% startdate %]" size="13" maxlength="10" id="beginning_date" />
1321 <!-- both scripts for calendar must follow the input field -->
1322 <script type="text/javascript">
1324 inputField : "beginning_date",
1325 ifFormat : "[% DHTMLcalendar_dateformat %]",
1330 inputField : "beginning_date",
1331 ifFormat : "[% DHTMLcalendar_dateformat %]",
1332 button : "beginning_date",
1336 <span class="required">Required</span>
1339 <label for="subtype" class="required">Subscription length:</label>
1341 <select name="subtype" id="subtype">
1342 [% IF ( subtype_monthlength ) %]<option value="monthlength" selected="selected">[% ELSE %]<option value="monthlength">[% END %] Number of months</option>
1343 [% IF ( subtype_numberlength ) %]<option value="numberlength" selected="selected">[% ELSE %]<option value="numberlength">[% END %] Number of issues</option>
1344 [% IF ( subtype_weeklength ) %]<option value="weeklength" selected="selected">[% ELSE %]<option value="weeklength">[% END %] Number of weeks</option>
1346 <input type="text" id="numberlength" name="sublength" value="[% sublength %]" size="3" onkeypress="return check_input(event)" /> (enter amount in numerals)
1347 <span class="required">Required</span>
1350 <label for="ending_date"> Subscription end date:</label>
1352 <img src="[% themelang %]/lib/calendar/cal.gif" id="buttonend1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1353 <input type="text" name="enddate" value="[% enddate %]" size="13" maxlength="10" id="ending_date" />
1354 <!-- both scripts for calendar must follow the input field -->
1355 <script type="text/javascript">
1357 inputField : "ending_date",
1358 ifFormat : "[% DHTMLcalendar_dateformat %]",
1359 button : "buttonend1",
1363 inputField : "ending_date",
1364 ifFormat : "[% DHTMLcalendar_dateformat %]",
1365 button : "ending_date",
1370 <li><label for="numberingmethod">Numbering formula:</label> <input type="text" name="numberingmethod" id="numberingmethod" value="[% numberingmethod %]" />
1375 <fieldset class="action">
1376 <input type="button" class="action_test" value="Test prediction pattern" onclick="javascript:irregularity_check()" />
1377 <input type="button" class="action_reset" value="Reset pattern" onclick="javascript:reset_pattern()" />
1378 <input type="button" class="action_save" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1380 <fieldset class="action">
1381 <input type="button" class="action_advanced" value="Show/Hide advanced pattern" onclick="javascript:display_table()" />
1383 <div id="basetable" style="display: none;">
1384 <table class="small">
1385 <tr><th colspan="4">Advanced prediction pattern</th></tr>
1395 <input type="text" name="add1" id="add1" value="[% add1 %]" />
1398 <input type="text" name="add2" id="add2" value="[% add2 %]" />
1401 <input type="text" name="add3" id="add3" value="[% add3 %]" />
1406 <td><input type="text" name="every1" id="every1" value="[% every1 %]" /></td>
1407 <td><input type="text" name="every2" id="every2" value="[% every2 %]" /></td>
1408 <td><input type="text" name="every3" id="every3" value="[% every3 %]" /></td>
1411 <td>When more than</td>
1412 <td><input type="text" name="whenmorethan1" id="whenmorethan1" value="[% whenmorethan1 %]" /></td>
1413 <td><input type="text" name="whenmorethan2" id="whenmorethan2" value="[% whenmorethan2 %]" /></td>
1414 <td><input type="text" name="whenmorethan3" id="whenmorethan3" value="[% whenmorethan3 %]" /></td>
1417 <td>inner counter</td>
1418 <td><input type="text" name="innerloop1" id="innerloop1" value="[% innerloop1 %]" /></td>
1419 <td><input type="text" name="innerloop2" id="innerloop2" value="[% innerloop2 %]" /></td>
1420 <td><input type="text" name="innerloop3" id="innerloop3" value="[% innerloop3 %]" /></td>
1423 <td>Set back to</td>
1424 <td><input type="text" name="setto1" id="setto1" value="[% setto1 %]" /></td>
1425 <td><input type="text" name="setto2" id="setto2" value="[% setto2 %]" /></td>
1426 <td><input type="text" name="setto3" id="setto3" value="[% setto3 %]" /></td>
1436 <td><input type="text" name="lastvalue1" id="lastvalue1" value="[% lastvalue1 %]" /></td>
1437 <td><input type="text" name="lastvalue2" id="lastvalue2" value="[% lastvalue2 %]" /></td>
1438 <td><input type="text" name="lastvalue3" id="lastvalue3" value="[% lastvalue3 %]" /></td>
1450 [% INCLUDE 'intranet-bottom.inc' %]