From 7ac682c85918eb94d6f74c4bd02c92d493d69536 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 20 Jun 2008 09:35:42 -0500 Subject: [PATCH] bug 2265: fix problem when cloning MARC field Correctly set indicators when cloning a field in the MARC editor. Prior this fix, a cloned field would not be saved. Bug introduced in patch for bug 2207. Signed-off-by: Joshua Ferraro --- .../prog/en/modules/authorities/authorities.tmpl | 7 +++++-- .../prog/en/modules/cataloguing/addbiblio.tmpl | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl index 2c401fb05f..d6b13a9531 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl @@ -100,8 +100,10 @@ function CloneField(index) { // No indicator if hide_marc // setting a new name for the new indicator - var indicator = clone.getElementsByTagName('input')[0]; - indicator.setAttribute('name',indicator.getAttribute('name')+new_key); + for(var i=0; i < 2; i++) { + var indicator = clone.getElementsByTagName('input')[i]; + indicator.setAttribute('name',indicator.getAttribute('name')+new_key); + } // settings all subfields @@ -216,6 +218,7 @@ function CloneField(index) { if(divs[i].getAttribute('name') == 'div_indicator'){ var inputs = divs[i].getElementsByTagName('input'); inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key); + inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key); var CloneButtonPlus; try { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl index ddb098fe03..b5647d8254 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl @@ -159,8 +159,10 @@ function CloneField(index) { // No indicator if hide_marc // setting a new name for the new indicator - var indicator = clone.getElementsByTagName('input')[0]; - indicator.setAttribute('name',indicator.getAttribute('name')+new_key); + for(var i=0; i < 2; i++) { + var indicator = clone.getElementsByTagName('input')[i]; + indicator.setAttribute('name',indicator.getAttribute('name')+new_key); + } // settings all subfields @@ -274,6 +276,7 @@ function CloneField(index) { if(divs[i].getAttribute('id').match(/^div_indicator/)){ var inputs = divs[i].getElementsByTagName('input'); inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key); + inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key); var CloneButtonPlus; try { -- 2.20.1