X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FAuthoritiesMarc.pm;h=85982ecb8d7929b49931b06f09e6a984bdf281d8;hb=80b7a8153dca1bc8f97976e3686c6527766deef3;hp=eb1308712e18c0487609333f30403fcbfad284aa;hpb=99dbc5cdf7d7e4d9e83378fbf4d0fb5d5c2de38e;p=koha_fer diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index eb1308712e..85982ecb8d 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -281,8 +281,6 @@ sub SearchAuthorities { my %newline; $newline{authid} = $authid; if ( !$skipmetadata ) { - my $summary = - BuildSummary( $authrecord, $authid, GetAuthTypeCode($authid) ); my $query_auth_tag = "SELECT auth_tag_to_report FROM auth_types WHERE authtypecode=?"; my $sth = $dbh->prepare($query_auth_tag); @@ -291,15 +289,18 @@ sub SearchAuthorities { my $reported_tag; my $mainentry = $authrecord->field($auth_tag_to_report); if ($mainentry) { - foreach ( $mainentry->subfields() ) { $reported_tag .= '$' . $_->[0] . $_->[1]; } } - my $thisauthtype = GetAuthType(GetAuthTypeCode($authid)); + my $thisauthtypecode = GetAuthTypeCode($authid); + my $thisauthtype = GetAuthType($thisauthtypecode); unless (defined $thisauthtype) { - $thisauthtype = GetAuthType($authtypecode) if $authtypecode; + $thisauthtypecode = $authtypecode; + $thisauthtype = GetAuthType($authtypecode); } + my $summary = BuildSummary( $authrecord, $authid, $thisauthtypecode ); + $newline{authtype} = defined($thisauthtype) ? $thisauthtype->{'authtypetext'} : ''; $newline{summary} = $summary; @@ -895,6 +896,11 @@ sub BuildSummary { $summary{authtypecode} = $authref->{authtypecode}; $summary{type} = $authref->{authtypetext}; $summary_template = $authref->{summary}; + # for MARC21, the authority type summary displays a label meant for + # display + if (C4::Context->preference('marcflavour') ne 'UNIMARC') { + $summary{summary} = $authref->{summary}; + } } my $marc21subfields = 'abcdfghjklmnopqrstuvxyz68'; my %marc21controlrefs = ( 'a' => 'earlier',