alert(alertString2);
}
}
-<!--TMPL_IF Name="serialsadditems"-->
function unHideItems(index,labelindex) {
subfield = document.getElementById(index);
subfield.style.display = 'block';
label = document.getElementById(labelindex);
label.style.display='block';
}
-<!--/TMPL_IF>
+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>
<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="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_IF name="subscriptionexpired"--><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 Name="Errors" -->
+<div class="dialog alert">
+<ul>
+<!--TMPL_IF name="barcode_not_unique"--><li>Error : Barcode Not Unique For <!--TMPL_LOOP Name="errseq"-->serialseq <!--TMPL_VAR Name="serialseq"--><br/><!--/TMPL_LOOP --></li><!--/TMPL_IF-->
+</ul>
+</div>
<!--/TMPL_IF -->
<input type="hidden" name="op" value="serialchangestatus" />
<tr>
<th>Numbered</th>
<th>Published on</th>
- <th>planned for</th>
+ <th>Expected on</th>
<th>Status</th>
<th>Notes</th>
</tr>
<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"-->')}" >
+ <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">Waited</option>
+ <option value="1" selected="selected">Expected</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status2" -->
<option value="2" selected="selected">Arrived</option>
<!--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: se-resize;" onclick="unHideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
- Items </a>
+ <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: se-resize;" onclick="HideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
- Items</a>
+ <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" -->
- <p>
- <div id="subfield<!-- TMPL_VAR NAME="serialid" --><!-- TMPL_VAR NAME="countitems" --><!-- TMPL_VAR NAME="countsubfield" -->" class="subfield"> <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>
+ <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>
- </p>
- <!-- /tmpl_loop -->
+ <!-- /tmpl_loop --><!-- /iteminformation -->
<input type="hidden" name="moditem" value="" />
<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->" />
<input type="hidden" name="itemid" value="<!-- TMPL_VAR NAME="itemid" -->" />
<input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
</div>
- <!--/TMPL_LOOP-->
+ <!--/TMPL_LOOP--> <!-- /items -->
</div>
</fieldset>
</td>
<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" -->" />
- <b>Subs. <!-- TMPL_VAR name="subscriptionid" --></b> New 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"-->')}" />
+ 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>
<select name="status" size="1" id="addstatus<!-- TMPL_VAR NAME="num" -->">
+ <option value="">----</option>
<!--TMPL_IF name="status1" -->
- <option value="1" selected="selected">Waited</option>
+ <option value="1" selected="selected">Expected</option>
<!-- /TMPL_IF -->
<!--TMPL_IF name="status2" -->
<option value="2" selected="selected">Arrived</option>
<!--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: se-resize;" onclick="unHideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')">
- Item</a>
+ <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: se-resize;" onclick="HideItems('items<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->','label<!-- 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" -->
- <p>
- <div id="subfield<!-- TMPL_VAR NAME="serialid" --><!-- TMPL_VAR NAME="countitems" --><!-- TMPL_VAR NAME="countsubfield" -->" class="subfield"> <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>
+ <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>
- </p>
<!-- /tmpl_loop -->
<input type="hidden" name="moditem" value="" />
<!-- TMPL_INCLUDE NAME="serials-menu.inc" -->
</div>
</div>
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
\ No newline at end of file
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->