diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl
index f3ecd2d0e2..5b86029833 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl
@@ -73,6 +73,70 @@ function HideItems(index,labelindex) {
label = document.getElementById(labelindex);
label.style.display='block';
}
+function CloneSubfield(index){
+ var original = document.getElementById(index); //original
+ 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
+ // when cloning a subfield, reset its label too.
+ var label = clone.getElementsByTagName('label')[0];
+ label.setAttribute('for',id_input);
+
+
+ // 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);
+}
" class="items">
-
-
" class="subfield">
+
">
+
+
" />
" />
" />
" />
" />
+
+ ')">+
+
+
-
@@ -298,16 +366,19 @@ Error : Barcode Not Unique For serialseq
" class="items">
-
-
" class="subfield">
+
">
+
+
" />
" />
" />
" />
" />
+
+ ')">+
+
-