diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js index a1e3092579..a9eeda9e59 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js @@ -16,7 +16,31 @@ function check_additem() { } $(document).ready(function(){ $(".cloneItemBlock").click(function(){ - $(this).parent().parent().clone(true).insertAfter($(this).parent().parent()).find("a.deleteItemBlock").show(); + var clonedRow = $(this).parent().parent().clone(true); + clonedRow.insertAfter($(this).parent().parent()).find("a.deleteItemBlock").show(); + // find ID of cloned row so we can increment it for the clone + var count = $("input[id^=volinf]",clonedRow).attr("id"); + var current = Number(count.replace("volinf","")); + var increment = current + 1; + // loop over inputs + var inputs = ["volinf","barcode"]; + jQuery.each(inputs,function() { + // increment IDs of labels and inputs in the clone + $("label[for="+this+current+"]",clonedRow).attr("for",this+increment); + $("input[name="+this+"]",clonedRow).attr("id",this+increment); + }); + // loop over selects + var selects = ["homebranch","location","itemtype","ccode"]; + jQuery.each(selects,function() { + // increment IDs of labels and selects in the clone + $("label[for="+this+current+"]",clonedRow).attr("for",this+increment); + $("input[name="+this+"]",clonedRow).attr("id",this+increment); + $("select[name="+this+"]",clonedRow).attr("id",this+increment); + // find the selected option and select it in the clone + var selectedVal = $("select#"+this+current).find("option:selected").attr("value"); + $("select[name="+this+"] option[value="+selectedVal+"]",clonedRow).attr("selected","selected"); + }); + var quantityrec = parseFloat($("#quantityrec").attr("value")); quantityrec++; $("#quantityrec").attr("value",quantityrec); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tmpl index 021b2d3d55..74a16d5fd8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tmpl @@ -46,12 +46,12 @@ fieldset.rows .itemblock fieldset.action { padding:.5em; }
    -
  1. -
  2. -
  3. - " />
  4. -
  5. -
  6. +
  7. + " />
  8. +
  9. +
  10. -
  11. - @@ -69,8 +69,8 @@ fieldset.rows .itemblock fieldset.action { padding:.5em; }
  12. -
  13. - @@ -79,8 +79,8 @@ fieldset.rows .itemblock fieldset.action { padding:.5em; }
  14. -
  15. -