Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl

1148 lines
46 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Serials</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- Additions to enable Calendar system -->
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-system.css" />
<!-- End of additions -->
<!-- Additions to enable Calendar system -->
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar.js"></script>
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-en.js"></script>
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-setup.js"></script>
<!-- End of additions -->
<script type="text/javascript">
<!--
function _(s) { return s } // dummy function for gettext
// the english words used in display purposes
var text = new Array(_('Number'),_('Volume'),_('Issue'),_('Month'),_('Week'),_('Starting with:'),_('Rollover at:'),_('Choose Hemisphere:'),_('Northern'),_('Southern'),
_('Autumn'),_('Winter'),_('Spring'),_('Summer'),_('Fall'),_('Season'),_('Year'));
var is_season = 0;
var is_hemisphere = 1;
// common pre defined number patterns
function num_pattern() {
var patternchoice = document.getElementById("numberpattern").value;
switch(patternchoice){
case "2":
document.f.add1.value=1;
document.f.add2.value=1;
document.f.add3.value=1;
document.f.every1.value=12;
document.f.every2.value=1;
document.f.every3.value=1;
document.f.whenmorethan1.value=9999999;
document.f.whenmorethan2.value=12;
document.f.whenmorethan3.value=4;
document.f.setto1.value=0;
document.f.setto2.value=1;
document.f.setto3.value=1;
document.f.lastvalue1.value=1;
document.f.lastvalue2.value=1;
document.f.lastvalue3.value=1;
document.f.numberingmethod.value=_('Vol {X}, No {Y}, Issue {Z}');
moreoptions(text[1],text[0],text[2]);
display_table(0); // toggle info box on (1) or off (0)
break;
case "3":
document.f.add1.value=1;
document.f.add2.value=1;
document.f.add3.value='';
document.f.every1.value=12;
document.f.every2.value=1;
document.f.every3.value='';
document.f.whenmorethan1.value=9999999;
document.f.whenmorethan2.value=12;
document.f.whenmorethan3.value='';
document.f.setto1.value=0;
document.f.setto2.value=1;
document.f.setto3.value='';
document.f.lastvalue1.value=1;
document.f.lastvalue2.value=1;
document.f.lastvalue3.value='';
document.f.numberingmethod.value=_('Vol {X}, No {Y}');
moreoptions(text[1],text[0]);
display_table(0);
break;
case "4":
document.f.add1.value=1;
document.f.add2.value=1;
document.f.add3.value='';
document.f.every1.value=12;
document.f.every2.value=1;
document.f.every3.value='';
document.f.whenmorethan1.value=9999999;
document.f.whenmorethan2.value=12;
document.f.whenmorethan3.value='';
document.f.setto1.value=0;
document.f.setto2.value=1;
document.f.setto3.value='';
document.f.lastvalue1.value=1;
document.f.lastvalue2.value=1;
document.f.lastvalue3.value='';
document.f.numberingmethod.value=_('Vol {X}, Issue {Y}');
moreoptions(text[1],text[2]);
display_table(0);
break;
case "5":
document.f.add1.value=1;
document.f.add2.value=1;
document.f.add3.value='';
document.f.every1.value=12;
document.f.every2.value=1;
document.f.every3.value='';
document.f.whenmorethan1.value=9999999;
document.f.whenmorethan2.value=12;
document.f.whenmorethan3.value='';
document.f.setto1.value=0;
document.f.setto2.value=1;
document.f.setto3.value='';
document.f.lastvalue1.value=1;
document.f.lastvalue2.value=1;
document.f.lastvalue3.value='';
document.f.numberingmethod.value=_('No {X}, Issue {Y}');
moreoptions(text[0],text[2]);
display_table(0);
break;
case "6":
var d = new Date();
var sYear = d.getFullYear();
document.f.add1.value=1;
document.f.add2.value='1';
document.f.add3.value='';
document.f.every1.value=4;
document.f.every2.value='1';
document.f.every3.value='';
document.f.whenmorethan1.value=9999999;
document.f.whenmorethan2.value='4';
document.f.whenmorethan3.value='';
document.f.setto1.value=0;
document.f.setto2.value='1';
document.f.setto3.value='';
document.f.lastvalue1.value=sYear;
document.f.lastvalue2.value='1';
document.f.lastvalue3.value='';
document.f.periodicity.value='8';
document.f.numberingmethod.value=_('{Y} {X}');
moreoptions_seasons(text[15],sYear);
display_table(0);
is_season = 1;
break;
case "7":
display_table(1);
document.getElementById("more_options").innerHTML = '';
document.f.irreg_check.value=1;
break;
case "8":
var d = new Date();
var sYear = d.getFullYear();
document.f.add1.value=1;
document.f.add2.value=1;
document.f.add3.value='';
document.f.every1.value=12;
document.f.every2.value=1;
document.f.every3.value='';
document.f.whenmorethan1.value=9999999;
document.f.whenmorethan2.value=12;
document.f.whenmorethan3.value='';
document.f.setto1.value=0;
document.f.setto2.value=1;
document.f.setto3.value='';
document.f.lastvalue1.value=sYear;
document.f.lastvalue2.value='1';
document.f.lastvalue3.value='';
document.f.periodicity.value=1;
document.f.numberingmethod.value=_('{X}/{Y}');
display_table(0);
break;
default:
document.f.add1.value=1;
document.f.add2.value='';
document.f.add3.value='';
document.f.every1.value=1;
document.f.every2.value='';
document.f.every3.value='';
document.f.whenmorethan1.value=9999999;
document.f.whenmorethan2.value='';
document.f.whenmorethan3.value='';
document.f.setto1.value=0;
document.f.setto2.value='';
document.f.setto3.value='';
document.f.lastvalue1.value=1;
document.f.lastvalue2.value='';
document.f.lastvalue3.value='';
document.f.numberingmethod.value='{X}';
moreoptions_daily_check(text[0]);
document.f.irreg_check.value=1;
display_table(0);
break;
}
}
function display_table(n) {
if(n==1){
document.getElementById("basetable").style.display = 'block';
} else {
document.getElementById("basetable").style.display = 'none';
}
}
function modify_num_pattern() {
document.getElementById("numberpattern").value = '<!-- TMPL_VAR NAME="numberpattern" -->';
num_pattern();
document.f.add1.value='<!-- TMPL_VAR NAME="add1" -->';
document.f.add2.value='<!-- TMPL_VAR NAME="add2" -->';
document.f.add3.value='<!-- TMPL_VAR NAME="add3" -->';
document.f.every1.value='<!-- TMPL_VAR NAME="every1" -->';
document.f.every2.value='<!-- TMPL_VAR NAME="every2" -->';
document.f.every3.value='<!-- TMPL_VAR NAME="every3" -->';
document.f.whenmorethan1.value='<!-- TMPL_VAR NAME="whenmorethan1" -->';
document.f.whenmorethan2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
document.f.whenmorethan3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
document.f.setto1.value='<!-- TMPL_VAR NAME="setto1" -->';
document.f.setto2.value='<!-- TMPL_VAR NAME="setto2" -->';
document.f.setto3.value='<!-- TMPL_VAR NAME="setto3" -->';
document.f.lastvalue1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
document.f.lastvalue2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
document.f.lastvalue3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
document.f.numberingmethod.value='<!-- TMPL_VAR NAME="numberingmethod" -->';
var more_strY;
var more_strZ;
<!-- TMPL_IF NAME="add2" -->
if(<!-- TMPL_VAR NAME="add2" --> > 0){
more_strY="Y";
}
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="add3" -->
if(<!-- TMPL_VAR NAME="add3" --> > 0){
more_strZ="Z";
}
<!-- /TMPL_IF -->
document.f.lastvaluetemp1.value='<!-- TMPL_VAR NAME="lastvalue1" -->';
if(more_strY){
document.f.lastvaluetemp2.value='<!-- TMPL_VAR NAME="lastvalue2" -->';
document.f.whenmorethantemp2.value='<!-- TMPL_VAR NAME="whenmorethan2" -->';
}
if(more_strZ){
document.f.lastvaluetemp3.value='<!-- TMPL_VAR NAME="lastvalue3" -->';
document.f.whenmorethantemp3.value='<!-- TMPL_VAR NAME="whenmorethan3" -->';
}
}
// a pre check with more options to see if 'number' and '1/day' are chosen
function moreoptions_daily_check(x) {
var periodicity = document.f.periodicity.value;
var errortext='';
if(periodicity == 1){
document.getElementById("irregularity").innerHTML = '';
var daynames = new Array(_('Monday'),_('Tuesday'),_('Wednesday'),_('Thursday'),_('Friday'),_('Saturday'),_('Sunday'));
errortext =_("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
for(var j=0;j<daynames.length;j++){
errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+daynames[j]+" &nbsp; ";
}
var error = errortext;
moreoptions(x);
document.getElementById("irregularity").innerHTML = error;
} else {
document.getElementById("irregularity").innerHTML = '';
document.getElementById("more_options").innerHTML = '';
moreoptions(x);
}
}
// to dispaly the more options section
function moreoptions(x,y,z){
document.getElementById("irregularity").innerHTML = '';
document.getElementById("more_options").innerHTML = '';
var textbox = '';
// alert("X: "+x+"Y: "+y+"Z: "+z);
if(x){
textbox +="<table>\n<tr><td>&nbsp;<\/td><td>"+x+"<\/td>";
if(y){
textbox +="<td>"+y+"<\/td>";
if(z){
textbox +="<td>"+z+"<\/td>";
}
}
textbox +="<\/tr>\n";
textbox +="<tr><td>"+text[5]+"<\/td><td><input type='text' name='lastvaluetemp1' size='4' onkeyup='moreoptionsupdate(\"lastvalue1\")'><\/td>\n";
if(y){
textbox +="<td><input type='text' name='lastvaluetemp2' size='4' onkeyup='moreoptionsupdate(\"lastvalue2\")'><\/td>\n";
if(z){
textbox +="<td><input type='text' name='lastvaluetemp3' size='4' onkeyup='moreoptionsupdate(\"lastvalue3\")'><\/td>\n";
}
}
textbox +="<\/tr>\n";
if(y){
textbox +="<tr><td>"+text[6]+"<\/td>";
textbox +="<td><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"<\/a><\/td>\n";
textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
if(z){
textbox +="<td><input type='text' name='whenmorethantemp3' size='4' onkeyup='moreoptionsupdate(\"whenmorethan3\",1)'><\/td>\n";
}
textbox +="<\/tr>";
} else {
textbox +="<tr> <td>"+_('issues expected')+"</td><td><input type='text' name='issuesexpectedtemp1' size='4' onkeyup='moreoptionsupdate(\"issuesexpected1\",0)'><br/><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"</a></td></tr>";
}
textbox +="<\/table>\n";
}
document.getElementById("more_options").innerHTML = textbox;
}
function hemispheres(chosen){
var selbox = document.getElementById("season1");
if(selbox){
var selboxselected = selbox.options[selbox.selectedIndex].value;
selbox.options.length = 0;
if (chosen == "1") {
selbox.options[selbox.options.length] = new Option(text[11],'1');
selbox.options[selbox.options.length] = new Option(text[12],'2');
selbox.options[selbox.options.length] = new Option(text[13],'3');
selbox.options[selbox.options.length] = new Option(text[14],'4');
is_hemisphere = 1;
selbox.options[selboxselected-1].selected = true;
}
if (chosen == "2") {
selbox.options[selbox.options.length] = new Option(text[13],'1');
selbox.options[selbox.options.length] = new Option(text[10],'2');
selbox.options[selbox.options.length] = new Option(text[11],'3');
selbox.options[selbox.options.length] = new Option(text[12],'4');
is_hemisphere = 2;
selbox.options[selboxselected-1].selected = true;
}
}
}
// to dispaly the more options section for seasons
function moreoptions_seasons(x,y){
document.getElementById("irregularity").innerHTML = '';
document.getElementById("more_options").innerHTML = '';
var textbox = '';
// alert("X: "+x+"Year: "+y);
if(x){
var hemi_select = parseInt('<!-- TMPL_VAR NAME="hemisphere" -->');
textbox +="<table>\n<tr><td>"+ text[7] +"<\/td><td colspan='2'><select name='hemisphere' onchange='hemispheres(this.options[this.selectedIndex].value)'>";
for(var i = 1; i <= 2; i++){
textbox +="<option value='"+i+"'";
if(i == hemi_select){
textbox += " selected "
}
textbox +=">"+text[i+7]+"<\/option>";
}
textbox +="<\/select><\/td><\/tr>\n";
textbox +="<tr><td>&nbsp;<\/td><td>"+x+"<\/td>";
textbox +="<td>"+text[16]+"<\/td>";
textbox +="<\/tr>\n";
textbox +="<tr><td>"+text[5]+"<\/td><td><select name='lastvaluetemp2' id='season1' onchange='moreoptionsupdate(\"lastvalue2\")'>";
for(var j = 1; j <= 4; j++){
textbox +="<option value='"+j+"'>"+text[j+10]+"<\/option>";
}
textbox +="<\/select><\/td><td><select name='lastvaluetemp1' onchange='moreoptionsupdate(\"lastvalue1\")'>";
for(var k = parseInt(y); k <= parseInt(y)+15; k++){
textbox +="<option value='"+k+"'>"+k+"<\/option>";
}
textbox +="<\/select><\/td><\/tr>\n";
textbox +="<tr><td>"+text[6]+"<\/td>";
textbox +="<td><a href='javascript:irregularity_check()'>"+_('Irregularity?')+"<\/a><\/td>\n";
textbox +="<td><input type='text' name='whenmorethantemp2' size='4' onkeyup='moreoptionsupdate(\"whenmorethan2\",1)'><\/td>\n";
textbox +="<\/tr><\/table>\n";
}
document.getElementById("more_options").innerHTML = textbox;
}
function irregularity_check(){
document.f.irreg_check.value = 1; // Irregularity button now pushed
var periodicity = document.f.periodicity.value;
var rollover = document.f.issuesexpected1.value;
if(document.f.whenmorethantemp2){
rollover = document.f.whenmorethantemp2.value;
}
if(document.f.whenmorethantemp3){
rollover = document.f.whenmorethantemp3.value;
}
var error='';
var toobig;
var expected;
var errortext = _("<b>Warning irregularity detected<\/b><br \/>");
switch(periodicity){
case "12":
if(rollover < 730) expected =730;
if(rollover > 730) {
expectedover=730;
toobig=1;
}
break;
case "1":
if(rollover < 365) expected =365;
if(rollover > 365) {
expectedover=365;
toobig=1;
}
break;
case "13":
if(rollover < 156) expected =156;
if(rollover > 156) {
expectedover=156;
toobig=1;
}
break;
case "2":
if(rollover < 52) expected =52;
if(rollover > 52){
expectedover=52;
toobig=1;
}
break;
case "3":
if(rollover < 26) expected =26;
if(rollover > 26){
expectedover=26;
toobig=1;
}
break;
case "4":
if(rollover < 17) expected =17;
if(rollover > 17){
expectedover=17;
toobig=1;
}
break;
case "5":
if(rollover < 12) expected =12;
if(rollover > 12){
expectedover=12;
toobig=1;
}
break;
case "6":
if(rollover < 6) expected =6;
if(rollover > 6){
expectedover=6;
toobig=1;
}
break;
case "7":
if(rollover < 4) expected =4;
if(rollover > 4){
expectedover=4;
toobig=1;
}
break;
case "8":
if(rollover < 4) expected =4;
if(rollover > 4){
expectedover=4;
toobig=1;
}
break;
case "9":
if(rollover < 2) expected =2;
if(rollover > 2){
expectedover=2;
toobig=1;
}
break;
case "10":
if(rollover < 1) expected =1;
if(rollover > 1){
expectedover=1;
toobig=1;
}
break;
default:
break;
}
if(expected){
if(expected == 365 || expected==730){
var daynames = new Array(_('Monday'),_('Tuesday'),_('Wednesday'),_('Thursday'),_('Friday'),_('Saturday'),_('Sunday'));
errortext += _("Please indicate which days of the week you <b>DO NOT<\/b> expect to receive issues.<br \/>");
for(var j=0;j<daynames.length;j++){
errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+daynames[j]+" &nbsp; ";
}
error=errortext;
} else {
errortext +=expected+_(" issues expected ")+rollover+_(" were entered. <br \/>Please indicate which date(s) an issue is not expected<br \/>");
var count=0;
for(var i=rollover;i<expected;i++){
errortext +="<select name='irregular' id='irregular"+count+"' onchange='display_example(expected)'>\n";
errortext +=irregular_options(periodicity);
errortext +="<\/select>\n";
count++;
}
error=errortext;
}
}
if(toobig){
errortext +=expectedover+_(" issues expected ")+rollover+_(" were entered.<br \/> You seem to have indicated more issues per year than expected.");
error=errortext;
}
if(error.length ==0){
error=_('No irregularities noticed');
}
display_example(expected);
document.getElementById("irregularity").innerHTML = error;
}
function irregular_options(periodicity){
var titles;
var count;
<!-- TMPL_IF NAME="weekarrayjs" -->
var weeks = new Array(<!-- TMPL_VAR NAME="weekarrayjs" -->);
<!-- /TMPL_IF -->
var months = new Array(_('January'),_('February'),_('March'),_('April'),_('May'),_('June'),_('July'),_('August'),_('September'),_('October'),_('November'),_('December'));
var seasons = new Array(_('Autumn'),_('Winter'),_('Spring'),_('Summer'),_('Fall'));
var errortext='';
if(periodicity == 1) {
expected = 366;
titles = "Day";
count = 1;
}
if(periodicity == 2 || periodicity == 3 || periodicity == 4) {
expected = 52;
<!-- TMPL_IF NAME="weekarrayjs" -->
titles = weeks;
count = <!-- TMPL_VAR NAME="weekno" -->;
<!-- TMPL_ELSE -->
titles = "Week";
count = 1;
<!-- /TMPL_IF -->
}
if(periodicity == 5 || periodicity == 6 || periodicity == 7 || periodicity == 8 || periodicity == 9) {
if(periodicity == 8) {
is_season = 1; // setting up from edit page
}
if(is_season){
titles = seasons;
expected = 4;
if(is_hemisphere == 2){
count = 2;
} else {
count = 1;
}
} else {
titles = months;
expected = 12;
count = 1;
}
}
for(var j=1;j<=expected;j++){
if(isArray(titles)){
if(count>expected){
count = count-expected;
}
if(is_season && is_hemisphere == 1){
errortext +="<option value='"+((count*3)-2)+"'>"+titles[j]+"<\/option>\n";
// alert("value: "+((count*3)-2)+" title: "+titles[j]);
} else if(is_season && is_hemisphere == 2){
errortext +="<option value='"+((count*3)-2)+"'>"+titles[j-1]+"<\/option>\n";
// alert("value: "+((count*3)-2)+" title: "+titles[j-1]);
} else {
errortext +="<option value='"+count+"'>"+titles[j-1]+"<\/option>\n";
}
count++;
} else {
errortext +="<option value='"+j+"'>"+titles+" "+j+"<\/option>\n";
}
}
return errortext;
}
function irregular_order(){
var irregular = '<!-- TMPL_VAR NAME="irregularity" -->';
var periodicity = document.f.periodicity.value;
var irregarray = irregular.split(',');
if(periodicity ==1){
for(j=0;j<irregarray.length;j++){
document.getElementById("irregular"+irregarray[j]).checked = true;
}
} else {
for(i=0;i<irregarray.length;i++){
document.getElementById("irregular"+i).value = irregarray[i];
}
}
}
function display_example(expected){
var startfrom1 = parseInt(document.f.lastvalue1.value);
var startfrom2 = parseInt(document.f.lastvalue2.value);
var startfrom3 = parseInt(document.f.lastvalue3.value);
var every1 = parseInt(document.f.every1.value);
var every2 = parseInt(document.f.every2.value);
var every3 = parseInt(document.f.every3.value);
var numberpattern = document.f.numberingmethod.value;
var whenmorethan2 = parseInt(document.f.whenmorethan2.value);
var whenmorethan3 = parseInt(document.f.whenmorethan3.value);
var setto2 = parseInt(document.f.setto2.value);
var setto3 = parseInt(document.f.setto3.value);
var displaytext = _('Based on the information<br \/>entered the Numbering Pattern<br \/>will look like this<br \/>\n');
if(startfrom3>0){
var count=startfrom3-1;
var count2=startfrom2;
for(var i=0;i<12;i++){
if(count>=whenmorethan3){
count=setto3;
if(count2>=whenmorethan2){
startfrom1++;
count2=setto2;
} else {
count2++;
}
} else {
count++;
}
displaytext += numberpattern.replace(/{Z}/,count)+'\n';
displaytext = displaytext.replace(/{Y}/,count2)+'<br \/>\n';
displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
}
}
if(startfrom2>0 && !startfrom3){
var count=startfrom2-1;
for(var i=0;i<12;i++){
if(count>=whenmorethan2){
startfrom1++;
count=setto2;
} else {
count++;
}
if(is_season){
if(is_hemisphere == 2){
if(count == 1) {
displaytext += numberpattern.replace(/{Y}/,text[count+12])+'\n';
} else {
displaytext += numberpattern.replace(/{Y}/,text[count+8])+'\n';
}
} else {
displaytext += numberpattern.replace(/{Y}/,text[count+10])+'\n';
}
} else {
displaytext += numberpattern.replace(/{Y}/,count)+'\n';
}
displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
}
}
if(startfrom1>0 && !startfrom2 && !startfrom3){
var offset=eval(document.f.issuesexpected1.value);
if (!offset){
offset = 12
}
for(var i=startfrom1;i<(startfrom1+offset);i+=every1){
displaytext += numberpattern.replace(/{X}/,i)+'<br \/>\n';
}
}
displaytext = "<div style='padding: 5px; background-color: #CCCCCC'>"+displaytext+"<\/div>";
document.getElementById("displayexample").innerHTML = displaytext;
}
function isArray(obj) {
if (obj.constructor.toString().indexOf("Array") == -1)
return false;
else
return true;
}
function moreoptionsupdate(fieldnames,rollover){
fieldname = fieldnames;
fld = fieldname.length;
fld = fld-1;
fieldnametempnumber = fieldname.substr(fld);
//alert(fieldnametempnumber);
fieldnametemp = fieldname.slice(0,-1)+"temp"+fieldnametempnumber;
// alert(fieldnametemp);
eval("document.f."+fieldname+".value = document.f."+fieldnametemp+".value");
// alert (fieldname+" : "+eval("document.f."+fieldname+".value") +' '+fieldnametemp+' : ' +eval("document.f."+fieldnametemp+".value"));
if(rollover){
eval("document.f.every"+(fieldnametempnumber-1)+".value = document.f."+fieldnametemp+".value");
}
}
function check_input(e){
var unicode=e.charCode? e.charCode : e.keyCode
if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
if (unicode<48||unicode>57) { // if not a number
alert(_("Needs to be entered in digit form -eg 10"));
return false // disable key press
}
}
}
function Create_biblio(f)
{
window.open('/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup','FindABibIndex','width=1024,height=768,toolbar=no,scrollbars=yes');
}
function Plugin(f)
{
window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
}
function FindAcqui(f)
{
window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
}
function Find_ISSN(f)
{
window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
}
function Check(f) {
if (f.startdate.value.length != 0 && f.sublength.value > 0) {
if (f.irreg_check.value == 1) {
document.f.submit();
} else {
if(f.numbering_pattern.value == ''){
alert(_("need to choose a numbering pattern"));
} else {
alert(_("need to check for irregularity by clicking 'Irregularity?'"));
}
}
} else {
alert(_('field marked with * are mandatory'));
}
return false;
}
<!-- TMPL_IF name="mod" -->
window.onload = modify_num_pattern();
<!-- TMPL_IF name="hemisphere" -->
window.onload = hemispheres(<!-- TMPL_VAR NAME="hemisphere" -->);
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF name="irregularity" -->
window.onload = irregularity_check();
window.onload = irregular_order();
<!-- /TMPL_IF -->
-->
</script>
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!--TMPL_INCLUDE NAME="menu-serials.inc" -->
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<!-- TMPL_IF name="mod" -->
<h1>Modify a subscription</h1>
<form method="post" name="f">
<input type="hidden" name="op" value="modsubscription" />
<input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
<!-- TMPL_ELSE -->
<h1>Add a subscription (Serial Holdings Record)</h1>
<form method="post" action="/cgi-bin/koha/serials/subscription-add.pl" name="f">
<input type="hidden" name="op" value="addsubscription" />
<!-- /TMPL_IF -->
<input type="hidden" name="user" value="<!-- TMPL_VAR name="loggedinusername" -->" />
<input type="hidden" name="irreg_check" value="0" />
<input type="hidden" name="issuesexpected1" value="0" />
<h2>Subscription information for subscription #<!--TMPL_VAR name="subscriptionid"--></h2>
<table>
<tr>
<td>Librarian:</td>
<td><!-- TMPL_VAR name="loggedinusername" --></td>
</tr>
<tr>
<td><label>Supplier:</label></td>
<td><input type="text" name="aqbooksellerid" value="<!-- TMPL_VAR name="aqbooksellerid" -->" size="8" /> (<input type="text" name="aqbooksellername" value="<!-- TMPL_VAR name="aqbooksellername" -->" disabled="disabled" readonly="readonly" />) <a href="#" onclick="FindAcqui(f)">Search for a Supplier</a></td>
</tr>
<tr>
<td><label>Biblio</label></td>
<td>
<input type="text" name="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size="8" />
(<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled="disabled" readonly="readonly" />)
<a href="#" onclick="Plugin(f)">Search for Biblio</a> <!--TMPL_UNLESS Name="mod"--> |
<a href="#" onclick="Create_biblio(f)">Create Biblio</a><!--/TMPL_UNLESS-->
</td>
</tr>
<tr>
<td><label>Call Number</label></td>
<td><input type="text" name="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20" /></td>
</tr>
<tr>
<td>Branch</td>
<td>
<select name="branchcode">
<option value="">Any branch</option>
<!-- TMPL_LOOP name="branchloop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select> (select a branch)
</td>
</tr>
<tr>
<td><label>Notes</label></td>
<td><textarea name="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea></td>
</tr>
<tr>
<td><label>Management Notes</label></td>
<td><textarea name="internalnotes" cols="30" rows="2"><!-- TMPL_VAR name="internalnotes" --></textarea></td>
</tr>
<tr>
<td>Patron alert with </td>
<td>
<select name="letter">
<option value="">un-activated</option>
<!-- TMPL_LOOP name="letterloop" -->
<!-- TMPL_IF name="selected" -->
<option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="lettername" --></option>
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="lettername" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select> (select a letter &amp; patrons will be able to "follow" this subscription and recieve a mail on every new issue)
</td>
</tr>
<tr>
<td><b>Warning:</b></td>
<td>
<ul>
<li>Remember you <b>must</b> have created a biblio <b>before</b> creating a subscription</li>
<li>You also must have selected a supplier if you want to ask for late issues</li>
</ul>
</td>
</tr>
</table>
<div id="subscription_form_planning">
<h2>Planning</h2>
<table>
<tr>
<td>First Issue ETA:</td>
<td>
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button2" style="cursor: pointer;" alt="" />
<input type="text" name="firstacquidate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="acqui_date" />
<!-- both scripts for calendar must follow the input field -->
<script type="text/javascript">
Calendar.setup({
inputField:"acqui_date",
ifFormat : "%d/%m/%Y",
button : "button2",
align : "Tl"
});
</script>
<script type="text/javascript">
Calendar.setup({
inputField : "acqui_date",
ifFormat : "%d/%m/%Y",
button : "acqui_date",
align : "Tl"
});
</script>
</td>
<td rowspan="5">
<div id="displayexample"></div>
</td>
</tr>
<tr>
<td>Frequency: (*)</td>
<td>
<select name="periodicity" size="1" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1);num_pattern;">
<option value="" selected="selected">-- please choose --</option>
<!-- TMPL_IF name="periodicity16" -->
<option value="16" selected="selected">Without Periodicity</option>
<!-- TMPL_ELSE -->
<option value="16">Without Periodicity</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity48" -->
<option value="48" selected="selected">Unknown</option>
<!-- TMPL_ELSE -->
<option value="48">Unknown</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity32" -->
<option value="32" selected="selected">Irregular</option>
<!-- TMPL_ELSE -->
<option value="32">Irregular</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity12" -->
<option value="12" selected="selected">2/day</option>
<!-- TMPL_ELSE -->
<option value="12">2/day</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity1" -->
<option value="1" selected="selected">1/day</option>
<!-- TMPL_ELSE -->
<option value="1">1/day</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity13" -->
<option value="13" selected="selected">3/week</option>
<!-- TMPL_ELSE -->
<option value="13">3/week</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity2" -->
<option value="2" selected="selected">1/week</option>
<!-- TMPL_ELSE -->
<option value="2">1/week</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity3" -->
<option value="3" selected="selected">1/2 weeks (2/month)</option>
<!-- TMPL_ELSE -->
<option value="3">1/2 weeks (2/months)</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity4" -->
<option value="4" selected="selected">1/3 weeks</option>
<!-- TMPL_ELSE -->
<option value="4">1/3 weeks</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity5" -->
<option value="5" selected="selected">1/month</option>
<!-- TMPL_ELSE -->
<option value="5">1/month</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity6" -->
<option value="6" selected="selected">1/2 months (6/year)</option>
<!-- TMPL_ELSE -->
<option value="6">1/2 months (6/year)</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity7" -->
<option value="7" selected="selected">1/3 months (1/quarter)</option>
<!-- TMPL_ELSE -->
<option value="7">1/3 months (1/quarter)</option>
<!-- /TMPL_IF -->
<!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
<!-- TMPL_IF name="periodicity8" -->
<option value="8" selected="selected">1/quarter (seasonal)</option>
<!-- TMPL_ELSE -->
<option value="8">1/quarter (seasonal)</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity9" -->
<option value="9" selected="selected">2/years</option>
<!-- TMPL_ELSE -->
<option value="9">2/year</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity10" -->
<option value="10" selected="selected">1/year</option>
<!-- TMPL_ELSE -->
<option value="10">1/year</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="periodicity11" -->
<option value="11" selected="selected">1/2 years</option>
<!-- TMPL_ELSE -->
<option value="11">1/2 years</option>
<!-- /TMPL_IF -->
</select>
Manual History :<input type="checkbox" name="manualhist" value="1" />
</td>
</tr>
<tr>
<td>Numbering Pattern:</td>
<td>
<select name="numbering_pattern" size="1" id="numberpattern" onchange="num_pattern()">
<option value="" selected="selected">-- please choose --</option>
<!-- TMPL_IF name="numberpattern1" -->
<option value="1" selected="selected">Number</option>
<!-- TMPL_ELSE -->
<option value="1">Number</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="numberpattern2" -->
<option value="2" selected="selected">Volume, Number, Issue</option>
<!-- TMPL_ELSE -->
<option value="2">Volume, Number, Issue</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="numberpattern3" -->
<option value="3" selected="selected">Volume, Number</option>
<!-- TMPL_ELSE -->
<option value="3">Volume, Number</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="numberpattern4" -->
<option value="4" selected="selected">Volume, Issue</option>
<!-- TMPL_ELSE -->
<option value="4">Volume, Issue</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="numberpattern5" -->
<option value="5" selected="selected">Number, Issue</option>
<!-- TMPL_ELSE -->
<option value="5">Number, Issue</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="numberpattern6" -->
<option value="6" selected="selected">Seasonal only</option>
<!-- TMPL_ELSE -->
<option value="6">Seasonal only</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="numberpattern8" -->
<option value="8" selected="selected">Year/Number</option>
<!-- TMPL_ELSE -->
<option value="8">Year/Number</option>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="numberpattern7" -->
<option value="7" selected="selected">None of the above</option>
<!-- TMPL_ELSE -->
<option value="7">None of the above</option>
<!-- /TMPL_IF -->
</select>
<div id="more_options"></div>
<div id="irregularity"></div>
</td>
</tr>
<tr>
<td>Begins On: (*)</td>
<td>
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="" />
<input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size="13" maxlength="10" id="beginning_date" />
<!-- both scripts for calendar must follow the input field -->
<script type="text/javascript">
Calendar.setup({
inputField : "beginning_date",
ifFormat : "%d/%m/%Y",
button : "button1",
align : "Tl"
});
</script>
<script type="text/javascript">
Calendar.setup({
inputField : "beginning_date",
ifFormat : "%d/%m/%Y",
button : "beginning_date",
align : "Tl"
});
</script>
</td>
</tr>
<tr>
<td>Subscription length</td>
<td>
<select name="subtype">
<!-- TMPL_LOOP NAME="subtype" -->
<!-- TMPL_IF NAME="selected" -->
<option value="<!-- TMPL_VAR NAME="name" -->" selected="selected">
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR NAME="name" -->">
<!-- /TMPL_IF -->
<!-- TMPL_VAR NAME="name" -->
</option>
<!-- /TMPL_LOOP -->
</select>
<input type="text" name="sublength" value="<!-- TMPL_VAR name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (*) (enter amount in numerals)
</td>
</tr>
<tr>
<td>Numbering calculation</td>
<td>Numbering formula: <input type="text" name="numberingmethod" id="numberingmethod" value="<!-- TMPL_VAR name="numberingmethod" -->" /></td>
</tr>
<tr>
<td colspan="3">
<div id="basetable" style="display: none;">
<table class="small">
<tr>
<th>&nbsp;</th>
<th>X</th>
<th>Y</th>
<th>Z</th>
</tr>
<tr>
<td>Add</td>
<td>
<input type="text" name="add1" value="<!-- TMPL_VAR name="add1" -->" />
</td>
<td>
<input type="text" name="add2" value="<!-- TMPL_VAR name="add2" -->" />
</td>
<td>
<input type="text" name="add3" value="<!-- TMPL_VAR name="add3" -->" />
</td>
</tr>
<tr>
<td>once every</td>
<td><input type="text" name="every1" value="<!-- TMPL_VAR name="every1" -->" /></td>
<td><input type="text" name="every2" value="<!-- TMPL_VAR name="every2" -->" /></td>
<td><input type="text" name="every3" value="<!-- TMPL_VAR name="every3" -->" /></td>
</tr>
<tr>
<td>When more than</td>
<td><input type="text" name="whenmorethan1" value="<!-- TMPL_VAR name="whenmorethan1" -->" /></td>
<td><input type="text" name="whenmorethan2" value="<!-- TMPL_VAR name="whenmorethan2" -->" /></td>
<td><input type="text" name="whenmorethan3" value="<!-- TMPL_VAR name="whenmorethan3" -->" /></td>
</tr>
<!-- TMPL_IF name="mod" -->
<tr>
<td>The loop is for instance</td>
<td><input type="text" name="innerloop1" value="<!-- TMPL_VAR name="innerloop1" -->" /></td>
<td><input type="text" name="innerloop2" value="<!-- TMPL_VAR name="innerloop2" -->" /></td>
<td><input type="text" name="innerloop3" value="<!-- TMPL_VAR name="innerloop3" -->" /></td>
</tr>
<!-- /TMPL_IF -->
<tr>
<td>Set back to</td>
<td><input type="text" name="setto1" value="<!-- TMPL_VAR name="setto1" -->" /></td>
<td><input type="text" name="setto2" value="<!-- TMPL_VAR name="setto2" -->" /></td>
<td><input type="text" name="setto3" value="<!-- TMPL_VAR name="setto3" -->" /></td>
</tr>
<tr>
<td>
<!-- TMPL_IF name="mod" -->
Last value
<!-- TMPL_ELSE -->
Begins with
<!-- /TMPL_IF -->
</td>
<td><input type="text" name="lastvalue1" value="<!-- TMPL_VAR name="lastvalue1" -->" /></td>
<td><input type="text" name="lastvalue2" value="<!-- TMPL_VAR name="lastvalue2" -->" /></td>
<td><input type="text" name="lastvalue3" value="<!-- TMPL_VAR name="lastvalue3" -->" /></td>
</tr>
</table>
</div>
</td></tr>
</table>
</div>
<!--TMPL_IF Name="history"-->
<div id="subscription_form_history">
<h2>History</h2>
<table>
<tr>
<td>Starting date:</td>
<td><input type="text" name="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->" /> (the date of the 1st subscription)</td>
</tr>
<tr>
<td>Ending date:</td>
<td><input type="text" name="enddate" value="<!-- TMPL_VAR name="enddate" -->" />(if empty : subscription still active)</td>
</tr>
<tr>
<td>Recieved issues</td>
<td><textarea name="recievedlist" cols="60" rows="5"><!-- TMPL_VAR name="recievedlist" --></textarea></td>
</tr>
<tr>
<td>Missing issues</td>
<td><textarea name="missinglist" cols="60" rows="5"><!-- TMPL_VAR name="missinglist" --></textarea></td>
</tr>
<tr>
<td>Opac's notes</td>
<td><textarea name="opacnote" cols="60" rows="5"><!-- TMPL_VAR name="opacnote" --></textarea></td>
</tr>
<tr>
<td>Librarian notes</td>
<td><textarea name="librariannote" cols="60" rows="5"><!-- TMPL_VAR name="librariannote" --></textarea></td>
</tr>
</table>
</div>
<!--/TMPL_IF-->
<!-- TMPL_IF name="mod" -->
<input type="button" value="Save subscription" onclick="Check(this.form)" accesskey="w" />
<!-- TMPL_ELSE -->
<input type="button" value="Add subscription" onclick="Check(this.form)" accesskey="w" />
<!-- /TMPL_IF -->
</form>
</div>
</div>
</div>
<!-- TMPL_INCLUDE NAME="mainmenu.inc" -->
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->