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 */
10 /* height: 2.4em; background-color: pink; */
13 <script type="text/javascript">
16 // the english words used in display purposes
17 var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern"),
18 _("Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
19 var weekno_label = _("Week # ");
21 var is_hemisphere = 1;
22 var irregular_issues; // will hold irregularity object.
24 function formatDate(myDate) {
25 var d = new Array( myDate.getFullYear(), myDate.getMonth() + 1 ,myDate.getDate());
26 if(d[1].toString().length == 1) { d[1] = '0'+d[1] };
27 if(d[2].toString().length == 1) { d[2] = '0'+d[2] };
28 <!-- TMPL_IF NAME="dateformat_us" -->
29 return(d[1] + '/' + d[2] + '/' + d[0]) ;
30 <!-- TMPL_ELSIF NAME="dateformat_metric" -->
31 return(d[2] + '/' + d[1] + '/' + d[0]) ;
33 return(''+d[0] + '-' + d[1] + '-' + d[2]) ;
37 Date.prototype.addDays = function(days) {
38 this.setDate(this.getDate()+days);
41 function getWeeksArray(startDate,periodicity) {
42 // returns an array of syspref-formatted dates starting at the first day of startDate's year.
43 // This prediction method will not accurately predict irregularites beyond the first year.
44 // FIXME : Should replace with ajax query to get the first Monday of the year so that week numbers have correct dates.
46 if(periodicity==3) { // 1/2 wks
48 } else if(periodicity == 4) { // 1/3 wks
51 var weeksArray = new Array;
52 var jan01 = new Date();
55 jan01.setFullYear(startDate.getFullYear());
56 for(var i=0;i<52;i++) {
57 weeksArray[i] = formatDate(jan01) + ' ' + weekno_label + (i + 1);
63 function YMDaToYWDa(S) {
64 with (new Date(Date.UTC(S[0], S[1] - 1, S[2]))) {
65 var DoW = getUTCDay();
66 setUTCDate(getUTCDate() - (DoW + 6) % 7 + 3);
69 var WN = Math.round((ms - valueOf()) / 604800000) + 1;
70 return [getUTCFullYear(), WN, DoW == 0 ? 7 : DoW];
73 function dayofyear(d) { // d is a Date object
74 var yn = d.getFullYear();
75 var mn = d.getMonth();
77 var d1 = new Date(yn,0,1,12,0,0); // noon on Jan. 1
78 var d2 = new Date(yn,mn,dn,12,0,0); // noon on input date
79 var ddiff = Math.round((d2-d1)/864e5);
84 // create irregularity object.
85 function IrregularPattern() {
86 this.months = new Array(_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December"));
87 this.seasons = new Array(_("Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"));
88 this.daynames = new Array(_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday"),_("Sunday"));
89 // create weeks irregularity selection array:
90 this.firstissue = new Date();
91 this.firstissue.setDate(1);
92 this.firstissue.setMonth(0);
93 <!-- TMPL_IF NAME='firstacquiyear' --> // it's a mod, we already have a start date.
94 this.firstissue.setFullYear( <!-- TMPL_VAR NAME="firstacquiyear" --> );
96 this.weeks = getWeeksArray(this.firstissue);
100 var irregular = '<!-- TMPL_VAR NAME="irregularity" -->';
101 this.skipped = irregular.split(',');
104 IrregularPattern.prototype.update = function() {
105 this.skipped= new Array;
107 // daily periodicity, we interpret irregular array as which days of week to skip.
108 // else if weekly periodicity, week numbers (starting from 01 Jan) to skip.
109 // else irregular array is list of issues to skip
110 var summary_str = '';
112 if(document.f.irregularity_select) {
113 //$("#irregularity_select option:selected").each(...); //jquery can combine both conditionals and the for loop
114 for( var i in document.f.irregularity_select.options ) {
115 if( document.f.irregularity_select.options[i].selected ) {
116 this.skipped[cnt] = document.f.irregularity_select.options[i].value ;
117 summary_str += document.f.irregularity_select.options[i].text + "\n" ;
122 var summary = document.getElementById("irregularity_summary");
124 summary.value = summary_str;
125 summary.rows= ( cnt > 6 ) ? cnt : 6 ; // textarea will bre resized, but not more than 6 lines will show.
130 IrregularPattern.prototype.irregular = function(index) {
131 for( var i in this.skipped) {
132 if( this.skipped[i] == index) {
139 function init_pattern() {
140 irregular_issues = new IrregularPattern();
142 function reset_pattern() {
143 document.getElementById("numberpattern").value = '';
144 document.getElementById("irregularity").innerHTML = '';
149 // common pre defined number patterns
150 function reset_num_pattern() {
151 var patternchoice = document.getElementById("numberpattern").value;
152 switch(patternchoice){
154 document.f.add1.value=1;
155 document.f.add2.value=1;
156 document.f.add3.value=1;
157 document.f.every1.value=12;
158 document.f.every2.value=1;
159 document.f.every3.value=1;
160 document.f.whenmorethan1.value=9999999;
161 document.f.whenmorethan2.value=12;
162 document.f.whenmorethan3.value=4;
163 document.f.setto1.value=0;
164 document.f.setto2.value=1;
165 document.f.setto3.value=1;
166 document.f.lastvalue1.value=1;
167 document.f.lastvalue2.value=1;
168 document.f.lastvalue3.value=1;
169 document.f.numberingmethod.value=_("Vol {X}, No {Y}, Issue {Z}");
170 moreoptions(text[1],text[0],text[2]);
171 display_table(0); // toggle info box on (1) or off (0)
174 document.f.add1.value=1;
175 document.f.add2.value=1;
176 document.f.add3.value='';
177 document.f.every1.value=12;
178 document.f.every2.value=1;
179 document.f.every3.value='';
180 document.f.whenmorethan1.value=9999999;
181 document.f.whenmorethan2.value=12;
182 document.f.whenmorethan3.value='';
183 document.f.setto1.value=0;
184 document.f.setto2.value=1;
185 document.f.setto3.value='';
186 document.f.lastvalue1.value=1;
187 document.f.lastvalue2.value=1;
188 document.f.lastvalue3.value='';
189 document.f.numberingmethod.value=_("Vol {X}, No {Y}");
190 moreoptions(text[1],text[0]);
194 document.f.add1.value=1;
195 document.f.add2.value=1;
196 document.f.add3.value='';
197 document.f.every1.value=12;
198 document.f.every2.value=1;
199 document.f.every3.value='';
200 document.f.whenmorethan1.value=9999999;
201 document.f.whenmorethan2.value=12;
202 document.f.whenmorethan3.value='';
203 document.f.setto1.value=0;
204 document.f.setto2.value=1;
205 document.f.setto3.value='';
206 document.f.lastvalue1.value=1;
207 document.f.lastvalue2.value=1;
208 document.f.lastvalue3.value='';
209 document.f.numberingmethod.value=_("Vol {X}, Issue {Y}");
210 moreoptions(text[1],text[2]);
214 // var d = new Date(document.f.firstacquidate.value);
215 // var smonth = d.getMonth();
216 document.f.add1.value=1;
217 document.f.add2.value=1;
218 document.f.add3.value='';
219 document.f.every1.value=12;
220 document.f.every2.value=1;
221 document.f.every3.value='';
222 document.f.whenmorethan1.value=9999999;
223 document.f.whenmorethan2.value=12;
224 document.f.whenmorethan3.value='';
225 document.f.setto1.value=0;
226 document.f.setto2.value=1;
227 document.f.setto3.value='';
228 document.f.numberingmethod.value=_("No {X}, Issue {Y}");
229 moreoptions(text[0],text[2]);
233 var d = new Date(document.f.firstacquidate.value);
234 var sYear = d.getFullYear();
235 moreoptions_seasons(text[15],sYear);
236 var d = new Date(document.f.firstacquidate.value);
237 var sYear = d.getFullYear();
238 document.f.add1.value=1;
239 document.f.add2.value='1';
240 document.f.add3.value='';
241 document.f.every1.value=4;
242 document.f.every2.value='1';
243 document.f.every3.value='';
244 document.f.whenmorethan1.value=9999999;
245 document.f.whenmorethan2.value='4';
246 document.f.whenmorethan3.value='';
247 document.f.setto1.value=0;
248 document.f.setto2.value='1';
249 document.f.setto3.value='';
250 document.f.periodicity.value='8';
251 document.f.numberingmethod.value=_("{Y} {X}");
252 moreoptions_seasons(text[15],sYear);
253 document.f.lastvalue1temp.value=document.f.lastvalue1.value=sYear;
259 document.getElementById("more_options").innerHTML = '';
260 document.f.irreg_check.value=1;
262 case "8": // Year/Number
263 var d = (document.f.firstacquidate.value) ? new Date( document.f.firstacquidate.value) : new Date() ;
264 var sYear = d.getFullYear();
265 document.f.add1.value=1;
266 document.f.add2.value=1;
267 document.f.add3.value='';
268 document.f.every1.value=12;
269 document.f.every2.value=1;
270 document.f.every3.value='';
271 document.f.whenmorethan1.value=9999999;
272 document.f.whenmorethan2.value=12;
273 document.f.whenmorethan3.value='';
274 document.f.setto1.value=0;
275 document.f.setto2.value=1;
276 document.f.setto3.value='';
277 document.f.lastvalue1.value=sYear;
278 switch (document.f.periodicity.value){
280 var doy = dayofyear(d);
281 document.f.lastvalue2.value=doy;
282 document.f.whenmorethan2.value=365;
285 var doy = dayofyear(d);
286 document.f.lastvalue2.value=doy*2;
287 document.f.whenmorethan2.value=730;
292 var YWDa = YMDaToYWDa(d);
293 document.f.lastvalue2.value=YWDA[1]/(document.f.periodicity.value-1);
296 var smonth = d.getMonth();
297 document.f.lastvalue2.value=smonth;
300 var smonth = d.getMonth();
301 document.f.lastvalue2.value=smonth/2;
302 document.f.whenmorethan2.value=6;
306 var smonth = d.getMonth();
307 document.f.lastvalue2.value=smonth/3;
308 document.f.whenmorethan2.value=4;
311 var smonth = d.getMonth();
312 document.f.lastvalue2.value=smonth/6;
313 document.f.whenmorethan2.value=2;
317 document.f.lastvalue3.value='';
318 document.f.numberingmethod.value=_("{X} / {Y}");
319 moreoptions(text[16],text[0]);
320 // document.f.lastvalue1temp.value=sYear;
321 // document.f.lastvalue2temp.value=document.f.lastvalue2.value;
325 document.f.add1.value=1;
326 document.f.add2.value='';
327 document.f.add3.value='';
328 document.f.every1.value=1;
329 document.f.every2.value='';
330 document.f.every3.value='';
331 document.f.whenmorethan1.value=9999999;
332 document.f.whenmorethan2.value='';
333 document.f.whenmorethan3.value='';
334 document.f.setto1.value=0;
335 document.f.setto2.value='';
336 document.f.setto3.value='';
337 document.f.lastvalue1.value=1;
338 document.f.lastvalue2.value='';
339 document.f.lastvalue3.value='';
340 document.f.numberingmethod.value='{X}';
341 // moreoptions_daily_check(text[0]);
342 moreoptions(text[0]);
343 document.f.irreg_check.value=1;
349 function display_table(n) {
351 document.getElementById("basetable").style.display = 'block';
353 document.getElementById("basetable").style.display = 'none';
355 var disp_val = ( document.getElementById("basetable").style.display == 'none' ) ? 'block' : 'none' ;
356 document.getElementById("basetable").style.display = disp_val;
360 function set_num_pattern_from_template_vars() {
361 if(!document.getElementById("numberpattern")){ return false; }
362 document.getElementById("numberpattern").value = '<!-- TMPL_VAR NAME="numberpattern" -->';
365 document.f.add1.value='<!-- TMPL_VAR NAME="add1" -->';
366 document.f.add2.value='<!-- TMPL_VAR NAME="add2" -->';
367 document.f.add3.value='<!-- TMPL_VAR NAME="add3" -->';
368 document.f.every1.value='<!-- TMPL_VAR NAME="every1" -->';
369 document.f.every2.value='<!-- TMPL_VAR NAME="every2" -->';
370 document.f.every3.value='<!-- TMPL_VAR NAME="every3" -->';
371 document.f.whenmorethan1.value='<!-- TMPL_VAR NAME="whenmorethan1" -->';
372 document.f.whenmorethan2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
373 document.f.whenmorethan3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
374 document.f.setto1.value='<!-- TMPL_VAR NAME="setto1" -->';
375 document.f.setto2.value='<!-- TMPL_VAR NAME="setto2" -->';
376 document.f.setto3.value='<!-- TMPL_VAR NAME="setto3" -->';
377 document.f.lastvalue1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
378 document.f.lastvalue2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
379 document.f.lastvalue3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
380 document.f.numberingmethod.value='<!-- TMPL_VAR NAME="numberingmethod" -->';
384 <!-- TMPL_IF NAME="add2" -->
385 if(<!-- TMPL_VAR NAME="add2" --> > 0){
389 <!-- TMPL_IF NAME="add3" -->
390 if(<!-- TMPL_VAR NAME="add3" --> > 0){
394 document.f.lastvalue1temp.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
396 document.f.lastvalue2temp.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
397 document.f.whenmorethan2temp.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
400 document.f.lastvalue3temp.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
401 document.f.whenmorethan3temp.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
405 // a pre check with more options to see if 'number' and '1/day' are chosen
406 function moreoptions_daily_check(x) {
407 var periodicity = document.f.periodicity.value;
409 if(periodicity == 1){ // i.e. daily
410 document.getElementById("irregularity").innerHTML = '';
411 errortext =_("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
412 for(var j=0;j<irregular_issues.daynames.length;j++){
413 errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+irregular_issues.daynames[j]+" ";
415 var error = errortext;
417 document.getElementById("irregularity").innerHTML = error;
419 document.getElementById("irregularity").innerHTML = '';
420 document.getElementById("more_options").innerHTML = '';
425 // to dispaly the more options section
426 function moreoptions(x,y,z){
427 document.getElementById("irregularity").innerHTML = '';
428 document.getElementById("more_options").innerHTML = '';
430 // alert("X: "+x+"Y: "+y+"Z: "+z);
432 textbox +="<table id='irregularity_table'>\n<tr><th> <\/th><th>"+x+"<\/th>";
434 textbox +="<th>"+y+"<\/th>";
436 textbox +="<th>"+z+"<\/th>";
439 textbox +="<\/tr>\n";
440 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";
442 textbox +="<td><input type='text' name='lastvalue2temp' id='lastvalue2temp' size='4' onkeyup='moreoptionsupdate(this)' value=\"" + document.f.lastvalue2.value + "\" /><\/td>\n";
444 textbox +="<td><input type='text' name='lastvalue3temp' id='lastvalue3temp' size='4' onkeyup='moreoptionsupdate(this)' value=\"" + document.f.lastvalue3.value + "\" /><\/td>\n";
447 textbox +="<\/tr>\n";
449 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
450 textbox +="<td> <\/td>\n";
451 textbox +="<td><input type='text' name='whenmorethan2temp' id='whenmorethan2temp' size='4' onkeyup='moreoptionsupdate(this,1)'><\/td>\n";
453 textbox +="<td><input type='text' name='whenmorethan3temp' id='whenmorethan3temp' size='4' onkeyup='moreoptionsupdate(this,1)'><\/td>\n";
457 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>";
459 textbox +="<\/table>\n";
461 document.getElementById("more_options").innerHTML = textbox;
464 function hemispheres(chosen){
465 var selbox = document.getElementById("season1");
467 var selboxselected = selbox.options[selbox.selectedIndex].value;
468 selbox.options.length = 0;
470 if ( (chosen == "1") || ( ! (chosen) && is_hemisphere == 1 )) {
471 selbox.options[selbox.options.length] = new Option(text[11],'1');
472 selbox.options[selbox.options.length] = new Option(text[12],'2');
473 selbox.options[selbox.options.length] = new Option(text[13],'3');
474 selbox.options[selbox.options.length] = new Option(text[14],'4');
476 selbox.options[selboxselected-1].selected = true;
479 if ( (chosen == "2") || ( ! (chosen) && is_hemisphere == 2 )) {
480 selbox.options[selbox.options.length] = new Option(text[13],'1');
481 selbox.options[selbox.options.length] = new Option(text[10],'2');
482 selbox.options[selbox.options.length] = new Option(text[11],'3');
483 selbox.options[selbox.options.length] = new Option(text[12],'4');
485 selbox.options[selboxselected-1].selected = true;
490 // to display the more options section for seasons
491 function moreoptions_seasons(x,y){
492 // x = 'Season'. y = 'Year'.
493 document.getElementById("irregularity").innerHTML = '';
494 document.getElementById("more_options").innerHTML = '';
496 //alert("X: "+x+"Year: "+y);
498 var hemi_select = parseInt('<!-- TMPL_VAR NAME="hemisphere" -->');
499 textbox +="<li><label for=\"hemisphere\">"+ text[7] +"<\/label><select name='hemisphere' id=\"hemisphere\" onchange='hemispheres(this.options[this.selectedIndex].value)'>";
500 for(var i = 1; i <= 2; i++){
501 textbox +="<option value='"+i+"'";
502 if(i == hemi_select){
503 textbox += " selected "
505 textbox +=">"+text[i+7]+"<\/option>";
507 textbox +="<\/li>\n";
508 textbox +="<table id='seasonal_irregularity'><tr><th> <\/th><th>"+x+"<\/th>";
509 textbox +="<th>"+text[16]+"<\/th>";
510 textbox +="<\/tr>\n";
511 textbox +="<tr><th scope=\"row\">"+text[5]+"<\/th><td><select name='lastvalue2temp' id='lastvalue2temp' id='season1' onchange='moreoptionsupdate(this)'>";
512 for(var j = 1; j <= 4; j++){
513 textbox +="<option value='"+j+"'>"+text[j+9]+"<\/option>";
515 textbox +="<\/select><\/td>";
516 var isyr = irregular_issues.firstissue;
517 textbox += "<td>" + irregular_issues.firstissue.getFullYear() + "<\/td><\/tr>\n";
518 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
519 textbox +="<td><input type='text' name='whenmorethan2temp' id='whenmorethan2temp' size='4' onkeyup='moreoptionsupdate(this,1)'><\/td>\n";
520 textbox +="<\/tr><\/table>\n";
522 document.getElementById("more_options").innerHTML = textbox;
525 function irregularity_check(){
526 document.f.irreg_check.value = 1; // Irregularity button now pushed
527 var periodicity = document.f.periodicity.value;
528 var rollover = document.f.issuesexpected1.value;
529 if( (document.f.whenmorethan2) && ( document.f.whenmorethan2.value > 0) ){
530 rollover = document.f.whenmorethan2.value;
532 if((document.f.whenmorethan3) && document.f.whenmorethan3.value > 0 ){
533 // FIXME: Irregularity check assumes that the full prediction pattern repeats each year.
534 // In cases where the outermost periodicity is > 1 year,
535 // e.g. where a volume spans two years, the irregularity check will be incorrect,
536 // but you can safely ignore the check, submit the form, and the prediction pattern should be correct.
537 // a way to distinguish between these two cases is needed.
538 rollover = document.f.whenmorethan3.value * document.f.whenmorethan2.value;
543 var errortext = _("<b>Warning irregularity detected<\/b><br \/>");
546 if(rollover < 730) expected =730;
553 if(rollover < 365) expected =365;
560 if(rollover < 52) expected =52;
567 if(rollover < 26) expected =26;
574 if(rollover < 17) expected =17;
581 if(rollover < 12) expected =12;
588 if(rollover < 6) expected =6;
595 if(rollover < 4) expected =4;
602 if(rollover < 4) expected =4;
609 if(rollover < 2) expected =2;
616 if(rollover < 1) expected =1;
626 if(expected == 365 || expected==730){ // what about leap years ?
627 // FIXME: We interpret irregularity as which days per week for periodicity==1.
628 // We need two cases: one in which we're published n days/week, in which case irregularity should be per week,
629 // and a regular daily pub, where irregularity should be per year.
630 errortext += _("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
632 errortext +=expected+_(" issues expected, ")+rollover+_(" were entered. <br \/>Please indicate which date(s) an issue is not expected<br \/>");
633 irregular_issues.numskipped = expected - rollover;
635 errortext +="<select multiple id='irregularity_select' name='irregularity_select' onchange='irregular_issues.update();'>\n";
636 errortext +=irregular_options(periodicity);
637 errortext += "<\/select>\n <textarea rows='6' width='18' id='irregularity_summary' name='irregularity_summary' value='foo' />";
641 errortext +=expectedover+_(" issues expected, ")+rollover+_(" were entered.<p class='warning'> You seem to have indicated more issues per year than expected.<\/p>");
644 if(error.length ==0){
645 error=_("No irregularities noticed");
647 display_example(expected);
648 document.getElementById("irregularity").innerHTML = error;
649 irregular_issues.update();
652 function irregular_options(periodicity){
656 var numberpattern = document.getElementById('numberpattern').value;
657 if(periodicity == 1) {
659 titles = irregular_issues.daynames;
662 if(periodicity == 2 || periodicity == 3 || periodicity == 4) {
663 titles = irregular_issues.weeks;
665 if(periodicity==3) { // 1/2 wks
667 } else if(periodicity == 4) { // 1/3 wks
673 if(periodicity == 5 || periodicity == 6 || periodicity == 7 || periodicity == 8 || periodicity == 9) {
674 if(periodicity == 8 && numberpattern==8) {
675 is_season = 1; // setting up from edit page
678 titles = irregular_issues.seasons;
680 if(is_hemisphere == 2){
686 titles = irregular_issues.months;
692 return ''; // don't know how to deal with irregularity.
694 for(var j=0;j<expected;j++){ // rch - changed frrom (1..expected).
697 count = count-expected;
699 if(is_season && is_hemisphere == 1){
700 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j]+"<\/option>\n";
701 // alert("value: "+((count*3)-2)+" title: "+titles[j]);
702 } else if(is_season && is_hemisphere == 2){
703 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j-1]+"<\/option>\n";
704 // alert("value: "+((count*3)-2)+" title: "+titles[j-1]);
705 } else { // all non-seasonal periodicities:
706 var incr=1; // multiplier for ( 1/n weeks) patterns; in this case the irreg calc relies on the week# , not the issue#.
707 if(periodicity==3) { // 1/2 wks
709 } else if(periodicity == 4) { // 1/3 wks
712 errortext += "<option value='" + (1+j*incr) ;
713 if(irregular_issues.irregular(1+incr*j)) {
714 errortext += "' selected='selected" ;
716 errortext += "'>"+titles[incr*j]+"<\/option>\n";
720 errortext +="<option value='"+j+"'>"+titles+" "+j+"<\/option>\n";
727 function display_example(expected){
728 var startfrom1 = parseInt(document.f.lastvalue1.value);
729 var startfrom2 = parseInt(document.f.lastvalue2.value);
730 var startfrom3 = parseInt(document.f.lastvalue3.value);
731 var every1 = parseInt(document.f.every1.value);
732 var every2 = parseInt(document.f.every2.value);
733 var every3 = parseInt(document.f.every3.value);
734 var numberpattern = document.f.numberingmethod.value;
735 var whenmorethan2 = parseInt(document.f.whenmorethan2.value);
736 var whenmorethan3 = parseInt(document.f.whenmorethan3.value);
737 var setto2 = parseInt(document.f.setto2.value);
738 var setto3 = parseInt(document.f.setto3.value);
739 var displaytext = _("Based on the information entered, the Numbering Pattern will look like this: ") + "<br \/><ul class=\"numpattern_preview\">";
741 var count=startfrom3-1;
742 var count2=startfrom2;
743 for(var i = 0 ; i < 12; i++){
744 if(count>=whenmorethan3){
746 if(count2>=whenmorethan2){
755 displaytext += '<li>' + numberpattern.replace(/{Z}/,count) + '<\/li>\n';
756 displaytext = displaytext.replace(/{Y}/,count2);
757 displaytext = displaytext.replace(/{X}/,startfrom1);
761 if(startfrom2>0 && !startfrom3){
762 var count=startfrom2-1;
763 for(var i=0;i<12;i++){
764 if(count>=whenmorethan2){
772 if(is_hemisphere == 2){
774 displaytext += numberpattern.replace(/{Y}/,text[count+12])+'\n';
776 displaytext += numberpattern.replace(/{Y}/,text[count+8])+'\n';
779 displaytext += numberpattern.replace(/{Y}/,text[count+10])+'\n';
782 displaytext += numberpattern.replace(/{Y}/,count)+'\n';
784 displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
787 if(startfrom1>0 && !startfrom2 && !startfrom3){
788 var offset=eval(document.f.issuesexpected1.value);
792 for(var i=startfrom1;i<(startfrom1+offset);i+=every1){
793 displaytext += numberpattern.replace(/{X}/,i)+'<br \/>\n';
796 // displaytext = "<div style='padding: 5px; background-color: #CCCCCC'>"+displaytext+"<\/div>";
797 document.getElementById("displayexample").innerHTML = displaytext;
800 function isArray(obj) {
801 if (obj.constructor.toString().indexOf("Array") == -1)
807 function moreoptionsupdate(inputfield,rollover){
808 fieldname = inputfield.name;
809 // find parent element in base table by stripping 'temp' from element name.
810 basefield = document.getElementById(fieldname.slice(0,-4));
811 var fieldnumber = fieldname.slice(-5,-4);
813 basefield.value = inputfield.value;
814 var patternchoice = document.getElementById("numberpattern").value;
815 switch(patternchoice){
819 case "8": // Year, Number. -- Why not just use Vol, Number withvol==year??
820 // FIXME: this my conflict with innerloop calc below.
821 if (document.f.lastvalue2temp.value > 0){document.f.innerloop1.value = document.f.lastvalue2temp.value - 1;}
824 if(basefield.name.slice(0,-1) == 'lastvalue' || 'whenmorethan' ) {
825 // The enumeration string is held in a positional numeral notation with three positions, X,Y,Z.
826 // The last values lastvalue1, lastvalue2,lastvalue3 should match the last received serial's X,Y,Z enumeration.
827 // make array indexes start with 1 for consistency with variable names.
828 var innerloop = new Array( undefined, document.getElementById('innerloop1'), document.getElementById('innerloop2'), document.getElementById('innerloop3') );
829 var lastvalue = new Array( undefined, document.getElementById('lastvalue1').value *1 , document.getElementById('lastvalue2').value *1 , document.getElementById('lastvalue3').value *1 );
830 var every = new Array( undefined, document.getElementById('every1').value *1 , document.getElementById('every2').value *1 , document.getElementById('every3').value *1 );
831 var add = new Array( undefined, document.getElementById('add1').value *1 , document.getElementById('add2').value *1 , document.getElementById('add3').value *1 );
832 var whenmorethan = new Array( undefined, document.getElementById('whenmorethan1').value *1 , document.getElementById('whenmorethan2').value *1 , document.getElementById('whenmorethan3').value *1 );
835 // calculate rollover for higher level of periodicity.
836 // if there are two levels of periodicity, (e.g. vol{X},num{Y},issue{Z}, then every1=every2*whenmorethan2 / add2 .
837 for(var N=3;N>1;N--){
839 var addN = (add[N]) ? add[N] : 1 ;
840 var everyN = (document.getElementById('every'+N)) ? document.getElementById('every'+N).value : 1 ;
841 document.getElementById('every'+(N-1)).value = whenmorethan[N] * everyN / addN ;
845 innerloop[3].value = ( every[3] > 1 ) ? lastvalue[3] % every[3] : 0 ;
846 innerloop[2].value = ( every[2] > 1 ) ? lastvalue[3] - 1 : 0 ;
847 innerloop[1].value = ( every[1] > 1 ) ?
848 ( whenmorethan[3] > 0 ) ? (lastvalue[2] - 1) * every[2] + 1* innerloop[2].value
852 //FIXME : add checks for innerloop || lastvalue .gt. rollover
856 function check_input(e){
857 var unicode=e.charCode? e.charCode : e.keyCode
858 if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
859 if (unicode<48||unicode>57) { // if not a number
860 alert(_("Needs to be entered in digit form -eg 10"));
861 return false // disable key press
866 function addbiblioPopup(biblionumber) {
867 var destination = "/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup";
868 if(biblionumber){ destination += "&biblionumber="+biblionumber; }
869 window.open(destination,'AddBiblioPopup','width=1024,height=768,toolbar=no,scrollbars=yes');
874 window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
877 function FindAcqui(f)
879 window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
882 function Find_ISSN(f)
884 window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
889 if (f.aqbooksellerid.value.length==0) {
890 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"));
891 if (input_box==true) {
897 if (f.biblionumber.value.length==0) {
898 alert(_("You must choose or create a biblio"));
899 } else if(f.startdate.value.length != 0 && f.sublength.value > 0) {
900 if (f.irreg_check.value == 1) {
903 if(f.numbering_pattern.value == ''){
904 alert(_("Please choose a numbering pattern"));
906 alert(_("Please check for irregularity by clicking 'Test Prediction Pattern'"));
910 alert(_("You must choose a start date and a subscription length"));
912 if(irregular_issues.numskipped < irregular_issues.skipped.length ) {
913 alert(_("You have not accounted for all missing issues."));
918 $(document).ready(function() {
920 <!-- TMPL_IF name="mod" -->
921 set_num_pattern_from_template_vars();
922 <!-- TMPL_IF name="hemisphere" -->
923 is_hemisphere = <!-- TMPL_VAR NAME="hemisphere" --> ;
927 <!-- TMPL_IF name="irregularity" -->
928 irregularity_check();
930 $('#numberpattern').change( function() {
938 <!-- TMPL_INCLUDE NAME="header.inc" -->
939 <!-- TMPL_INCLUDE NAME="serials-search.inc" -->
941 <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>
943 <div id="doc3" class="yui-t7">
947 <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>
948 <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
949 <!-- TMPL_IF name="mod" -->
950 <input type="hidden" name="op" value="modsubscription" />
951 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
953 <input type="hidden" name="op" value="addsubscription" />
955 <input type="hidden" name="user" value="<!-- TMPL_VAR name="loggedinusername" -->" />
956 <input type="hidden" name="irreg_check" value="0" />
957 <input type="hidden" name="issuesexpected1" id="issuesexpected1" value="0" />
959 <div class="yui-u first">
960 <fieldset id="subscription_add_information" class="rows">
961 <legend>Subscription details</legend>
963 <li><span class="label">Subscription #</span> <!--TMPL_VAR name="subscriptionid"--></li>
964 <li><span class="label">Librarian: </span> <!-- TMPL_VAR name="loggedinusername" --></li>
966 <label for="aqbooksellerid">Vendor: </label>
967 <input type="text" name="aqbooksellerid" id="aqbooksellerid" value="<!-- TMPL_VAR name="aqbooksellerid" -->" size="8" /> (<input type="text" name="aqbooksellername" value="<!-- TMPL_VAR name="aqbooksellername" -->" disabled="disabled" readonly="readonly" />) <div class="inputnote"><a href="#" onclick="FindAcqui(f)">Search for a vendor</a></div>
970 <label for="biblionumber" class="required" title="Subscriptions must be associated with a bibliographic record">Biblio:</label>
972 <input type="text" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR name="bibnum" -->" size="8" />
973 (<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>
974 <div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a> | <!--TMPL_IF Name="mod"--><a href="#" onclick="addbiblioPopup(<!-- TMPL_VAR NAME="bibnum" -->); return false;">Edit biblio</a><!-- TMPL_ELSE -->
975 <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a><!--/TMPL_IF--></div>
979 <!-- TMPL_IF name="serialsadditems" -->
980 <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>
981 <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>
983 <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>
984 <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>
988 <label for="location">Location:</label>
989 <input type="text" name="location" id="location" value="<!-- TMPL_VAR name="location" -->" size="30" />
992 <label for="callnumber">Call Number:</label>
993 <input type="text" name="callnumber" id="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" />
996 <label for="branchcode">Library:</label>
998 <select name="branchcode" id="branchcode" style="width: 20em;">
999 <!-- TMPL_UNLESS NAME="Independantbranches" --><option value="">None</option><!-- /TMPL_UNLESS -->
1000 <!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
1002 <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
1005 </select> (select a library)
1009 <label for="graceperiod">Grace period:</label> <input type="text" name="graceperiod" id="graceperiod" value="<!-- TMPL_VAR name="graceperiod" -->" /> day(s)
1012 <label for="notes">Public note:</label>
1013 <textarea name="notes" id="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea>
1016 <label for="internalnotes">Nonpublic note:</label>
1017 <textarea name="internalnotes" id="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea>
1020 <label for="letter">Patron notification: </label>
1022 <!-- TMPL_IF NAME="letterloop" -->
1023 <select name="letter" id="letter">
1024 <option value="">None</option>
1025 <!-- TMPL_LOOP name="letterloop" -->
1026 <!-- TMPL_IF name="selected" -->
1027 <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
1029 <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
1033 <div class="hint">Select a notice and patrons on the routing list will be notified when new issues are received.</div>
1035 <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>
1039 <label for="staffdisplaycount">Staff and Public Display</label>
1041 <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label>
1042 <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="<!-- TMPL_VAR NAME="staffdisplaycount" -->" size="4"/>
1045 <label class="widelabel" for="opacdisplaycount">Number of issues to display to the public: </label>
1046 <input type="text" name="opacdisplaycount" id="opacdisplaycount" value="<!-- TMPL_VAR NAME="opacdisplaycount" -->" size="4"/>
1051 <div style="float:left;clear:left;margin:1em;"><strong>Note:</strong>
1054 <li>The subscription <strong>must</strong> be associated with a bibliographic record.</li>
1055 <li>You <strong>must</strong> select a vendor if you wish to generate claims.</li>
1063 <div id="subscription_form_planning">
1064 <fieldset class="rows">
1065 <legend>Serials planning</legend>
1068 <label for="acqui_date"> First issue publication date:</label>
1069 <!-- 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 -->
1070 <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;" />
1072 <!-- TMPL_IF NAME="mod" --><li><label for="next_acqui_date"> Next issue publication date:</label>
1073 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="next_acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1074 <input type="text" name="nextacquidate" value="<!-- TMPL_VAR name="nextacquidate" -->" size="13" maxlength="10" id="next_acqui_date" style="border-width: 0px;" />
1075 </li><!-- /TMPL_IF -->
1077 <li><!-- both scripts for calendar must follow the input field -->
1078 <script type="text/javascript">
1080 inputField : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_date",
1081 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1082 button : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_button",
1084 onUpdate : function(cal) {
1085 irregular_issues.weeks = getWeeksArray(cal.date);
1086 irregular_issues.firstissue = cal.date;
1087 if(document.irregularity_summary) {
1088 irregular_issues.update();
1090 if(document.getElementById("seasonal_irregularity")) {
1091 moreoptions_seasons(text[15]);
1096 inputField : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_date",
1097 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1098 button : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_date",
1100 onUpdate : function(cal) { irregular_issues.weeks = getWeeksArray(cal.date);
1101 irregular_issues.firstissue = cal.date;
1102 if(document.irregularity_summary) {
1103 irregular_issues.update();
1105 if(document.getElementById("seasonal_irregularity")) {
1106 moreoptions_seasons(text[15]);
1111 <label for="periodicity" class="required">Frequency:</label>
1113 <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1); reset_num_pattern();">
1114 <option value="" selected="selected">-- please choose --</option>
1115 <!-- TMPL_IF name="periodicity16" -->
1116 <option value="16" selected="selected">Without periodicity</option>
1118 <option value="16">Without periodicity</option>
1120 <!-- TMPL_IF name="periodicity48" -->
1121 <option value="48" selected="selected">Unknown</option>
1123 <option value="48">Unknown</option>
1125 <!-- TMPL_IF name="periodicity32" -->
1126 <option value="32" selected="selected">Irregular</option>
1128 <option value="32">Irregular</option>
1131 <!-- TMPL_IF name="periodicity12" -->
1132 <option value="12" selected="selected">2/day</option>
1134 <option value="12">2/day</option>
1136 <!-- TMPL_IF name="periodicity1" -->
1137 <option value="1" selected="selected">daily (n/week)</option>
1139 <option value="1">daily (n/week)</option>
1141 <!-- TMPL_IF name="periodicity2" -->
1142 <option value="2" selected="selected">1/week</option>
1144 <option value="2">1/week</option>
1146 <!-- TMPL_IF name="periodicity3" -->
1147 <option value="3" selected="selected">1/2 weeks </option>
1149 <option value="3">1/2 weeks </option>
1151 <!-- TMPL_IF name="periodicity4" -->
1152 <option value="4" selected="selected">1/3 weeks</option>
1154 <option value="4">1/3 weeks</option>
1156 <!-- TMPL_IF name="periodicity5" -->
1157 <option value="5" selected="selected">1/month</option>
1159 <option value="5">1/month</option>
1161 <!-- TMPL_IF name="periodicity6" -->
1162 <option value="6" selected="selected">1/2 months (6/year)</option>
1164 <option value="6">1/2 months (6/year)</option>
1166 <!-- TMPL_IF name="periodicity7" -->
1167 <option value="7" selected="selected">1/3 months (1/quarter)</option>
1169 <option value="7">1/3 months (1/quarter)</option>
1171 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
1172 <!-- TMPL_IF name="periodicity8" -->
1173 <option value="8" selected="selected">1/quarter (seasonal)</option>
1175 <option value="8">1/quarter (seasonal)</option>
1178 <!-- TMPL_IF name="periodicity9" -->
1179 <option value="9" selected="selected">2/years</option>
1181 <option value="9">2/year</option>
1183 <!-- TMPL_IF name="periodicity10" -->
1184 <option value="10" selected="selected">1/year</option>
1186 <option value="10">1/year</option>
1188 <!-- TMPL_IF name="periodicity11" -->
1189 <option value="11" selected="selected">1/2 years</option>
1191 <option value="11">1/2 years</option>
1193 </select> <span class="required">Required</span></li>
1195 <label for="manuallist"> Manual history:</label>
1196 <!-- TMPL_IF name="manualhistory" -->
1197 <input type="checkbox" name="manualhist" id="manuallist" value="1" checked="checked" />
1199 <input type="checkbox" name="manualhist" id="manuallist" value="1" />
1203 <label for="numberpattern"> Numbering pattern:</label>
1205 <select name="numbering_pattern" size="1" id="numberpattern" >
1206 <option value="" selected="selected">-- please choose --</option>
1207 <!-- TMPL_IF name="numberpattern1" -->
1208 <option value="1" selected="selected">Number</option>
1210 <option value="1">Number</option>
1212 <!-- TMPL_IF name="numberpattern2" -->
1213 <option value="2" selected="selected">Volume, Number, Issue</option>
1215 <option value="2">Volume, Number, Issue</option>
1217 <!-- TMPL_IF name="numberpattern3" -->
1218 <option value="3" selected="selected">Volume, Number</option>
1220 <option value="3">Volume, Number</option>
1222 <!-- TMPL_IF name="numberpattern4" -->
1223 <option value="4" selected="selected">Volume, Issue</option>
1225 <option value="4">Volume, Issue</option>
1227 <!-- TMPL_IF name="numberpattern5" -->
1228 <option value="5" selected="selected">Number, Issue</option>
1230 <option value="5">Number, Issue</option>
1232 <!-- TMPL_IF name="numberpattern6" -->
1233 <option value="6" selected="selected">Seasonal only</option>
1235 <option value="6">Seasonal only</option>
1237 <!-- TMPL_IF name="numberpattern8" -->
1238 <option value="8" selected="selected">Year/Number</option>
1240 <option value="8">Year/Number</option>
1242 <!-- TMPL_IF name="numberpattern7" -->
1243 <option value="7" selected="selected">None of the above</option>
1245 <option value="7">None of the above</option>
1249 <li id="more_options"></li>
1250 <li id="irregularity"></li>
1251 <li id="displayexample"></li>
1253 <label for="beginning_date" class="required"> Subscription start date:</label>
1255 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1256 <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" style="border-width: 0px;" />
1257 <!-- both scripts for calendar must follow the input field -->
1258 <script type="text/javascript">
1260 inputField : "beginning_date",
1261 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1266 inputField : "beginning_date",
1267 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1268 button : "beginning_date",
1272 <span class="required">Required</span>
1275 <label for="subtype" class="required">Subscription length:</label>
1277 <select name="subtype" id="subtype">
1278 <!-- TMPL_LOOP NAME="subtype" -->
1279 <!-- TMPL_IF NAME="selected" -->
1280 <option value="<!-- TMPL_VAR NAME="name" -->" selected="selected">
1282 <option value="<!-- TMPL_VAR NAME="name" -->">
1284 <!-- TMPL_VAR NAME="name" -->
1288 <input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (enter amount in numerals)
1289 <span class="required">Required</span>
1291 <li><label for="numberingmethod">Numbering formula:</label> <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" />
1296 <fieldset class="action">
1297 <input type="button" class="action_test" value="Test Prediction Pattern" onclick="javascript:irregularity_check()" />
1298 <input type="button" class="action_reset" value="Reset Pattern" onclick="javascript:reset_pattern()" />
1299 <input type="button" class="action_save" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1301 <fieldset class="action">
1302 <input type="button" class="action_advanced" value="Show/Hide Advanced Pattern" onclick="javascript:display_table()" />
1304 <div id="basetable" style="display: none;">
1305 <table class="small">
1306 <tr><th colspan="4">Advanced Prediction Pattern</th></tr>
1316 <input type="text" name="add1" id="add1" value="<!-- TMPL_VAR name="add1" -->" />
1319 <input type="text" name="add2" id="add2" value="<!-- TMPL_VAR name="add2" -->" />
1322 <input type="text" name="add3" id="add3" value="<!-- TMPL_VAR name="add3" -->" />
1327 <td><input type="text" name="every1" id="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
1328 <td><input type="text" name="every2" id="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
1329 <td><input type="text" name="every3" id="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
1332 <td>When more than</td>
1333 <td><input type="text" name="whenmorethan1" id="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
1334 <td><input type="text" name="whenmorethan2" id="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
1335 <td><input type="text" name="whenmorethan3" id="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
1338 <td>inner counter</td>
1339 <td><input type="text" name="innerloop1" id="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
1340 <td><input type="text" name="innerloop2" id="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
1341 <td><input type="text" name="innerloop3" id="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
1344 <td>Set back to</td>
1345 <td><input type="text" name="setto1" id="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
1346 <td><input type="text" name="setto2" id="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
1347 <td><input type="text" name="setto3" id="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
1351 <!-- TMPL_IF name="mod" -->
1357 <td><input type="text" name="lastvalue1" id="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
1358 <td><input type="text" name="lastvalue2" id="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
1359 <td><input type="text" name="lastvalue3" id="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
1369 <!--TMPL_IF Name="history"-->
1370 <div id="subscription_form_history">
1371 <h2>Subscription history</h2>
1372 <form method="post" action="/cgi-bin/koha/serials/subscription-add.pl">
1373 <input type="hidden" name="op" value="modsubscription" />
1374 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
1375 <input type="hidden" name="history_only" value="1" />
1376 <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>
1377 <fieldset class="rows">
1380 <label for="histstartdate">Subscription start date</label>
1381 <input type="text" name="histstartdate" id="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /><div class="hint"> (start date of the 1st subscription)</div>
1384 <label for="histenddate">Subscription end date</label>
1385 <input type="text" name="histenddate" id="histenddate" value="<!-- TMPL_VAR name="histenddate" -->" /> <div class="hint">(if empty, subscription is still active)</div>
1388 <label for="recievedlist">Received issues</label>
1389 <textarea name="recievedlist" id="recievedlist" cols="60" rows="5"><!-- TMPL_VAR name="recievedlist" --></textarea>
1392 <label for="missinglist">Missing issues</label>
1393 <textarea name="missinglist" id="missinglist" cols="60" rows="5"><!-- TMPL_VAR name="missinglist" --></textarea>
1396 <label for="opacnote">Note for OPAC</label>
1397 <textarea name="opacnote" id="opacnote" cols="60" rows="5"><!-- TMPL_VAR name="opacnote" --></textarea>
1400 <label for="librariannote">Note for staff</label>
1401 <textarea name="librariannote" id="librariannote" cols="60" rows="5"><!-- TMPL_VAR name="librariannote" --></textarea>
1405 <fieldset class="action"><input type="submit" value="Save subscription history" /></fieldset>
1412 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->