Bugzilla – Attachment 12827 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 2) (rebased master)
0003-Bug-7455-Authority-subfields-are-cloned-in-the-wrong.patch (text/plain), 8.02 KB, created by
Fridolin Somers
on 2012-10-15 17:12:39 UTC
(
hide
)
Description:
Proposed patch (follow-up 2) (rebased master)
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2012-10-15 17:12:39 UTC
Size:
8.02 KB
patch
obsolete
>From e38b8d9d3b48034f6f2f0718fc2d6b741c0db373 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Tue, 18 Sep 2012 17:34:51 +0200 >Subject: [PATCH 3/4] Bug 7455: Authority subfields are cloned in the wrong > field (follow-up 2) > >--- > authorities/authorities.pl | 2 +- > cataloguing/addbiblio.pl | 25 ++++--------- > koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js | 9 ++--- > .../prog/en/modules/authorities/authorities.tt | 38 -------------------- > 4 files changed, 12 insertions(+), 62 deletions(-) > >diff --git a/authorities/authorities.pl b/authorities/authorities.pl >index 45259cd..37e0c15 100755 >--- a/authorities/authorities.pl >+++ b/authorities/authorities.pl >@@ -199,7 +199,7 @@ sub create_input { > class=\"input_marceditor\" > tabindex=\"1\" \/> > <a href=\"#\" class=\"buttonDot\" >- onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a> >+ onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."','auth'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a> > "; > # it's a plugin field > } >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 3db1a65..2d591c6 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -372,7 +372,8 @@ sub create_input { > # it's a thesaurus / authority field > } > elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) { >- if (C4::Context->preference("BiblioAddsAuthorities")) { >+ # when authorities auto-creation is allowed, do not set readonly >+ my $is_readonly = !C4::Context->preference("BiblioAddsAuthorities"); > $subfield_data{marc_value} = > "<input type=\"text\" > id=\"".$subfield_data{id}."\" >@@ -381,26 +382,12 @@ sub create_input { > class=\"input_marceditor readonly\" > tabindex=\"1\" > size=\"67\" >- maxlength=\"".$subfield_data{maxlength}."\" >- \/> >+ maxlength=\"".$subfield_data{maxlength}."\"". >+ ($is_readonly ? "readonly=\"readonly\"" : ""). >+ "\/> > <span class=\"subfield_controls\"><a href=\"#\" class=\"buttonDot\" >- onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span> >- "; >- } else { >- $subfield_data{marc_value} = >- "<input type=\"text\" >- id=\"".$subfield_data{id}."\" >- name=\"".$subfield_data{id}."\" >- value=\"$value\" >- class=\"input_marceditor readonly\" >- tabindex=\"1\" >- size=\"67\" >- maxlength=\"".$subfield_data{maxlength}."\" >- readonly=\"readonly\" >- \/><span class=\"subfield_controls\"><a href=\"#\" class=\"buttonDot\" >- onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span> >+ onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."','biblio'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span> > "; >- } > # it's a plugin field > } > elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js >index 96cdea0..09df5cd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js >@@ -33,7 +33,8 @@ function getTagInputnameFilter(tagsubfieldid){ > return tagsubfield; > } > >-function openAuth(tagsubfieldid,authtype) { >+// if source is "auth", we are editing an authority otherwise it is a biblio >+function openAuth(tagsubfieldid,authtype,source) { > // let's take the base of tagsubfield information (removing the indexes and the codes > var element=document.getElementById(tagsubfieldid); > var tagsubfield=getTagInputnameFilter(tagsubfieldid); >@@ -47,10 +48,10 @@ function openAuth(tagsubfieldid,authtype) { > var subfieldcode=getSubfieldCode(inputs[myindex].name); > if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){ > mainstring=inputs[myindex].value+" "+mainstring; >- } >+ } > } >- } >- newin=window.open("../authorities/auth_finder.pl?authtypecode="+ authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes'); >+ } >+ newin=window.open("../authorities/auth_finder.pl?source="+source+"&authtypecode="+authtype+"&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes'); > } > > function ExpandField(index) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >index 87919d7..e5714bb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >@@ -102,44 +102,6 @@ function Check(){ > } > } > >- >-// returns the subfieldcode based upon subfieldid writing >-function getSubfieldcode(tagsubfieldid){ >- // 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0 >- return tagsubfieldid.substr(3+3+4+8-1,1); >-} >- >-// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes) >-// returns the filter >-function getTagInputnameFilter(tagsubfieldid){ >- var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_")); >- var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_")); >- tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_")); >- tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_")); >- tagsubfield=tagsubfield+"_."+tagcode; >- return tagsubfield; >-} >- >-function openAuth(tagsubfieldid,authtype) { >- // let's take the base of tagsubfield information (removing the indexes and the codes >- var element=document.getElementById(tagsubfieldid); >- var tagsubfield=getTagInputnameFilter(tagsubfieldid); >- var elementsubfcode=getSubfieldcode(element.name); >- var mainmainstring=element.value; >- var mainstring=""; >- var inputs = element.parentNode.parentNode.getElementsByTagName("input"); >- >- for (var myindex =0; myindex<inputs.length;myindex++){ >- if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){ >- var subfieldcode=getSubfieldcode(inputs[myindex].name); >- if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){ >- mainstring=inputs[myindex].value+" "+mainstring; >- } >- } >- } >- newin=window.open("../authorities/auth_finder.pl?source=auth&authtypecode="+ authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes'); >-} >- > function AddField(field,cntrepeatfield) { > document.forms['f'].op.value = "addfield"; > document.forms['f'].addfield_field.value=field; >-- >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