From 04f8382d5b4ac1262ac78262a1c7c018d6d87a25 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Mon, 23 Feb 2009 12:12:49 +0100 Subject: [PATCH] (bug #2978) fix differents bugs in marc editor This patch fix two bugs: * tag duplication If you try to duplicate an autority tag, the javascript call is kept, and the id is not modified, and fields are not emptied. * openAuth() call The id called on duplicated fields is not the great id. And the different values sent to auth_finder.pl to pre-fetch datas from firstname, etc... send values from all same tags, and not from the selected tag. (cherry picked from commit 40115eb110c94935e1b3fe6ba3a3c9ea35a473a4) Signed-off-by: Galen Charlton --- cataloguing/addbiblio.pl | 2 +- .../prog/en/modules/cataloguing/addbiblio.tmpl | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 32ca3577bd..c687e22f59 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -396,7 +396,7 @@ sub create_input { maxlength=\"$max_length\" readonly=\"readonly\" \/>{$tag}->{$subfield}->{authtypecode}."'); return false;\" title=\"Tag Editor\">... + onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" title=\"Tag Editor\">... "; } # it's a plugin field 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 c875f158dd..a0851c87d6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl @@ -162,10 +162,11 @@ function openAuth(tagsubfieldid,authtype) { var elementsubfcode=getSubfieldcode(element.name); var mainmainstring=element.value; var mainstring=""; - var inputs = document.getElementsByTagName("input"); + var inputs = element.parentNode.parentNode.getElementsByTagName("input"); + for (var myindex =0; myindex