Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl

408 lines
20 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Serials &rsaquo; Serial Edition <!-- TMPL_VAR name="bibliotitle" --></title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script language="JavaScript" type="text/javascript">
//<![CDATA[
function popup(subscriptionid) {
window.open("subscription-renew.pl?subscriptionid="+subscriptionid,"subscription_renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
}
function barcode_check(){
<!-- TMPL_IF NAME="count" -->
var count = <!-- TMPL_VAR NAME="count" -->;
for(var i=1;i<=count;i++){
var barcodenum = "barcode"+i;
var statusnum = "status"+i;
var elembarcode = "document.getElementById('"+barcodenum+"')";
var elemstatus = "document.getElementById('"+statusnum+"')";
// alert(elembarcode+"\n"+eval(elembarcode+".value));
// alert(elemstatus+"\n"+eval(elemstatus+".value"));
if(eval(elembarcode+".value") =='' && eval(elemstatus+".value") == 2){
var answer = confirm("Leave barcode blank?\n - Note: unable to change this later");
if (answer){
document.f.submit();
} else {
return false;
}
}
if(eval(elembarcode+".value".indexOf('TEMP')) > 0 && eval(elemstatus+".value") == 2){
var answer = confirm("A barcode was not entered.\nDo you want to put in a barcode\nor do you want to use a system generated barcode?");
if (answer){
document.f.submit();
} else {
return false;
}
}
}
<!--/TMPL_IF-->
}
function Check(f) {
var total_errors=0;
// alert(f.field_value.length);
for (i=0 ; i<f.field_value.length ; i++) {
// alert (f.field_value[i].value);
if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
document.getElementById("error"+i).style.backgroundColor="#FF0000";
total_errors++;
} else {
// document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
}
}
var alertString2;
if (total_errors==0) {
document.f.submit();
} else {
alertString2 = _("Form not submitted because of the following problem(s)");
alertString2 += "\n------------------------------------------------------------------------------------\n";
alertString2 += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)");
alert(alertString2);
}
}
function unHideItems(index,labelindex) {
subfield = document.getElementById(index);
subfield.style.display = 'block';
label = document.getElementById(labelindex);
label.style.display='none';
}
function HideItems(index,labelindex) {
subfield = document.getElementById(index);
subfield.style.display = 'none';
label = document.getElementById(labelindex);
label.style.display='block';
}
function CloneSubfield(index){
var original = document.getElementById(index); //original <div>
var clone = original.cloneNode(true);
var new_key = CreateKey();
var old_id = original.getAttribute('id');
old_id=old_id.substr(12);
var new_id = old_id+new_key;
// set the attribute for the new 'div' subfields
var inputs = clone.getElementsByTagName('input');
var selects = clone.getElementsByTagName('select');
var textareas = clone.getElementsByTagName('textarea');
// input
var id_input = "";
for(var i=0,len=inputs.length; i<len ; i++ ){
id_input = inputs[i].getAttribute('id')+new_key;
inputs[i].setAttribute('id',id_input);
inputs[i].setAttribute('name',inputs[i].getAttribute('name'));
}
// select
for(var i=0,len=selects.length; i<len ; i++ ){
id_input = selects[i].getAttribute('id')+new_key;
selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
selects[i].setAttribute('name',selects[i].getAttribute('name'));
}
// textarea
for(var i=0,len=textareas.length; i<len ; i++ ){
id_input = textareas[i].getAttribute('id')+new_key;
textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
textareas[i].setAttribute('name',textareas[i].getAttribute('name'));
}
<!-- TMPL_UNLESS NAME='advancedMARCEditor' -->
// when cloning a subfield, reset its label too.
var label = clone.getElementsByTagName('label')[0];
label.setAttribute('for',id_input);
<!-- /TMPL_UNLESS -->
// setting a new if for the parent div
clone.setAttribute('id',new_id);
var CloneButtonPlus;
try {
var spans = clone.getElementsByTagName('span');
if(spans.length){
for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
if(spans[i].getAttribute('class') == 'buttonPlus'){
CloneButtonPlus = spans[i];
CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
var buttonUp = clone.getElementsByTagName('img')[0];
buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
}
}
}
}
catch(e){
// do nothig if ButtonPlus & CloneButtonPlus don't exist.
}
// insert this line on the page
original.parentNode.insertBefore(clone,original.nextSibling);
}
//]]>
</script>
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!-- TMPL_INCLUDE NAME="serials-search.inc" -->
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Serial Edition <i><!-- TMPL_VAR name="bibliotitle" --></i></div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Serial Edition <i><!-- TMPL_VAR name="bibliotitle" --></i></h1>
<form method="post" name="f" action="serials-edit.pl">
<!--onsubmit="return barcode_check()">-->
<div id="action">
<ul>
<!--TMPL_LOOP Name="subscriptions"-->
<li><a href="serials-collection.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" title="serial collection for <!--TMPL_VAR Name="bibliotitle"-->">Serial collection</a></li>
<li><a href="subscription-detail.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" title="detail of the subscription">Subscription #<!-- TMPL_VAR name="subscriptionid" --></a></li>
<!--TMPL_IF name="abouttoexpire"--><a href="#" onclick="javascript:popup(<!--TMPL_VAR Name="subscriptionid"-->)">Renew <!--TMPL_VAR Name="subscriptionid"--></a>
<!--/TMPL_IF-->
<!--/TMPL_LOOP-->
<li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->" title="go to <!-- TMPL_VAR name="bibliotitle" -->">Show Biblio</a></li></ul>
</div>
<!--TMPL_IF Name="barcode_not_unique" -->
Error : Barcode Not Unique For serialseq <!--TMPL_VAR Name="errserialseq"-->
<!--/TMPL_IF -->
<input type="hidden" name="op" value="serialchangestatus" />
<table>
<tr>
<th>Numbered</th>
<th>Published on</th>
<th>Expected on</th>
<th>Status</th>
<th>Notes</th>
</tr>
<!-- TMPL_LOOP name="serialslist" -->
<tr>
<td>
<input type="hidden" name="serialid" value="<!-- TMPL_VAR name="serialid" -->" />
<input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<input type="hidden" name="itemcount" value="<!-- TMPL_VAR name="issuesatonce" -->" />
<input type="hidden" name="user" value="<!-- TMPL_VAR name="librarian" -->" />
Issue <input type="text" name="serialseq" value="<!-- TMPL_VAR name="serialseq" -->" size="20" maxlength="100" />
</td>
<td>
<input type="text" name="publisheddate" value="<!-- TMPL_VAR name="publisheddate" -->" size="10" maxlength="15" />
</td>
<td>
<input type="text" name="planneddate" value="<!-- TMPL_VAR name="planneddate" -->" size="10" maxlength="15" />
</td>
<td>
<!--TMPL_IF name="editdisable"-->
<input type="hidden" name="status" id="status<!-- TMPL_VAR NAME="num" -->" value="1">
<select name="status" size="1" disabled="disabled">
<!--TMPL_ELSE-->
<!--TMPL_IF Name="serialsadditems"-->
<select name="status" size="1" id="status<!-- TMPL_VAR NAME="num" -->" onchange="if (this.value==2){unHideItems('items'+<!-- TMPL_VAR NAME="subscriptionid" -->+<!-- TMPL_VAR NAME="serialid" -->,'label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')} else { HideItems('items'+<!-- TMPL_VAR NAME="subscriptionid" -->+<!-- TMPL_VAR NAME="serialid" -->,'label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')}" >
<!--TMPL_ELSE -->
<select name="status" size="1" id="status<!-- TMPL_VAR NAME="num" -->" >
<!--/TMPL_IF-->
<!--/TMPL_IF-->
<!--TMPL_IF name="status1" -->
<option value="1" selected="selected">Expected</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status2" -->
<option value="2" selected="selected">Arrived</option>
<!--TMPL_ELSE -->
<option value="2">Arrived</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status3" -->
<option value="3" selected="selected">Late</option>
<!-- TMPL_ELSE -->
<option value="3">Late</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status4" -->
<option value="4" selected="selected">Missing</option>
<!-- TMPL_ELSE -->
<option value="4">Missing</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status7" -->
<option value="7" selected="selected">Claimed</option>
<!-- TMPL_ELSE -->
<option value="7">Claimed</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status5" -->
<option value="5" selected="selected">Not Available</option>
<!-- TMPL_ELSE -->
<option value="5">Not Available</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status6" -->
<option value="6" selected="selected">Delete</option>
<!-- TMPL_ELSE -->
<option value="6">Delete</option>
<!-- /TMPL_IF -->
</select>
</td>
<td>
<input type="text" name="notes" value="<!-- TMPL_VAR name="sernotes" -->" size="20" maxlength="255" />
</td>
</tr>
<!--TMPL_UNLESS Name="subscriptionexpired"-->
<!--TMPL_IF Name="serialsadditems"-->
<tr>
<td colspan="5">
<a id="label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->" style="color: grey; font-size: 80%; cursor: pointer;" onclick="unHideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
Click to add item</a>
<fieldset style="display:none;" id="items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->">
<legend><a style="cursor: pointer;" onclick="HideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
Item</a>
</legend>
<div id="cataloguing_additem_itemlist">
<!-- TMPL_LOOP NAME="items" -->
<div id="item<!-- TMPL_VAR NAME="serialid" --><!-- TMPL_VAR NAME="countitems" -->" class="items">
<!-- TMPL_LOOP NAME="iteminformation" -->
<div name="line" class="subfield_line" style="<!-- TMPL_VAR NAME='hidden' -->;" id="subfield<!-- TMPL_VAR NAME='serialid' --><!-- TMPL_VAR NAME='countitems' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->">
<label><!-- TMPL_VAR NAME="subfield" --> - <!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF --></label>
<!-- TMPL_VAR NAME="marc_value" -->
<input type="hidden" name="itemid" value="<!-- TMPL_VAR NAME="itemid" -->" />
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
<!-- TMPL_IF NAME="ITEM_SUBFIELDS_ARE_NOT_REPEATABLE" -->
<span class="buttonPlus" onclick="CloneSubfield('subfield<!-- TMPL_VAR NAME='serialid' --><!-- TMPL_VAR NAME='countitems' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->')">+</span>
<!-- /TMPL_IF -->
</div>
<!-- /tmpl_loop --><!-- /iteminformation -->
<input type="hidden" name="moditem" value="" />
<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->" />
<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->" />
<input type="hidden" name="serial" value="<!-- TMPL_VAR NAME="serialid" -->" />
<input type="hidden" name="bibnum" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<input type="hidden" name="itemid" value="<!-- TMPL_VAR NAME="itemid" -->" />
<input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
</div>
<!--/TMPL_LOOP--> <!-- /items -->
</div>
</fieldset>
</td>
</tr>
<!-- /TMPL_IF -->
<!--/TMPL_UNLESS -->
<!-- /TMPL_LOOP -->
<!-- TMPL_LOOP name="newserialloop" -->
<!--TMPL_UNLESS Name="subscriptionexpired"-->
<tr>
<td>
<input type="hidden" name="serialid" value="NEW" />
<input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<input type="hidden" name="itemcount" value="<!-- TMPL_VAR name="issuesatonce" -->" />
<input type="hidden" name="user" value="<!-- TMPL_VAR name="librarian" -->" />
Supplemental Issue <input type="text" name="serialseq" value="" size="20" maxlength="100" onchange="if (this.value!=''){unHideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!-- TMPL_VAR NAME="serialid" -->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')} else {HideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!-- TMPL_VAR NAME="serialid" -->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')}" />
</td>
<td>
<input type="text" name="publisheddate" value="<!-- TMPL_VAR name="publisheddate" -->" size="10" maxlength="15" />
</td>
<td>
<input type="text" name="planneddate" value="<!-- TMPL_VAR name="planneddate" -->" size="10" maxlength="15" />
</td>
<td>
<select name="status" size="1" id="addstatus<!-- TMPL_VAR NAME="num" -->">
<option value="">----</option>
<!--TMPL_IF name="status1" -->
<option value="1" selected="selected">Expected</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status2" -->
<option value="2" selected="selected">Arrived</option>
<!--TMPL_ELSE -->
<option value="2">Arrived</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status3" -->
<option value="3" selected="selected">Late</option>
<!-- TMPL_ELSE -->
<option value="3">Late</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status4" -->
<option value="4" selected="selected">Missing</option>
<!-- TMPL_ELSE -->
<option value="4">Missing</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status7" -->
<option value="7" selected="selected">Claimed</option>
<!-- TMPL_ELSE -->
<option value="7">Claimed</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status5" -->
<option value="5" selected="selected">Not Available</option>
<!-- TMPL_ELSE -->
<option value="5">Not Available</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status6" -->
<option value="6" selected="selected">Delete</option>
<!-- TMPL_ELSE -->
<option value="6">Delete</option>
<!-- /TMPL_IF -->
</select>
</td>
<td>
<input type="text" name="notes" value="" size="20" maxlength="255" />
</td>
</tr>
<!--TMPL_IF Name="serialsadditems"-->
<tr>
<td colspan="5">
<a id="label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->" style="color: grey; font-size: 80%; cursor: pointer;" onclick="unHideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
Click to add item</a>
<fieldset style="display:none;" id="items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->">
<legend><a style="cursor: pointer;" onclick="HideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
Item</a>
</legend>
<div id="cataloguing_additem_itemlist">
<div id="item<!-- TMPL_VAR NAME="serialid" --><!-- TMPL_VAR NAME="countitems" -->" class="items">
<!-- TMPL_LOOP NAME="iteminformation" -->
<div name="line" class="subfield_line" style="<!-- TMPL_VAR NAME='hidden' -->;" id="subfield<!-- TMPL_VAR NAME='serialid' --><!-- TMPL_VAR NAME='countitems' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->">
<label><!-- TMPL_VAR NAME="subfield" --> - <!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF --></label>
<!-- TMPL_VAR NAME="marc_value" -->
<input type="hidden" name="itemid" value="<!-- TMPL_VAR NAME="itemid" -->" />
<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
<!-- TMPL_IF NAME="ITEM_SUBFIELDS_ARE_NOT_REPEATABLE" -->
<span class="buttonPlus" onclick="CloneSubfield('subfield<!-- TMPL_VAR NAME='serialid' --><!-- TMPL_VAR NAME='countitems' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->')">+</span>
<!-- /TMPL_IF -->
</div>
<!-- /tmpl_loop -->
<input type="hidden" name="moditem" value="" />
<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->" />
<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->" />
<input type="hidden" name="serial" value="<!-- TMPL_VAR NAME="serialid" -->" />
<input type="hidden" name="bibnum" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<input type="hidden" name="itemid" value="<!-- TMPL_VAR NAME="itemid" -->" />
<input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
</div>
</div>
</fieldset>
</td>
</tr>
<!-- /TMPL_IF -->
<!--/TMPL_UNLESS -->
<!-- /TMPL_LOOP -->
</table>
<input type="submit" value="Save" class="button" accesskey="w" /> <!--onclick="Check(this.form)" -->
</form>
</div>
</div>
<div class="yui-b">
<!-- TMPL_INCLUDE NAME="serials-menu.inc" -->
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->