From ad19720e33ae0e43ed006acfd37fc72a3881bdbc Mon Sep 17 00:00:00 2001 From: kados Date: Wed, 2 Aug 2006 23:43:51 +0000 Subject: [PATCH] partial fix to MARC21 authorities headings display --- C4/AuthoritiesMarc.pm | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index b7df207dc6..4c10b166bc 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -180,10 +180,10 @@ sub authoritysearch { my $authref = getauthtype($authtypecode); my $authtype =$authref->{authtypetext}; my $summary = $authref->{summary}; - my $query_auth_tag = "SELECT auth_tag_to_report FROM auth_types WHERE authtypecode=?"; - my $sth = $dbh->prepare($query_auth_tag); - $sth->execute($authtypecode); - my $auth_tag_to_report = $sth->fetchrow; + my $query_auth_tag = "SELECT auth_tag_to_report FROM auth_types WHERE authtypecode=?"; + my $sth = $dbh->prepare($query_auth_tag); + $sth->execute($authtypecode); + my $auth_tag_to_report = $sth->fetchrow; # find biblio MARC field using this authtypecode (to jump to biblio) my $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?"); $sth->execute($authtypecode); @@ -197,16 +197,15 @@ sub authoritysearch { # if the library has a summary defined, use it. Otherwise, build a standard one if ($summary) { my @fields = $record->fields(); - $reported_tag = '$9'.$result[$counter]; + $reported_tag = '$9'.$result[$counter]; foreach my $field (@fields) { my $tag = $field->tag(); my $tagvalue = $field->as_string(); $summary =~ s/\[(.?.?.?.?)$tag\*(.*?)]/$1$tagvalue$2\[$1$tag$2]/g; if ($tag<10) { - if ($tag eq '001') { - $reported_tag.='$3'.$field->data(); - } - + if ($tag eq '001') { + $reported_tag.='$3'.$field->data(); + } } else { my @subf = $field->subfields; for my $i (0..$#subf) { @@ -214,9 +213,9 @@ sub authoritysearch { my $subfieldvalue = $subf[$i][1]; my $tagsubf = $tag.$subfieldcode; $summary =~ s/\[(.?.?.?.?)$tagsubf(.*?)]/$1$subfieldvalue$2\[$1$tagsubf$2]/g; - if ($tag eq $auth_tag_to_report) { - $reported_tag.='$'.$subfieldcode.$subfieldvalue; - } + if ($tag eq $auth_tag_to_report) { + $reported_tag.='$'.$subfieldcode.$subfieldvalue; + } } } @@ -224,7 +223,7 @@ sub authoritysearch { $summary =~ s/\[(.*?)]//g; $summary =~ s/\n/
/g; } else { - my $heading; # = $authref->{summary}; + my $heading; my $altheading; my $seeheading; my $see; @@ -266,7 +265,7 @@ sub authoritysearch { } elsif ($record->field('148')) { $heading.= $field->as_string('abvxyz68'); } elsif ($record->field('150')) { - $heading.= $field->as_string('abvxyz68'); + $heading.= $field->as_string('abvxyz68'); } elsif ($record->field('151')) { $heading.= $field->as_string('avxyz68'); } elsif ($record->field('155')) { @@ -285,14 +284,15 @@ sub authoritysearch { } #See From foreach my $field ($record->field('4..')) { $seeheading.= "   ".$field->as_string()."
"; - $seeheading.= "      see: ".$seeheading."
"; + $seeheading.= "      see: ".$heading."
"; } #See Also foreach my $field ($record->field('5..')) { $altheading.= "      see also: ".$field->as_string()."
"; $altheading.= "   ".$field->as_string()."
"; - $altheading.= "      see also: ".$altheading."
"; + $altheading.= "      see also: ".$heading."
"; } - $summary.=$heading.$seeheading.$altheading; + #$summary.=$heading.$seeheading.$altheading; + $summary = "".$heading."
".$seeheading.$altheading.$summary; } } # then add a line for the template loop @@ -1314,6 +1314,9 @@ Paul POULAIN paul.poulain@free.fr # $Id$ # $Log$ +# Revision 1.9.2.22 2006/08/02 23:43:51 kados +# partial fix to MARC21 authorities headings display +# # Revision 1.9.2.21 2006/08/02 10:17:09 tipaul # some improvements in buildHerarchies (unimarc hierarchies) # -- 2.39.5