1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha › Serials › <!-- TMPL_IF name="mod" --><!-- TMPL_VAR name="bibliotitle" escape="html" --> › Modify subscription<!-- TMPL_ELSE -->New subscription<!-- /TMPL_IF --></title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- TMPL_INCLUDE NAME="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 <!-- TMPL_IF NAME="dateformat_us" -->
28 return(d[1] + '/' + d[2] + '/' + d[0]) ;
29 <!-- TMPL_ELSIF NAME="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 <!-- TMPL_IF NAME='firstacquiyear' --> // it's a mod, we already have a start date.
93 this.firstissue.setFullYear( <!-- TMPL_VAR NAME="firstacquiyear" --> );
95 this.weeks = getWeeksArray(this.firstissue);
99 var irregular = '<!-- TMPL_VAR NAME="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 = '<!-- TMPL_VAR NAME="numberpattern" -->';
364 document.f.add1.value='<!-- TMPL_VAR NAME="add1" -->';
365 document.f.add2.value='<!-- TMPL_VAR NAME="add2" -->';
366 document.f.add3.value='<!-- TMPL_VAR NAME="add3" -->';
367 document.f.every1.value='<!-- TMPL_VAR NAME="every1" -->';
368 document.f.every2.value='<!-- TMPL_VAR NAME="every2" -->';
369 document.f.every3.value='<!-- TMPL_VAR NAME="every3" -->';
370 document.f.whenmorethan1.value='<!-- TMPL_VAR NAME="whenmorethan1" -->';
371 document.f.whenmorethan2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
372 document.f.whenmorethan3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
373 document.f.setto1.value='<!-- TMPL_VAR NAME="setto1" -->';
374 document.f.setto2.value='<!-- TMPL_VAR NAME="setto2" -->';
375 document.f.setto3.value='<!-- TMPL_VAR NAME="setto3" -->';
376 document.f.lastvalue1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
377 document.f.lastvalue2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
378 document.f.lastvalue3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
379 document.f.numberingmethod.value='<!-- TMPL_VAR NAME="numberingmethod" -->';
383 <!-- TMPL_IF NAME="add2" -->
384 if(<!-- TMPL_VAR NAME="add2" --> > 0){
388 <!-- TMPL_IF NAME="add3" -->
389 if(<!-- TMPL_VAR NAME="add3" --> > 0){
393 document.f.lastvalue1temp.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
395 document.f.lastvalue2temp.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
396 document.f.whenmorethan2temp.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
399 document.f.lastvalue3temp.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
400 document.f.whenmorethan3temp.value='<!-- TMPL_VAR NAME="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('<!-- TMPL_VAR NAME="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 <!--TMPL_IF Name="history"--> $("#subscription_form_history").show();<!--/TMPL_IF-->
921 $("#cancel_manual_history").click(function(){
922 $("#subscription_form_history").hide();
923 $("#manuallist").attr("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.
934 <!-- TMPL_IF name="mod" -->
935 set_num_pattern_from_template_vars();
936 <!-- TMPL_IF name="hemisphere" -->
937 is_hemisphere = <!-- TMPL_VAR NAME="hemisphere" --> ;
941 <!-- TMPL_IF name="irregularity" -->
942 irregularity_check();
944 $('#numberpattern').change( function() {
952 <!-- TMPL_INCLUDE NAME="header.inc" -->
953 <!-- TMPL_INCLUDE NAME="serials-search.inc" -->
955 <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" --><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=<!-- TMPL_VAR NAME="subscriptionid" -->"><i><!-- TMPL_VAR NAME="bibliotitle" escape="html" --></i></a> › Modify subscription<!-- TMPL_ELSE -->New subscription<!-- /TMPL_IF --></div>
957 <div id="doc3" class="yui-t7">
960 <h1><!-- TMPL_IF name="mod" --> Modify subscription for <i><!-- TMPL_VAR name="bibliotitle" escape="html" --></i><!-- TMPL_ELSE -->Add a new subscription<!-- /TMPL_IF --></h1>
962 <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
963 <!-- TMPL_IF name="mod" -->
964 <input type="hidden" name="op" value="modsubscription" />
965 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
967 <input type="hidden" name="op" value="addsubscription" />
969 <input type="hidden" name="user" value="<!-- TMPL_VAR name="loggedinusername" -->" />
970 <input type="hidden" name="irreg_check" value="0" />
971 <input type="hidden" name="issuesexpected1" id="issuesexpected1" value="0" />
973 <div class="yui-u first">
974 <fieldset id="subscription_add_information" class="rows">
975 <legend>Subscription details</legend>
977 <!-- TMPL_IF name="subscriptionid" -->
978 <li><span class="label">Subscription #</span> <!--TMPL_VAR name="subscriptionid"--></li>
981 <label for="aqbooksellerid">Vendor: </label>
982 <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" />) <a href="#" onclick="FindAcqui(f)">Search for a vendor</a>
985 <label for="biblionumber" class="required" title="Subscriptions must be associated with a bibliographic record">Biblio:</label>
987 <input type="text" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR name="bibnum" -->" size="8" />
988 (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled="disabled" readonly="readonly" />) <span class="required" title="Subscriptions must be associated with a bibliographic record">Required</span>
989 <div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a>
990 <!-- TMPL_IF name="CAN_user_editcatalogue" -->
991 <!--TMPL_IF Name="mod"-->
992 | <a href="#" onclick="addbiblioPopup(<!-- TMPL_VAR NAME="bibnum" -->); return false;">Edit biblio</a>
994 | <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a>
1001 <!-- TMPL_IF name="serialsadditems" -->
1002 <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>
1003 <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>
1005 <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>
1006 <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>
1010 <label for="branchcode">Library:</label>
1012 <select name="branchcode" id="branchcode" style="width: 20em;">
1013 <!-- TMPL_UNLESS NAME="Independantbranches" --><option value="">None</option><!-- /TMPL_UNLESS -->
1014 <!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
1016 <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
1019 </select> (select a library)
1023 <label for="location">Location:</label>
1024 <select name="location" id="location">
1025 <option value="">None</option>
1026 <!-- TMPL_LOOP NAME="locations_loop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!-- TMPL_VAR NAME="lib" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
1030 <label for="callnumber">Call Number:</label>
1031 <input type="text" name="callnumber" id="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" />
1034 <label for="graceperiod">Grace period:</label> <input type="text" name="graceperiod" id="graceperiod" value="<!-- TMPL_VAR name="graceperiod" -->" size="5"/> day(s)
1037 <label for="notes">Public note:</label>
1038 <textarea name="notes" id="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea>
1041 <label for="internalnotes">Nonpublic note:</label>
1042 <textarea name="internalnotes" id="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea>
1046 <!-- TMPL_IF NAME="letterloop" -->
1047 <label for="letter">Patron notification: </label>
1048 <select name="letter" id="letter">
1049 <option value="">None</option>
1050 <!-- TMPL_LOOP name="letterloop" -->
1051 <!-- TMPL_IF name="selected" -->
1052 <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
1054 <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
1058 <div class="hint">Select a notice and patrons on the routing list will be notified when new issues are received.</div>
1060 <span class="label">Patron notification: </span>
1061 <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>
1065 <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label>
1066 <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="<!-- TMPL_VAR NAME="staffdisplaycount" -->" size="4"/>
1069 <label class="widelabel" for="opacdisplaycount">Number of issues to display to the public: </label>
1070 <input type="text" name="opacdisplaycount" id="opacdisplaycount" value="<!-- TMPL_VAR NAME="opacdisplaycount" -->" size="4"/>
1076 <div id="subscription_form_history" class="yui-u" style="display:none">
1077 <div><h3 style="display:inline">Subscription history</h3> <a href="#" id="cancel_manual_history">[cancel manual history]</a></div>
1078 <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>
1079 <fieldset class="rows">
1082 <label for="histstartdate">Subscription start date</label>
1083 <input type="text" name="histstartdate" id="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /><div class="hint"> (start date of the 1st subscription)</div>
1086 <label for="histenddate">Subscription end date</label>
1087 <input type="text" name="histenddate" id="histenddate" value="<!-- TMPL_VAR name="histenddate" -->" /> <div class="hint">(if empty, subscription is still active)</div>
1090 <label for="recievedlist">Received issues</label>
1091 <textarea name="recievedlist" id="recievedlist" cols="60" rows="5"><!-- TMPL_VAR name="recievedlist" --></textarea>
1094 <label for="missinglist">Missing issues</label>
1095 <textarea name="missinglist" id="missinglist" cols="60" rows="5"><!-- TMPL_VAR name="missinglist" --></textarea>
1100 <fieldset class="action"><input type="submit" value="Save subscription history" /></fieldset>
1104 <div id="subscription_form_planning">
1105 <fieldset class="rows">
1106 <legend>Serials planning</legend>
1109 <label for="acqui_date"> First issue publication date:</label>
1110 <!-- TMPL_UNLESS NAME="mod" --><img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" /><!-- /TMPL_UNLESS -->
1111 <input type="text" name="firstacquidate" value="<!-- TMPL_VAR name="firstacquidate" -->" size="13" maxlength="10" id="acqui_date" <!-- TMPL_IF NAME="mod" -->disabled="disabled"<!-- /TMPL_IF --> style="border-width: 0px;" />
1113 <!-- TMPL_IF NAME="mod" --><li><label for="next_acqui_date"> Next issue publication date:</label>
1114 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="next_acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1115 <input type="text" name="nextacquidate" value="<!-- TMPL_VAR name="nextacquidate" -->" size="13" maxlength="10" id="next_acqui_date" style="border-width: 0px;" />
1116 </li><!-- /TMPL_IF -->
1118 <li><!-- both scripts for calendar must follow the input field -->
1119 <script type="text/javascript">
1121 inputField : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_date",
1122 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1123 button : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_button",
1125 onUpdate : function(cal) {
1126 irregular_issues.weeks = getWeeksArray(cal.date);
1127 irregular_issues.firstissue = cal.date;
1128 if(document.irregularity_summary) {
1129 irregular_issues.update();
1131 if(document.getElementById("seasonal_irregularity")) {
1132 moreoptions_seasons(text[15]);
1137 inputField : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_date",
1138 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1139 button : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_date",
1141 onUpdate : function(cal) { irregular_issues.weeks = getWeeksArray(cal.date);
1142 irregular_issues.firstissue = cal.date;
1143 if(document.irregularity_summary) {
1144 irregular_issues.update();
1146 if(document.getElementById("seasonal_irregularity")) {
1147 moreoptions_seasons(text[15]);
1152 <label for="periodicity" class="required">Frequency:</label>
1154 <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1); reset_num_pattern();">
1155 <option value="" selected="selected">-- please choose --</option>
1156 <!-- TMPL_IF name="periodicity16" -->
1157 <option value="16" selected="selected">Without periodicity</option>
1159 <option value="16">Without periodicity</option>
1161 <!-- TMPL_IF name="periodicity48" -->
1162 <option value="48" selected="selected">Unknown</option>
1164 <option value="48">Unknown</option>
1166 <!-- TMPL_IF name="periodicity32" -->
1167 <option value="32" selected="selected">Irregular</option>
1169 <option value="32">Irregular</option>
1172 <!-- TMPL_IF name="periodicity12" -->
1173 <option value="12" selected="selected">2/day</option>
1175 <option value="12">2/day</option>
1177 <!-- TMPL_IF name="periodicity1" -->
1178 <option value="1" selected="selected">daily (n/week)</option>
1180 <option value="1">daily (n/week)</option>
1182 <!-- TMPL_IF name="periodicity2" -->
1183 <option value="2" selected="selected">1/week</option>
1185 <option value="2">1/week</option>
1187 <!-- TMPL_IF name="periodicity3" -->
1188 <option value="3" selected="selected">1/2 weeks </option>
1190 <option value="3">1/2 weeks </option>
1192 <!-- TMPL_IF name="periodicity4" -->
1193 <option value="4" selected="selected">1/3 weeks</option>
1195 <option value="4">1/3 weeks</option>
1197 <!-- TMPL_IF name="periodicity5" -->
1198 <option value="5" selected="selected">1/month</option>
1200 <option value="5">1/month</option>
1202 <!-- TMPL_IF name="periodicity6" -->
1203 <option value="6" selected="selected">1/2 months (6/year)</option>
1205 <option value="6">1/2 months (6/year)</option>
1207 <!-- TMPL_IF name="periodicity7" -->
1208 <option value="7" selected="selected">1/3 months (1/quarter)</option>
1210 <option value="7">1/3 months (1/quarter)</option>
1212 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
1213 <!-- TMPL_IF name="periodicity8" -->
1214 <option value="8" selected="selected">1/quarter (seasonal)</option>
1216 <option value="8">1/quarter (seasonal)</option>
1219 <!-- TMPL_IF name="periodicity9" -->
1220 <option value="9" selected="selected">2/years</option>
1222 <option value="9">2/year</option>
1224 <!-- TMPL_IF name="periodicity10" -->
1225 <option value="10" selected="selected">1/year</option>
1227 <option value="10">1/year</option>
1229 <!-- TMPL_IF name="periodicity11" -->
1230 <option value="11" selected="selected">1/2 years</option>
1232 <option value="11">1/2 years</option>
1234 </select> <span class="required">Required</span></li>
1236 <label for="manuallist"> Manual history:</label>
1237 <!-- TMPL_IF name="manualhistory" -->
1238 <input type="checkbox" name="manualhist" id="manuallist" value="1" checked="checked" />
1240 <input type="checkbox" name="manualhist" id="manuallist" value="1" />
1244 <label for="numberpattern"> Numbering pattern:</label>
1246 <select name="numbering_pattern" size="1" id="numberpattern" >
1247 <option value="" selected="selected">-- please choose --</option>
1248 <!-- TMPL_IF name="numberpattern1" -->
1249 <option value="1" selected="selected">Number</option>
1251 <option value="1">Number</option>
1253 <!-- TMPL_IF name="numberpattern2" -->
1254 <option value="2" selected="selected">Volume, Number, Issue</option>
1256 <option value="2">Volume, Number, Issue</option>
1258 <!-- TMPL_IF name="numberpattern3" -->
1259 <option value="3" selected="selected">Volume, Number</option>
1261 <option value="3">Volume, Number</option>
1263 <!-- TMPL_IF name="numberpattern4" -->
1264 <option value="4" selected="selected">Volume, Issue</option>
1266 <option value="4">Volume, Issue</option>
1268 <!-- TMPL_IF name="numberpattern5" -->
1269 <option value="5" selected="selected">Number, Issue</option>
1271 <option value="5">Number, Issue</option>
1273 <!-- TMPL_IF name="numberpattern6" -->
1274 <option value="6" selected="selected">Seasonal only</option>
1276 <option value="6">Seasonal only</option>
1278 <!-- TMPL_IF name="numberpattern8" -->
1279 <option value="8" selected="selected">Year/Number</option>
1281 <option value="8">Year/Number</option>
1283 <!-- TMPL_IF name="numberpattern7" -->
1284 <option value="7" selected="selected">None of the above</option>
1286 <option value="7">None of the above</option>
1290 <li id="more_options"></li>
1291 <li id="irregularity"></li>
1292 <li id="displayexample"></li>
1294 <label for="beginning_date" class="required"> Subscription start date:</label>
1296 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1297 <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" style="border-width: 0px;" />
1298 <!-- both scripts for calendar must follow the input field -->
1299 <script type="text/javascript">
1301 inputField : "beginning_date",
1302 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1307 inputField : "beginning_date",
1308 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1309 button : "beginning_date",
1313 <span class="required">Required</span>
1316 <label for="subtype" class="required">Subscription length:</label>
1318 <select name="subtype" id="subtype">
1319 <!--TMPL_IF Name="subtype_monthlength"--><option value="monthlength" selected="selected"><!--TMPL_ELSE--><option value="monthlength"><!--/TMPL_IF--> Number of months</option>
1320 <!--TMPL_IF Name="subtype_numberlength"--><option value="numberlength" selected="selected"><!--TMPL_ELSE--><option value="numberlength"><!--/TMPL_IF--> Number of issues</option>
1321 <!--TMPL_IF Name="subtype_weeklength"--><option value="weeklength" selected="selected"><!--TMPL_ELSE--><option value="weeklength"><!--/TMPL_IF--> Number of weeks</option>
1323 <input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (enter amount in numerals)
1324 <span class="required">Required</span>
1327 <label for="ending_date"> Subscription end date:</label>
1329 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="buttonend1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1330 <input type="text" name="enddate" value="<!-- TMPL_VAR name="enddate" -->" size="13" maxlength="10" id="ending_date" style="border-width: 0px;" />
1331 <!-- both scripts for calendar must follow the input field -->
1332 <script type="text/javascript">
1334 inputField : "ending_date",
1335 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1336 button : "buttonend1",
1340 inputField : "ending_date",
1341 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1342 button : "ending_date",
1347 <li><label for="numberingmethod">Numbering formula:</label> <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" />
1352 <fieldset class="action">
1353 <input type="button" class="action_test" value="Test Prediction Pattern" onclick="javascript:irregularity_check()" />
1354 <input type="button" class="action_reset" value="Reset Pattern" onclick="javascript:reset_pattern()" />
1355 <input type="button" class="action_save" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1357 <fieldset class="action">
1358 <input type="button" class="action_advanced" value="Show/Hide Advanced Pattern" onclick="javascript:display_table()" />
1360 <div id="basetable" style="display: none;">
1361 <table class="small">
1362 <tr><th colspan="4">Advanced Prediction Pattern</th></tr>
1372 <input type="text" name="add1" id="add1" value="<!-- TMPL_VAR name="add1" -->" />
1375 <input type="text" name="add2" id="add2" value="<!-- TMPL_VAR name="add2" -->" />
1378 <input type="text" name="add3" id="add3" value="<!-- TMPL_VAR name="add3" -->" />
1383 <td><input type="text" name="every1" id="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
1384 <td><input type="text" name="every2" id="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
1385 <td><input type="text" name="every3" id="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
1388 <td>When more than</td>
1389 <td><input type="text" name="whenmorethan1" id="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
1390 <td><input type="text" name="whenmorethan2" id="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
1391 <td><input type="text" name="whenmorethan3" id="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
1394 <td>inner counter</td>
1395 <td><input type="text" name="innerloop1" id="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
1396 <td><input type="text" name="innerloop2" id="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
1397 <td><input type="text" name="innerloop3" id="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
1400 <td>Set back to</td>
1401 <td><input type="text" name="setto1" id="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
1402 <td><input type="text" name="setto2" id="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
1403 <td><input type="text" name="setto3" id="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
1407 <!-- TMPL_IF name="mod" -->
1413 <td><input type="text" name="lastvalue1" id="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
1414 <td><input type="text" name="lastvalue2" id="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
1415 <td><input type="text" name="lastvalue3" id="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
1427 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->