Bugzilla – Attachment 132841 Details for
Bug 2222
Field auth_subfield_structure.frameworkcode should NOT be removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2222: Modify C4::AuthoritiesMarc::GetTagsLabels and callers
Bug-2222-Modify-C4AuthoritiesMarcGetTagsLabels-and.patch (text/plain), 10.97 KB, created by
Marcel de Rooy
on 2022-04-01 10:03:06 UTC
(
hide
)
Description:
Bug 2222: Modify C4::AuthoritiesMarc::GetTagsLabels and callers
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-04-01 10:03:06 UTC
Size:
10.97 KB
patch
obsolete
>From ef1576b41242dd04185de53bda1e61a93a529431 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 31 Mar 2022 14:23:23 +0000 >Subject: [PATCH] Bug 2222: Modify C4::AuthoritiesMarc::GetTagsLabels and > callers >Content-Type: text/plain; charset=utf-8 > >We adjust two callers here to rename the parameter from framework >to authtypecode in order to prevent confusion. >--- > C4/AuthoritiesMarc.pm | 4 +-- > authorities/merge.pl | 28 +++++++++---------- > .../prog/en/modules/authorities/merge.tt | 26 ++++++++--------- > 3 files changed, 28 insertions(+), 30 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 36cbf5c43b..43bac0f482 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -478,7 +478,7 @@ sub GetTagsLabels { > $res->{$tag}->{repeatable} = $repeatable; > } > $sth= $dbh->prepare( >-"SELECT tagfield,tagsubfield,liblibrarian,libopac,tab, mandatory, repeatable,authorised_value,frameworkcode as authtypecode,value_builder,kohafield,seealso,hidden,isurl,defaultvalue, display_order >+"SELECT tagfield,tagsubfield,liblibrarian,libopac,tab, mandatory, repeatable,authorised_value,value_builder,kohafield,seealso,hidden,isurl,defaultvalue, display_order > FROM auth_subfield_structure > WHERE authtypecode=? > ORDER BY tagfield, display_order, tagsubfield" >@@ -497,7 +497,7 @@ ORDER BY tagfield, display_order, tagsubfield" > > while ( > ( $tag, $subfield, $liblibrarian, , $libopac, $tab, >- $mandatory, $repeatable, $authorised_value, $authtypecode, >+ $mandatory, $repeatable, $authorised_value, > $value_builder, $kohafield, $seealso, $hidden, > $isurl, $defaultvalue, $display_order ) > = $sth->fetchrow >diff --git a/authorities/merge.pl b/authorities/merge.pl >index 0799c26b04..391fd5d1ba 100755 >--- a/authorities/merge.pl >+++ b/authorities/merge.pl >@@ -31,6 +31,7 @@ use Koha::MetadataRecord::Authority; > my $input = CGI->new; > my @authid = $input->multi_param('authid'); > my $merge = $input->param('merge'); >+my $authtypecode = $input->param('authtypecode'); > > my @errors; > >@@ -52,12 +53,11 @@ if ($merge) { > my $record = TransformHtmlToMarc($input, 0); > my $recordid1 = $input->param('recordid1') // q{}; > my $recordid2 = $input->param('recordid2') // q{}; >- my $typecode = $input->param('frameworkcode'); > > # Some error checking > if( $recordid1 eq $recordid2 ) { > push @errors, { code => 'DESTRUCTIVE_MERGE' }; >- } elsif( !$typecode || !Koha::Authority::Types->find($typecode) ) { >+ } elsif( !$authtypecode || !Koha::Authority::Types->find($authtypecode) ) { > push @errors, { code => 'WRONG_FRAMEWORK' }; > } elsif( scalar $record->fields == 0 ) { > push @errors, { code => 'EMPTY_MARC' }; >@@ -75,7 +75,7 @@ if ($merge) { > > # Modifying the reference record > # This triggers a merge for the biblios attached to $recordid1 >- ModAuthority( $recordid1, $record, $typecode ); >+ ModAuthority( $recordid1, $record, $authtypecode ); > > # Now merge for biblios attached to $recordid2 > my $MARCfrom = GetAuthority( $recordid2 ); >@@ -129,19 +129,17 @@ else { > > if ($mergereference ) { > >- my $framework; > if ( $recordObj1->authtypecode ne $recordObj2->authtypecode && $mergereference ne 'breeding' ) { >- $framework = $input->param('frameworkcode'); > } >- else { >- $framework = $recordObj1->authtypecode; >+ else { # overwrite authtypecode parameter >+ $authtypecode = $recordObj1->authtypecode; > } > if ($mergereference eq 'breeding') { > $mergereference = $authid[0]; > } > > # Getting MARC Structure >- my $tagslib = GetTagsLabels( 1, $framework ); >+ my $tagslib = GetTagsLabels( 1, $authtypecode ); > foreach my $field ( keys %$tagslib ) { > if ( defined $tagslib->{$field}->{'tab'} && $tagslib->{$field}->{'tab'} eq ' ' ) { > $tagslib->{$field}->{'tab'} = 0; >@@ -162,14 +160,14 @@ else { > { > recordid => $mergereference, > record => $recordObj1->record, >- frameworkcode => $recordObj1->authtypecode, >+ authtypecode => $recordObj1->authtypecode, > display => $recordObj1->createMergeHash($tagslib), > reference => 1, > }, > { > recordid => $notreference, > record => $recordObj2->record, >- frameworkcode => $recordObj2->authtypecode, >+ authtypecode => $recordObj2->authtypecode, > display => $recordObj2->createMergeHash($tagslib), > }, > ); >@@ -178,8 +176,8 @@ else { > $template->param( > recordid1 => $mergereference, > recordid2 => $notreference, >- records => \@records, >- framework => $framework, >+ records => \@records, >+ authtypecode => $authtypecode, > ); > } > else { >@@ -195,9 +193,9 @@ else { > if ( $recordObj1->authtypecode ne $recordObj2->authtypecode ) { > my $authority_types = Koha::Authority::Types->search( { authtypecode => { '!=' => '' } }, { order_by => ['authtypetext'] } ); > $template->param( >- frameworkselect => $authority_types->unblessed, >- frameworkcode1 => $recordObj1->authtypecode, >- frameworkcode2 => $recordObj2->authtypecode, >+ authority_types => $authority_types->unblessed, >+ authtypecode1 => $recordObj1->authtypecode, >+ authtypecode2 => $recordObj2->authtypecode, > ); > } > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt >index d472c924f8..76dfcf761d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt >@@ -70,19 +70,19 @@ div#result { margin-top: 1em; } > <fieldset class="rows"> > <legend>Merge reference</legend> > <ol> >- <li class="radio"><input type="radio" value="[% recordid1 | uri %]" checked="checked" id="mergereference1" name="mergereference" onclick="changeFramework('[% frameworkcode1 | html %]')" /><label for="mergereference1">[% title1 | html %] [% FOREACH subtitl1 IN subtitle1 %] [% subtitl1 | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid1 | html %][% IF frameworklabel1 %] — [% frameworklabel1 | html %][% END %]</a>)</label></li> >- <li class="radio"><input type="radio" value="[% recordid2 | uri %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 | html %]')" /><label for="mergereference2">[% title2 | html %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2 | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid2 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid2 | html %][% IF frameworklabel2 %] — [% frameworklabel2 | html %][% END %]</a>)</label></li> >- >- [% IF frameworkselect %] >- <li><label for="frameworkcode">Using framework:</label> >- <select name="frameworkcode" id="frameworkcode"> >- [% FOREACH frameworkcodeloo IN frameworkselect %] >- [% IF frameworkcodeloo.authtypecode == frameworkcode1 %] >- <option value="[% frameworkcodeloo.authtypecode | html %]" selected="selected"> >+ <li class="radio"><input type="radio" value="[% recordid1 | uri %]" checked="checked" id="mergereference1" name="mergereference" onclick="changeFramework('[% authtypecode1 | html %]')" /><label for="mergereference1">[% title1 | html %] [% FOREACH subtitl1 IN subtitle1 %] [% subtitl1 | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid1 | html %]</a>)</label></li> >+ <li class="radio"><input type="radio" value="[% recordid2 | uri %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% authtypecode2 | html %]')" /><label for="mergereference2">[% title2 | html %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2 | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid2 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid2 | html %]</a>)</label></li> >+ >+ [% IF authority_types %] >+ <li><label for="authtypecode">Using framework:</label> >+ <select name="authtypecode" id="authtypecode"> >+ [% FOREACH authtypecodeloo IN authority_types %] >+ [% IF authtypecodeloo.authtypecode == authtypecode1 %] >+ <option value="[% authtypecodeloo.authtypecode | html %]" selected="selected"> > [% ELSE %] >- <option value="[% frameworkcodeloo.authtypecode | html %]"> >+ <option value="[% authtypecodeloo.authtypecode | html %]"> > [% END %] >- [% frameworkcodeloo.authtypetext | html %] >+ [% authtypecodeloo.authtypetext | html %] > </option> > [% END %] > </select></li> >@@ -111,7 +111,7 @@ div#result { margin-top: 1em; } > <input type="hidden" name="recordid1" value="[% recordid1 | html %]" /> > <input type="hidden" name="recordid2" value="[% recordid2 | html %]" /> > <input type="hidden" name="mergereference" value="[% mergereference | html %]" /> >-<input type="hidden" name="frameworkcode" value="[% framework | html %]" /> >+<input type="hidden" name="authtypecode" value="[% authtypecode | html %]" /> > > <fieldset class="action"><input type="submit" name="merge" value="Merge" /></fieldset> > </form> >@@ -135,7 +135,7 @@ div#result { margin-top: 1em; } > $(document).ready(function(){ > // Getting marc structure via ajax > tagslib = []; >- $.getJSON("/cgi-bin/koha/authorities/merge_ajax.pl", {frameworkcode : "[% framework | html %]" }, function(json) { >+ $.getJSON("/cgi-bin/koha/authorities/merge_ajax.pl", {authtypecode : "[% authtypecode | html %]" }, function(json) { > tagslib = json; > rebuild_target($("#tabs"), $("#resultul")); > }); >-- >2.20.1
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 2222
:
132832
|
132833
|
132834
|
132835
|
132836
|
132837
|
132838
|
132839
|
132840
|
132841