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 <script type="text/javascript">
9 // the english words used in display purposes
10 var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern"),
11 _("Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
12 var weekno_label = _("Week # ");
14 var is_hemisphere = 1;
15 var irregular_issues; // will hold irregularity object.
17 function formatDate(myDate) {
18 var d = new Array( myDate.getFullYear(), myDate.getMonth() + 1 ,myDate.getDate());
19 if(d[1].toString().length == 1) { d[1] = '0'+d[1] };
20 if(d[2].toString().length == 1) { d[2] = '0'+d[2] };
21 <!-- TMPL_IF NAME="dateformat_us" -->
22 return(d[1] + '/' + d[2] + '/' + d[0]) ;
23 <!-- TMPL_ELSIF NAME="dateformat_metric" -->
24 return(d[2] + '/' + d[1] + '/' + d[0]) ;
26 return(''+d[0] + '-' + d[1] + '-' + d[2]) ;
30 Date.prototype.addDays = function(days) {
31 this.setDate(this.getDate()+days);
34 function getWeeksArray(startDate,periodicity) {
35 // returns an array of syspref-formatted dates starting at the first day of startDate's year.
36 // This prediction method will not accurately predict irregularites beyond the first year.
37 // FIXME : Should replace with ajax query to get the first Monday of the year so that week numbers have correct dates.
39 if(periodicity==3) { // 1/2 wks
41 } else if(periodicity == 4) { // 1/3 wks
44 var weeksArray = new Array;
45 var jan01 = new Date();
48 jan01.setFullYear(startDate.getFullYear());
49 for(var i=0;i<52;i++) {
50 weeksArray[i] = formatDate(jan01) + ' ' + weekno_label + (i + 1);
56 function YMDaToYWDa(S) {
57 with (new Date(Date.UTC(S[0], S[1] - 1, S[2]))) {
58 var DoW = getUTCDay();
59 setUTCDate(getUTCDate() - (DoW + 6) % 7 + 3);
62 var WN = Math.round((ms - valueOf()) / 604800000) + 1;
63 return [getUTCFullYear(), WN, DoW == 0 ? 7 : DoW];
66 function dayofyear(d) { // d is a Date object
67 var yn = d.getFullYear();
68 var mn = d.getMonth();
70 var d1 = new Date(yn,0,1,12,0,0); // noon on Jan. 1
71 var d2 = new Date(yn,mn,dn,12,0,0); // noon on input date
72 var ddiff = Math.round((d2-d1)/864e5);
77 // create irregularity object.
78 function IrregularPattern() {
79 this.months = new Array(_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December"));
80 this.seasons = new Array(_("Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"));
81 this.daynames = new Array(_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday"),_("Sunday"));
82 // create weeks irregularity selection array:
83 this.firstissue = new Date();
84 this.firstissue.setDate(1);
85 this.firstissue.setMonth(0);
86 <!-- TMPL_IF NAME='firstacquiyear' --> // it's a mod, we already have a start date.
87 this.firstissue.setFullYear( <!-- TMPL_VAR NAME="firstacquiyear" --> );
89 this.weeks = getWeeksArray(this.firstissue);
93 var irregular = '<!-- TMPL_VAR NAME="irregularity" -->';
94 this.skipped = irregular.split(',');
97 IrregularPattern.prototype.update = function() {
98 this.skipped= new Array;
100 // daily periodicity, we interpret irregular array as which days of week to skip.
101 // else if weekly periodicity, week numbers (starting from 01 Jan) to skip.
102 // else irregular array is list of issues to skip
103 var summary_str = '';
105 if(document.f.irregularity_select) {
106 for( var i in document.f.irregularity_select.options ) {
107 if( document.f.irregularity_select.options[i].selected ) {
108 this.skipped[cnt] = document.f.irregularity_select.options[i].value ;
109 summary_str += document.f.irregularity_select.options[i].text + "\n" ;
114 var summary = document.getElementById("irregularity_summary");
116 summary.value = summary_str;
117 summary.rows= ( cnt > 6 ) ? cnt : 6 ; // textarea will bre resized, but not more than 6 lines will show.
122 IrregularPattern.prototype.irregular = function(index) {
123 for( var i in this.skipped) {
124 if( this.skipped[i] == index) {
131 function init_pattern() {
132 irregular_issues = new IrregularPattern();
134 function reset_pattern() {
135 document.getElementById("numberpattern").value = '';
136 document.getElementById("irregularity").innerHTML = '';
141 // common pre defined number patterns
142 function reset_num_pattern() {
143 var patternchoice = document.getElementById("numberpattern").value;
144 switch(patternchoice){
146 document.f.add1.value=1;
147 document.f.add2.value=1;
148 document.f.add3.value=1;
149 document.f.every1.value=12;
150 document.f.every2.value=1;
151 document.f.every3.value=1;
152 document.f.whenmorethan1.value=9999999;
153 document.f.whenmorethan2.value=12;
154 document.f.whenmorethan3.value=4;
155 document.f.setto1.value=0;
156 document.f.setto2.value=1;
157 document.f.setto3.value=1;
158 document.f.lastvalue1.value=1;
159 document.f.lastvalue2.value=1;
160 document.f.lastvalue3.value=1;
161 document.f.numberingmethod.value=_("Vol {X}, No {Y}, Issue {Z}");
162 moreoptions(text[1],text[0],text[2]);
163 display_table(0); // toggle info box on (1) or off (0)
166 document.f.add1.value=1;
167 document.f.add2.value=1;
168 document.f.add3.value='';
169 document.f.every1.value=12;
170 document.f.every2.value=1;
171 document.f.every3.value='';
172 document.f.whenmorethan1.value=9999999;
173 document.f.whenmorethan2.value=12;
174 document.f.whenmorethan3.value='';
175 document.f.setto1.value=0;
176 document.f.setto2.value=1;
177 document.f.setto3.value='';
178 document.f.lastvalue1.value=1;
179 document.f.lastvalue2.value=1;
180 document.f.lastvalue3.value='';
181 document.f.numberingmethod.value=_("Vol {X}, No {Y}");
182 moreoptions(text[1],text[0]);
186 document.f.add1.value=1;
187 document.f.add2.value=1;
188 document.f.add3.value='';
189 document.f.every1.value=12;
190 document.f.every2.value=1;
191 document.f.every3.value='';
192 document.f.whenmorethan1.value=9999999;
193 document.f.whenmorethan2.value=12;
194 document.f.whenmorethan3.value='';
195 document.f.setto1.value=0;
196 document.f.setto2.value=1;
197 document.f.setto3.value='';
198 document.f.lastvalue1.value=1;
199 document.f.lastvalue2.value=1;
200 document.f.lastvalue3.value='';
201 document.f.numberingmethod.value=_("Vol {X}, Issue {Y}");
202 moreoptions(text[1],text[2]);
206 // var d = new Date(document.f.firstacquidate.value);
207 // var smonth = d.getMonth();
208 document.f.add1.value=1;
209 document.f.add2.value=1;
210 document.f.add3.value='';
211 document.f.every1.value=12;
212 document.f.every2.value=1;
213 document.f.every3.value='';
214 document.f.whenmorethan1.value=9999999;
215 document.f.whenmorethan2.value=12;
216 document.f.whenmorethan3.value='';
217 document.f.setto1.value=0;
218 document.f.setto2.value=1;
219 document.f.setto3.value='';
220 document.f.numberingmethod.value=_("No {X}, Issue {Y}");
221 moreoptions(text[0],text[2]);
225 var d = new Date(document.f.firstacquidate.value);
226 var sYear = d.getFullYear();
227 moreoptions_seasons(text[15],sYear);
228 var d = new Date(document.f.firstacquidate.value);
229 var sYear = d.getFullYear();
230 document.f.add1.value=1;
231 document.f.add2.value='1';
232 document.f.add3.value='';
233 document.f.every1.value=4;
234 document.f.every2.value='1';
235 document.f.every3.value='';
236 document.f.whenmorethan1.value=9999999;
237 document.f.whenmorethan2.value='4';
238 document.f.whenmorethan3.value='';
239 document.f.setto1.value=0;
240 document.f.setto2.value='1';
241 document.f.setto3.value='';
242 document.f.periodicity.value='8';
243 document.f.numberingmethod.value=_("{Y} {X}");
244 moreoptions_seasons(text[15],sYear);
245 document.f.lastvalue1temp.value=document.f.lastvalue1.value=sYear;
251 document.getElementById("more_options").innerHTML = '';
252 document.f.irreg_check.value=1;
254 case "8": // Year/Number
255 var d = (document.f.firstacquidate.value) ? new Date( document.f.firstacquidate.value) : new Date() ;
256 var sYear = d.getFullYear();
257 document.f.add1.value=1;
258 document.f.add2.value=1;
259 document.f.add3.value='';
260 document.f.every1.value=12;
261 document.f.every2.value=1;
262 document.f.every3.value='';
263 document.f.whenmorethan1.value=9999999;
264 document.f.whenmorethan2.value=12;
265 document.f.whenmorethan3.value='';
266 document.f.setto1.value=0;
267 document.f.setto2.value=1;
268 document.f.setto3.value='';
269 document.f.lastvalue1.value=sYear;
270 switch (document.f.periodicity.value){
272 var doy = dayofyear(d);
273 document.f.lastvalue2.value=doy;
274 document.f.whenmorethan2.value=365;
277 var doy = dayofyear(d);
278 document.f.lastvalue2.value=doy*2;
279 document.f.whenmorethan2.value=730;
284 var YWDa = YMDaToYWDa(d);
285 document.f.lastvalue2.value=YWDA[1]/(document.f.periodicity.value-1);
288 var smonth = d.getMonth();
289 document.f.lastvalue2.value=smonth;
292 var smonth = d.getMonth();
293 document.f.lastvalue2.value=smonth/2;
294 document.f.whenmorethan2.value=6;
298 var smonth = d.getMonth();
299 document.f.lastvalue2.value=smonth/3;
300 document.f.whenmorethan2.value=4;
303 var smonth = d.getMonth();
304 document.f.lastvalue2.value=smonth/6;
305 document.f.whenmorethan2.value=2;
309 document.f.lastvalue3.value='';
310 document.f.numberingmethod.value=_("{X} / {Y}");
311 moreoptions(text[16],text[0]);
312 // document.f.lastvalue1temp.value=sYear;
313 // document.f.lastvalue2temp.value=document.f.lastvalue2.value;
317 document.f.add1.value=1;
318 document.f.add2.value='';
319 document.f.add3.value='';
320 document.f.every1.value=1;
321 document.f.every2.value='';
322 document.f.every3.value='';
323 document.f.whenmorethan1.value=9999999;
324 document.f.whenmorethan2.value='';
325 document.f.whenmorethan3.value='';
326 document.f.setto1.value=0;
327 document.f.setto2.value='';
328 document.f.setto3.value='';
329 document.f.lastvalue1.value=1;
330 document.f.lastvalue2.value='';
331 document.f.lastvalue3.value='';
332 document.f.numberingmethod.value='{X}';
333 // moreoptions_daily_check(text[0]);
334 moreoptions(text[0]);
335 document.f.irreg_check.value=1;
341 function display_table(n) {
343 document.getElementById("basetable").style.display = 'block';
345 document.getElementById("basetable").style.display = 'none';
347 var disp_val = ( document.getElementById("basetable").style.display == 'none' ) ? 'block' : 'none' ;
348 document.getElementById("basetable").style.display = disp_val;
352 function set_num_pattern_from_template_vars() {
353 if(!document.getElementById("numberpattern")){ return false; }
354 document.getElementById("numberpattern").value = '<!-- TMPL_VAR NAME="numberpattern" -->';
357 document.f.add1.value='<!-- TMPL_VAR NAME="add1" -->';
358 document.f.add2.value='<!-- TMPL_VAR NAME="add2" -->';
359 document.f.add3.value='<!-- TMPL_VAR NAME="add3" -->';
360 document.f.every1.value='<!-- TMPL_VAR NAME="every1" -->';
361 document.f.every2.value='<!-- TMPL_VAR NAME="every2" -->';
362 document.f.every3.value='<!-- TMPL_VAR NAME="every3" -->';
363 document.f.whenmorethan1.value='<!-- TMPL_VAR NAME="whenmorethan1" -->';
364 document.f.whenmorethan2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
365 document.f.whenmorethan3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
366 document.f.setto1.value='<!-- TMPL_VAR NAME="setto1" -->';
367 document.f.setto2.value='<!-- TMPL_VAR NAME="setto2" -->';
368 document.f.setto3.value='<!-- TMPL_VAR NAME="setto3" -->';
369 document.f.lastvalue1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
370 document.f.lastvalue2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
371 document.f.lastvalue3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
372 document.f.numberingmethod.value='<!-- TMPL_VAR NAME="numberingmethod" -->';
376 <!-- TMPL_IF NAME="add2" -->
377 if(<!-- TMPL_VAR NAME="add2" --> > 0){
381 <!-- TMPL_IF NAME="add3" -->
382 if(<!-- TMPL_VAR NAME="add3" --> > 0){
386 document.f.lastvalue1temp.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
388 document.f.lastvalue2temp.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
389 document.f.whenmorethan2temp.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
392 document.f.lastvalue3temp.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
393 document.f.whenmorethan3temp.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
397 // a pre check with more options to see if 'number' and '1/day' are chosen
399 function moreoptions_daily_check(x) {
400 var periodicity = document.f.periodicity.value;
402 if(periodicity == 1){ // i.e. daily
403 document.getElementById("irregularity").innerHTML = '';
404 errortext =_("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
405 for(var j=0;j<irregular_issues.daynames.length;j++){
406 errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+irregular_issues.daynames[j]+" ";
408 var error = errortext;
410 document.getElementById("irregularity").innerHTML = error;
412 document.getElementById("irregularity").innerHTML = '';
413 document.getElementById("more_options").innerHTML = '';
420 // to dispaly the more options section
421 function moreoptions(x,y,z){
422 document.getElementById("irregularity").innerHTML = '';
423 document.getElementById("more_options").innerHTML = '';
425 // alert("X: "+x+"Y: "+y+"Z: "+z);
427 textbox +="<table id='irregularity_table'>\n<tr><th> <\/th><th>"+x+"<\/th>";
429 textbox +="<th>"+y+"<\/th>";
431 textbox +="<th>"+z+"<\/th>";
434 textbox +="<\/tr>\n";
435 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";
437 textbox +="<td><input type='text' name='lastvalue2temp' id='lastvalue2temp' size='4' onkeyup='moreoptionsupdate(this)' value=\"" + document.f.lastvalue2.value + "\" /><\/td>\n";
439 textbox +="<td><input type='text' name='lastvalue3temp' id='lastvalue3temp' size='4' onkeyup='moreoptionsupdate(this)' value=\"" + document.f.lastvalue3.value + "\" /><\/td>\n";
442 textbox +="<\/tr>\n";
444 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
445 textbox +="<td> <\/td>\n";
446 textbox +="<td><input type='text' name='whenmorethan2temp' id='whenmorethan2temp' size='4' onkeyup='moreoptionsupdate(this,1)'><\/td>\n";
448 textbox +="<td><input type='text' name='whenmorethan3temp' id='whenmorethan3temp' size='4' onkeyup='moreoptionsupdate(this,1)'><\/td>\n";
452 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>";
454 textbox +="<\/table>\n";
456 document.getElementById("more_options").innerHTML = textbox;
459 function hemispheres(chosen){
460 var selbox = document.getElementById("season1");
462 var selboxselected = selbox.options[selbox.selectedIndex].value;
463 selbox.options.length = 0;
465 if ( (chosen == "1") || ( ! (chosen) && is_hemisphere == 1 )) {
466 selbox.options[selbox.options.length] = new Option(text[11],'1');
467 selbox.options[selbox.options.length] = new Option(text[12],'2');
468 selbox.options[selbox.options.length] = new Option(text[13],'3');
469 selbox.options[selbox.options.length] = new Option(text[14],'4');
471 selbox.options[selboxselected-1].selected = true;
474 if ( (chosen == "2") || ( ! (chosen) && is_hemisphere == 2 )) {
475 selbox.options[selbox.options.length] = new Option(text[13],'1');
476 selbox.options[selbox.options.length] = new Option(text[10],'2');
477 selbox.options[selbox.options.length] = new Option(text[11],'3');
478 selbox.options[selbox.options.length] = new Option(text[12],'4');
480 selbox.options[selboxselected-1].selected = true;
485 // to display the more options section for seasons
486 function moreoptions_seasons(x,y){
487 // x = 'Season'. y = 'Year'.
488 document.getElementById("irregularity").innerHTML = '';
489 document.getElementById("more_options").innerHTML = '';
491 //alert("X: "+x+"Year: "+y);
493 var hemi_select = parseInt('<!-- TMPL_VAR NAME="hemisphere" -->');
494 textbox +="<li><label for=\"hemisphere\">"+ text[7] +"<\/label><select name='hemisphere' id=\"hemisphere\" onchange='hemispheres(this.options[this.selectedIndex].value)'>";
495 for(var i = 1; i <= 2; i++){
496 textbox +="<option value='"+i+"'";
497 if(i == hemi_select){
498 textbox += " selected "
500 textbox +=">"+text[i+7]+"<\/option>";
502 textbox +="<\/li>\n";
503 textbox +="<table id='seasonal_irregularity'><tr><th> <\/th><th>"+x+"<\/th>";
504 textbox +="<th>"+text[16]+"<\/th>";
505 textbox +="<\/tr>\n";
506 textbox +="<tr><th scope=\"row\">"+text[5]+"<\/th><td><select name='lastvalue2temp' id='lastvalue2temp' id='season1' onchange='moreoptionsupdate(this)'>";
507 for(var j = 1; j <= 4; j++){
508 textbox +="<option value='"+j+"'>"+text[j+9]+"<\/option>";
510 textbox +="<\/select><\/td>";
511 var isyr = irregular_issues.firstissue;
512 textbox += "<td>" + irregular_issues.firstissue.getFullYear() + "<\/td><\/tr>\n";
513 textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
514 textbox +="<td><input type='text' name='whenmorethan2temp' id='whenmorethan2temp' size='4' onkeyup='moreoptionsupdate(this,1)'><\/td>\n";
515 textbox +="<\/tr><\/table>\n";
518 document.getElementById("more_options").innerHTML = textbox;
521 function irregularity_check(){
522 document.f.irreg_check.value = 1; // Irregularity button now pushed
523 var periodicity = document.f.periodicity.value;
524 var rollover = document.f.issuesexpected1.value;
525 if( (document.f.whenmorethan2) && ( document.f.whenmorethan2.value > 0) ){
526 rollover = document.f.whenmorethan2.value;
528 if((document.f.whenmorethan3) && document.f.whenmorethan3.value > 0 ){
529 // FIXME: Irregularity check assumes that the full prediction pattern repeats each year.
530 // In cases where the outermost periodicity is > 1 year,
531 // e.g. where a volume spans two years, the irregularity check will be incorrect,
532 // but you can safely ignore the check, submit the form, and the prediction pattern should be correct.
533 // a way to distinguish between these two cases is needed.
534 rollover = document.f.whenmorethan3.value * document.f.whenmorethan2.value;
539 var errortext = _("<b>Warning irregularity detected<\/b><br \/>");
542 if(rollover < 730) expected =730;
549 if(rollover < 365) expected =365;
556 if(rollover < 52) expected =52;
563 if(rollover < 26) expected =26;
570 if(rollover < 17) expected =17;
577 if(rollover < 12) expected =12;
584 if(rollover < 6) expected =6;
591 if(rollover < 4) expected =4;
598 if(rollover < 4) expected =4;
605 if(rollover < 2) expected =2;
612 if(rollover < 1) expected =1;
622 if(expected == 365 || expected==730){ // what about leap years ?
623 // FIXME: We interpret irregularity as which days per week for periodicity==1.
624 // We need two cases: one in which we're published n days/week, in which case irregularity should be per week,
625 // and a regular daily pub, where irregularity should be per year.
626 errortext += _("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
628 errortext +=expected+_(" issues expected, ")+rollover+_(" were entered. <br \/>Please indicate which date(s) an issue is not expected<br \/>");
629 irregular_issues.numskipped = expected - rollover;
631 errortext +="<select multiple id='irregularity_select' name='irregularity_select' onchange='irregular_issues.update();'>\n";
632 errortext +=irregular_options(periodicity);
633 errortext += "<\/select>\n <textarea rows='6' width='18' id='irregularity_summary' name='irregularity_summary' value='foo' />";
637 errortext +=expectedover+_(" issues expected, ")+rollover+_(" were entered.<p class='warning'> You seem to have indicated more issues per year than expected.<\/p>");
640 if(error.length ==0){
641 error=_("No irregularities noticed");
643 display_example(expected);
644 document.getElementById("irregularity").innerHTML = error;
645 irregular_issues.update();
648 function irregular_options(periodicity){
652 if(periodicity == 1) {
654 titles = irregular_issues.daynames;
657 if(periodicity == 2 || periodicity == 3 || periodicity == 4) {
658 titles = irregular_issues.weeks;
660 if(periodicity==3) { // 1/2 wks
662 } else if(periodicity == 4) { // 1/3 wks
668 if(periodicity == 5 || periodicity == 6 || periodicity == 7 || periodicity == 8 || periodicity == 9) {
669 if(periodicity == 8 && numberpattern==8) {
670 is_season = 1; // setting up from edit page
673 titles = irregular_issues.seasons;
675 if(is_hemisphere == 2){
681 titles = irregular_issues.months;
687 return ''; // don't know how to deal with irregularity.
689 for(var j=0;j<expected;j++){ // rch - changed frrom (1..expected).
692 count = count-expected;
694 if(is_season && is_hemisphere == 1){
695 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j]+"<\/option>\n";
696 // alert("value: "+((count*3)-2)+" title: "+titles[j]);
697 } else if(is_season && is_hemisphere == 2){
698 errortext +="<option value='"+((count*3)-2)+"'>"+titles[j-1]+"<\/option>\n";
699 // alert("value: "+((count*3)-2)+" title: "+titles[j-1]);
700 } else { // all non-seasonal periodicities:
701 var incr=1; // multiplier for ( 1/n weeks) patterns; in this case the irreg calc relies on the week# , not the issue#.
702 if(periodicity==3) { // 1/2 wks
704 } else if(periodicity == 4) { // 1/3 wks
707 errortext += "<option value='" + (1+j*incr) ;
708 if(irregular_issues.irregular(1+incr*j)) {
709 errortext += "' selected='selected" ;
711 errortext += "'>"+titles[incr*j]+"<\/option>\n";
715 errortext +="<option value='"+j+"'>"+titles+" "+j+"<\/option>\n";
722 function display_example(expected){
723 var startfrom1 = parseInt(document.f.lastvalue1.value);
724 var startfrom2 = parseInt(document.f.lastvalue2.value);
725 var startfrom3 = parseInt(document.f.lastvalue3.value);
726 var every1 = parseInt(document.f.every1.value);
727 var every2 = parseInt(document.f.every2.value);
728 var every3 = parseInt(document.f.every3.value);
729 var numberpattern = document.f.numberingmethod.value;
730 var whenmorethan2 = parseInt(document.f.whenmorethan2.value);
731 var whenmorethan3 = parseInt(document.f.whenmorethan3.value);
732 var setto2 = parseInt(document.f.setto2.value);
733 var setto3 = parseInt(document.f.setto3.value);
734 var displaytext = _("Based on the information entered, the Numbering Pattern will look like this: <br \/><ul class=\"numpattern_preview\">");
736 var count=startfrom3-1;
737 var count2=startfrom2;
738 for(var i = 0 ; i < 12; i++){
739 if(count>=whenmorethan3){
741 if(count2>=whenmorethan2){
750 displaytext += '<li>' + numberpattern.replace(/{Z}/,count) + '<\/li>\n';
751 displaytext = displaytext.replace(/{Y}/,count2);
752 displaytext = displaytext.replace(/{X}/,startfrom1);
756 if(startfrom2>0 && !startfrom3){
757 var count=startfrom2-1;
758 for(var i=0;i<12;i++){
759 if(count>=whenmorethan2){
767 if(is_hemisphere == 2){
769 displaytext += numberpattern.replace(/{Y}/,text[count+12])+'\n';
771 displaytext += numberpattern.replace(/{Y}/,text[count+8])+'\n';
774 displaytext += numberpattern.replace(/{Y}/,text[count+10])+'\n';
777 displaytext += numberpattern.replace(/{Y}/,count)+'\n';
779 displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
782 if(startfrom1>0 && !startfrom2 && !startfrom3){
783 var offset=eval(document.f.issuesexpected1.value);
787 for(var i=startfrom1;i<(startfrom1+offset);i+=every1){
788 displaytext += numberpattern.replace(/{X}/,i)+'<br \/>\n';
791 // displaytext = "<div style='padding: 5px; background-color: #CCCCCC'>"+displaytext+"<\/div>";
792 document.getElementById("displayexample").innerHTML = displaytext;
795 function isArray(obj) {
796 if (obj.constructor.toString().indexOf("Array") == -1)
802 function moreoptionsupdate(inputfield,rollover){
803 fieldname = inputfield.name;
804 // find parent element in base table by stripping 'temp' from element name.
805 basefield = document.getElementById(fieldname.slice(0,-4));
806 var fieldnumber = fieldname.slice(-5,-4);
808 basefield.value = inputfield.value;
809 var patternchoice = document.getElementById("numberpattern").value;
810 switch(patternchoice){
814 case "8": // Year, Number. -- Why not just use Vol, Number withvol==year??
815 // FIXME: this my conflict with innerloop calc below.
816 if (document.f.lastvalue2temp.value > 0){document.f.innerloop1.value = document.f.lastvalue2temp.value - 1;}
819 if(basefield.name.slice(0,-1) == 'lastvalue' || 'whenmorethan' ) {
820 // The enumeration string is held in a positional numeral notation with three positions, X,Y,Z.
821 // The last values lastvalue1, lastvalue2,lastvalue3 should match the last received serial's X,Y,Z enumeration.
822 // make array indexes start with 1 for consistency with variable names.
823 var innerloop = new Array( undefined, document.getElementById('innerloop1'), document.getElementById('innerloop2'), document.getElementById('innerloop3') );
824 var lastvalue = new Array( undefined, document.getElementById('lastvalue1').value *1 , document.getElementById('lastvalue2').value *1 , document.getElementById('lastvalue3').value *1 );
825 var every = new Array( undefined, document.getElementById('every1').value *1 , document.getElementById('every2').value *1 , document.getElementById('every3').value *1 );
826 var add = new Array( undefined, document.getElementById('add1').value *1 , document.getElementById('add2').value *1 , document.getElementById('add3').value *1 );
827 var whenmorethan = new Array( undefined, document.getElementById('whenmorethan1').value *1 , document.getElementById('whenmorethan2').value *1 , document.getElementById('whenmorethan3').value *1 );
830 // calculate rollover for higher level of periodicity.
831 // if there are two levels of periodicity, (e.g. vol{X},num{Y},issue{Z}, then every1=every2*whenmorethan2 / add2 .
832 for(var N=3;N>1;N--){
834 var addN = (add[N]) ? add[N] : 1 ;
835 var everyN = (document.getElementById('every'+N)) ? document.getElementById('every'+N).value : 1 ;
836 document.getElementById('every'+(N-1)).value = whenmorethan[N] * everyN / addN ;
840 innerloop[3].value = ( every[3] > 1 ) ? lastvalue[3] % every[3] : 0 ;
841 innerloop[2].value = ( every[2] > 1 ) ? lastvalue[3] - 1 : 0 ;
842 innerloop[1].value = ( every[1] > 1 ) ?
843 ( whenmorethan[3] > 0 ) ? (lastvalue[2] - 1) * every[2] + 1* innerloop[2].value
847 //FIXME : add checks for innerloop || lastvalue .gt. rollover
851 function check_input(e){
852 var unicode=e.charCode? e.charCode : e.keyCode
853 if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
854 if (unicode<48||unicode>57) { // if not a number
855 alert(_("Needs to be entered in digit form -eg 10"));
856 return false // disable key press
861 function addbiblioPopup(biblionumber) {
862 var destination = "/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup";
863 if(biblionumber){ destination += "&biblionumber="+biblionumber; }
864 window.open(destination,'AddBiblioPopup','width=1024,height=768,toolbar=no,scrollbars=yes');
869 window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
872 function FindAcqui(f)
874 window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
877 function Find_ISSN(f)
879 window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
884 if (f.aqbooksellerid.value.length==0) {
885 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"));
886 if (input_box==true) {
892 if (f.biblionumber.value.length==0) {
893 alert(_("You must choose or create a biblio"));
894 } else if(f.startdate.value.length != 0 && f.sublength.value > 0) {
895 if (f.irreg_check.value == 1) {
898 if(f.numbering_pattern.value == ''){
899 alert(_("Please choose a numbering pattern"));
901 alert(_("Please check for irregularity by clicking 'Test Prediction Pattern'"));
905 alert(_("You must choose a start date and a subscription length"));
907 if(irregular_issues.numskipped < irregular_issues.skipped.length ) {
908 alert(_("You have not accounted for all missing issues."));
913 $(document).ready(function() {
915 <!-- TMPL_IF name="mod" -->
916 set_num_pattern_from_template_vars();
917 <!-- TMPL_IF name="hemisphere" -->
918 is_hemisphere = <!-- TMPL_VAR NAME="hemisphere" --> ;
922 <!-- TMPL_IF name="irregularity" -->
923 irregularity_check();
925 $('#numberpattern').change( function() {
933 <!-- TMPL_INCLUDE NAME="header.inc" -->
934 <!-- TMPL_INCLUDE NAME="serials-search.inc" -->
936 <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>
938 <div id="doc3" class="yui-t7">
942 <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>
943 <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
944 <!-- TMPL_IF name="mod" -->
945 <input type="hidden" name="op" value="modsubscription" />
946 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
948 <input type="hidden" name="op" value="addsubscription" />
950 <input type="hidden" name="user" value="<!-- TMPL_VAR name="loggedinusername" -->" />
951 <input type="hidden" name="irreg_check" value="0" />
952 <input type="hidden" name="issuesexpected1" id="issuesexpected1" value="0" />
954 <div class="yui-u first">
955 <fieldset id="subscription_add_information" class="rows">
956 <legend>Subscription details</legend>
958 <li><span class="label">Subscription #</span> <!--TMPL_VAR name="subscriptionid"--></li>
960 <span class="label">Librarian: </span> <!-- TMPL_VAR name="loggedinusername" -->
963 <label for="aqbooksellerid">Vendor: </label>
964 <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>
967 <label for="biblionumber" class="required" title="Subscriptions must be associated with a bibliographic record">Biblio:</label>
969 <input type="text" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR name="bibnum" -->" size="8" />
970 (<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>
971 <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 -->
972 <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a><!--/TMPL_IF--></div>
976 <!-- TMPL_IF name="serialsadditems" -->
977 <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1" checked="checked" /><label for="serialsadditems-yes">create an item record when receiving this serial</label></p>
978 <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" /><label for="serialsadditems-no">do not create an item record when receiving this serial </label></p>
980 <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1"/><label for="serialsadditems-yes">create an item record when receiving this serial</label></p>
981 <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" checked="checked" /><label for="serialsadditems-no">do not create an item record when receiving this serial</label></p>
985 <label for="callnumber">Call Number:</label>
986 <input type="text" name="callnumber" id="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" />
989 <label for="branchcode">Library:</label>
991 <select name="branchcode" id="branchcode" style="width: 20em;">
992 <!-- TMPL_UNLESS NAME="Independantbranches" --><option value="">None</option><!-- /TMPL_UNLESS -->
993 <!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
995 <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
998 </select> (select a library)
1002 <label for="notes">Public note:</label>
1003 <textarea name="notes" id="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea>
1006 <label for="internalnotes">Nonpublic note:</label>
1007 <textarea name="internalnotes" id="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea>
1010 <label for="letter">Patron notification: </label>
1012 <!-- TMPL_IF NAME="letterloop" -->
1013 <select name="letter" id="letter">
1014 <option value="">None</option>
1015 <!-- TMPL_LOOP name="letterloop" -->
1016 <!-- TMPL_IF name="selected" -->
1017 <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
1019 <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
1023 <div class="hint">Select a notice and patrons on the routing list will be notified when new issues are received.</div>
1025 <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>
1030 <div style="float:left;clear:left;margin:1em;"><strong>Note:</strong>
1033 <li>The subscription <strong>must</strong> be associated with a bibliographic record.</li>
1034 <li>You <strong>must</strong> select a vendor if you wish to generate claims.</li>
1042 <div id="subscription_form_planning">
1043 <fieldset class="rows">
1044 <legend>Serials planning</legend>
1047 <label for="firstacquidate"> First issue publication date:</label>
1048 <!-- 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 -->
1049 <input type="text" name="firstacquidate" value="<!-- TMPL_VAR name="firstacquidate" -->" size="13" maxlength="10" id="acqui_date" <!-- TMPL_IF NAME="mod" -->disabled="true"<!-- /TMPL_IF --> style="border-width: 0px;" />
1051 <!-- TMPL_IF NAME="mod" --><li><label for="nextacquidate"> Next issue publication date:</label>
1052 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="next_acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1053 <input type="text" name="nextacquidate" value="<!-- TMPL_VAR name="nextacquidate" -->" size="13" maxlength="10" id="next_acqui_date" style="border-width: 0px;" />
1054 </li><!-- /TMPL_IF -->
1056 <li><!-- both scripts for calendar must follow the input field -->
1057 <script type="text/javascript">
1059 inputField : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_date",
1060 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1061 button : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_button",
1063 onUpdate : function(cal) {
1064 irregular_issues.weeks = getWeeksArray(cal.date);
1065 irregular_issues.firstissue = cal.date;
1066 if(document.irregularity_summary) {
1067 irregular_issues.update();
1069 if(document.getElementById("seasonal_irregularity")) {
1070 moreoptions_seasons(text[15]);
1075 inputField : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_date",
1076 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1077 button : "<!-- TMPL_IF NAME="mod" -->next_<!-- /TMPL_IF -->acqui_date",
1079 onUpdate : function(cal) { irregular_issues.weeks = getWeeksArray(cal.date);
1080 irregular_issues.firstissue = cal.date;
1081 if(document.irregularity_summary) {
1082 irregular_issues.update();
1084 if(document.getElementById("seasonal_irregularity")) {
1085 moreoptions_seasons(text[15]);
1090 <label for="periodicity" class="required">Frequency:</label>
1092 <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1); reset_num_pattern();">
1093 <option value="" selected="selected">-- please choose --</option>
1094 <!-- TMPL_IF name="periodicity16" -->
1095 <option value="16" selected="selected">Without periodicity</option>
1097 <option value="16">Without periodicity</option>
1099 <!-- TMPL_IF name="periodicity48" -->
1100 <option value="48" selected="selected">Unknown</option>
1102 <option value="48">Unknown</option>
1104 <!-- TMPL_IF name="periodicity32" -->
1105 <option value="32" selected="selected">Irregular</option>
1107 <option value="32">Irregular</option>
1110 <!-- TMPL_IF name="periodicity12" -->
1111 <option value="12" selected="selected">2/day</option>
1113 <option value="12">2/day</option>
1115 <!-- TMPL_IF name="periodicity1" -->
1116 <option value="1" selected="selected">daily (n/week)</option>
1118 <option value="1">daily (n/week)</option>
1120 <!-- TMPL_IF name="periodicity2" -->
1121 <option value="2" selected="selected">1/week</option>
1123 <option value="2">1/week</option>
1125 <!-- TMPL_IF name="periodicity3" -->
1126 <option value="3" selected="selected">1/2 weeks </option>
1128 <option value="3">1/2 weeks </option>
1130 <!-- TMPL_IF name="periodicity4" -->
1131 <option value="4" selected="selected">1/3 weeks</option>
1133 <option value="4">1/3 weeks</option>
1135 <!-- TMPL_IF name="periodicity5" -->
1136 <option value="5" selected="selected">1/month</option>
1138 <option value="5">1/month</option>
1140 <!-- TMPL_IF name="periodicity6" -->
1141 <option value="6" selected="selected">1/2 months (6/year)</option>
1143 <option value="6">1/2 months (6/year)</option>
1145 <!-- TMPL_IF name="periodicity7" -->
1146 <option value="7" selected="selected">1/3 months (1/quarter)</option>
1148 <option value="7">1/3 months (1/quarter)</option>
1150 <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
1151 <!-- TMPL_IF name="periodicity8" -->
1152 <option value="8" selected="selected">1/quarter (seasonal)</option>
1154 <option value="8">1/quarter (seasonal)</option>
1157 <!-- TMPL_IF name="periodicity9" -->
1158 <option value="9" selected="selected">2/years</option>
1160 <option value="9">2/year</option>
1162 <!-- TMPL_IF name="periodicity10" -->
1163 <option value="10" selected="selected">1/year</option>
1165 <option value="10">1/year</option>
1167 <!-- TMPL_IF name="periodicity11" -->
1168 <option value="11" selected="selected">1/2 years</option>
1170 <option value="11">1/2 years</option>
1172 </select> <span class="required">Required</span></li>
1173 <li><label for="manuallist"> Manual history:</label> <input type="checkbox" name="manualhist" id="manuallist" value="1" /></li>
1175 <label for="numberpattern"> Numbering pattern:</label>
1177 <select name="numbering_pattern" size="1" id="numberpattern" >
1178 <option value="" selected="selected">-- please choose --</option>
1179 <!-- TMPL_IF name="numberpattern1" -->
1180 <option value="1" selected="selected">Number</option>
1182 <option value="1">Number</option>
1184 <!-- TMPL_IF name="numberpattern2" -->
1185 <option value="2" selected="selected">Volume, Number, Issue</option>
1187 <option value="2">Volume, Number, Issue</option>
1189 <!-- TMPL_IF name="numberpattern3" -->
1190 <option value="3" selected="selected">Volume, Number</option>
1192 <option value="3">Volume, Number</option>
1194 <!-- TMPL_IF name="numberpattern4" -->
1195 <option value="4" selected="selected">Volume, Issue</option>
1197 <option value="4">Volume, Issue</option>
1199 <!-- TMPL_IF name="numberpattern5" -->
1200 <option value="5" selected="selected">Number, Issue</option>
1202 <option value="5">Number, Issue</option>
1204 <!-- TMPL_IF name="numberpattern6" -->
1205 <option value="6" selected="selected">Seasonal only</option>
1207 <option value="6">Seasonal only</option>
1209 <!-- TMPL_IF name="numberpattern8" -->
1210 <option value="8" selected="selected">Year/Number</option>
1212 <option value="8">Year/Number</option>
1214 <!-- TMPL_IF name="numberpattern7" -->
1215 <option value="7" selected="selected">None of the above</option>
1217 <option value="7">None of the above</option>
1221 <li id="more_options"></li>
1222 <li id="irregularity"></li>
1223 <li id="displayexample"></li>
1225 <label for="startdate" class="required"> Subscription start date:</label>
1227 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1228 <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" style="border-width: 0px;" />
1229 <!-- both scripts for calendar must follow the input field -->
1230 <script type="text/javascript">
1232 inputField : "beginning_date",
1233 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1238 <script type="text/javascript">
1240 inputField : "beginning_date",
1241 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
1242 button : "beginning_date",
1246 <span class="required">Required</span>
1249 <label for="subtype" class="required">Subscription length:</label>
1251 <select name="subtype" id="subtype">
1252 <!-- TMPL_LOOP NAME="subtype" -->
1253 <!-- TMPL_IF NAME="selected" -->
1254 <option value="<!-- TMPL_VAR NAME="name" -->" selected="selected">
1256 <option value="<!-- TMPL_VAR NAME="name" -->">
1258 <!-- TMPL_VAR NAME="name" -->
1262 <input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (enter amount in numerals)
1263 <span class="required">Required</span>
1265 <li><label for="numberingmethod">Numbering formula:</label> <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" />
1270 <fieldset class="action">
1271 <input type="button" class="action_test" value="Test Prediction Pattern" onclick="javascript:irregularity_check()" />
1272 <input type="button" class="action_reset" value="Reset Pattern" onclick="javascript:reset_pattern()" />
1273 <input type="button" class="action_save" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1275 <fieldset class="action">
1276 <input type="button" class="action_advanced" value="Show/Hide Advanced Pattern" onclick="javascript:display_table()" />
1278 <div id="basetable" style="display: none;">
1279 <table class="small">
1280 <tr><th colspan="4">Advanced Prediction Pattern</th></tr>
1290 <input type="text" name="add1" id="add1" value="<!-- TMPL_VAR name="add1" -->" />
1293 <input type="text" name="add2" id="add2" value="<!-- TMPL_VAR name="add2" -->" />
1296 <input type="text" name="add3" id="add3" value="<!-- TMPL_VAR name="add3" -->" />
1301 <td><input type="text" name="every1" id="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
1302 <td><input type="text" name="every2" id="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
1303 <td><input type="text" name="every3" id="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
1306 <td>When more than</td>
1307 <td><input type="text" name="whenmorethan1" id="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
1308 <td><input type="text" name="whenmorethan2" id="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
1309 <td><input type="text" name="whenmorethan3" id="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
1312 <td>inner counter</td>
1313 <td><input type="text" name="innerloop1" id="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
1314 <td><input type="text" name="innerloop2" id="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
1315 <td><input type="text" name="innerloop3" id="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
1318 <td>Set back to</td>
1319 <td><input type="text" name="setto1" id="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
1320 <td><input type="text" name="setto2" id="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
1321 <td><input type="text" name="setto3" id="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
1325 <!-- TMPL_IF name="mod" -->
1331 <td><input type="text" name="lastvalue1" id="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
1332 <td><input type="text" name="lastvalue2" id="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
1333 <td><input type="text" name="lastvalue3" id="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
1343 <!--TMPL_IF Name="history"-->
1344 <div id="subscription_form_history">
1345 <h2>Subscription history</h2>
1346 <form method="post" action="/cgi-bin/koha/serials/subscription-add.pl">
1347 <input type="hidden" name="op" value="modsubscription" />
1348 <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
1349 <input type="hidden" name="history_only" value="1" />
1350 <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>
1351 <fieldset class="rows">
1354 <label for="histstartdate">Subscription start date</label>
1355 <input type="text" name="histstartdate" id="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /><div class="hint"> (start date of the 1st subscription)</div>
1358 <label for="histenddate">Subscription end date</label>
1359 <input type="text" name="histenddate" id="histenddate" value="<!-- TMPL_VAR name="histenddate" -->" /> <div class="hint">(if empty, subscription is still active)</div>
1362 <label for="recievedlist">Received issues</label>
1363 <textarea name="recievedlist" id="recievedlist" cols="60" rows="5"><!-- TMPL_VAR name="recievedlist" --></textarea>
1366 <label for="missinglist">Missing issues</label>
1367 <textarea name="missinglist" id="missinglist" cols="60" rows="5"><!-- TMPL_VAR name="missinglist" --></textarea>
1370 <label for="opacnote">Note for OPAC</label>
1371 <textarea name="opacnote" id="opacnote" cols="60" rows="5"><!-- TMPL_VAR name="opacnote" --></textarea>
1374 <label for="librariannote">Note for staff</label>
1375 <textarea name="librariannote" id="librariannote" cols="60" rows="5"><!-- TMPL_VAR name="librariannote" --></textarea>
1379 <fieldset class="action"><input type="submit" value="Save subscription history" /></fieldset>
1386 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->