Bugzilla – Attachment 11338 Details for
Bug 7455
Authority subfields are cloned in the wrong field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch (follow-up)
0002-Bug-7455-Authority-subfields-are-cloned-in-the-wrong.patch (text/plain), 5.43 KB, created by
Fridolin Somers
on 2012-08-03 15:37:14 UTC
(
hide
)
Description:
Proposed patch (follow-up)
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2012-08-03 15:37:14 UTC
Size:
5.43 KB
patch
obsolete
>From da48028426b0b6513d1fb59fcffb842d3529fbfa Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Fri, 3 Aug 2012 16:24:46 +0200 >Subject: [PATCH 2/2] Bug 7455: Authority subfields are cloned in the wrong > field (follow-up 1) > >--- > authorities/authorities.pl | 21 ++++++++++++--------- > cataloguing/addbiblio.pl | 5 +++-- > koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js | 4 ++++ > 3 files changed, 19 insertions(+), 11 deletions(-) > >diff --git a/authorities/authorities.pl b/authorities/authorities.pl >index 23653f6..de79238 100755 >--- a/authorities/authorities.pl >+++ b/authorities/authorities.pl >@@ -152,9 +152,15 @@ sub create_input { > $value =~ s/DD/$day/g; > } > my $dbh = C4::Context->dbh; >+ >+ # map '@' as "subfield" label for fixed fields >+ # to something that's allowed in a div id. >+ my $id_subfield = $subfield; >+ $id_subfield = "00" if $id_subfield eq "@"; >+ > my %subfield_data = ( > tag => $tag, >- subfield => $subfield, >+ subfield => $id_subfield, > marc_lib => substr( $tagslib->{$tag}->{$subfield}->{lib}, 0, 22 ), > marc_lib_plain => $tagslib->{$tag}->{$subfield}->{lib}, > tag_mandatory => $tagslib->{$tag}->{mandatory}, >@@ -162,14 +168,11 @@ sub create_input { > repeatable => $tagslib->{$tag}->{$subfield}->{repeatable}, > kohafield => $tagslib->{$tag}->{$subfield}->{kohafield}, > index => $index_tag, >- id => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield, >+ id => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield, > value => $value, >+ random => CreateKey(), >+ fixedfield => $tag < 10 ? 1 : 0, > ); >- if($subfield eq '@'){ >- $subfield_data{id} = "tag_".$tag."_subfield_00_".$index_tag."_".$index_subfield; >- } else { >- $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield; >- } > > if(exists $mandatory_z3950->{$tag.$subfield}){ > $subfield_data{z3950_mandatory} = $mandatory_z3950->{$tag.$subfield}; >@@ -441,7 +444,7 @@ sub build_tabs { > repeatable => $tagslib->{$tag}->{repeatable}, > mandatory => $tagslib->{$tag}->{mandatory}, > subfield_loop => \@subfields_data, >- fixedfield => ($tag < 10)?(1):(0), >+ fixedfield => $tag < 10 ? 1 : 0, > random => CreateKey, > ); > if ($tag >= 10){ # no indicator for theses tag >@@ -481,7 +484,7 @@ sub build_tabs { > indicator2 => $indicator2, > subfield_loop => \@subfields_data, > tagfirstsubfield => $subfields_data[0], >- fixedfield => ($tag < 10)?(1):(0) >+ fixedfield => $tag < 10 ? 1 : 0, > ); > > push @loop_data, \%tag_data ; >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 3db1a65..a509f31 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -327,6 +327,7 @@ sub create_input { > value => $value, > maxlength => $tagslib->{$tag}->{$subfield}->{maxlength}, > random => CreateKey(), >+ fixedfield => $tag < 10 ? 1 : 0, > ); > > if(exists $mandatory_z3950->{$tag.$subfield}){ >@@ -648,7 +649,7 @@ sub build_tabs { > repeatable => $tagslib->{$tag}->{repeatable}, > mandatory => $tagslib->{$tag}->{mandatory}, > subfield_loop => \@subfields_data, >- fixedfield => $tag < 10?1:0, >+ fixedfield => $tag < 10 ? 1 : 0, > random => CreateKey, > ); > if ($tag >= 10){ # no indicator for 00x tags >@@ -697,7 +698,7 @@ sub build_tabs { > indicator2 => $indicator2, > subfield_loop => \@subfields_data, > tagfirstsubfield => $subfields_data[0], >- fixedfield => $tag < 10?1:0, >+ fixedfield => $tag < 10 ? 1 : 0, > ); > > push @loop_data, \%tag_data ; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js >index 29ab1eb..96cdea0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js >@@ -211,6 +211,10 @@ function CloneField(index, hideMarc, advancedMARCEditor) { > > } else { // it's a indicator div > if(divs[i].getAttribute('id').match(/^div_indicator/)){ >+ >+ // setting a new id for the indicator div >+ divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key); >+ > 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); >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7455
:
7257
|
7258
|
7259
|
10884
|
11032
|
11338
|
11850
|
11866
|
11908
|
11909
|
12216
|
12313
|
12314
|
12315
|
12546
|
12827
|
12828
|
12982
|
12983
|
12984
|
12985