From 32533723398e9a01ff64709a64dc0b38ea1f591f Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Fri, 16 Nov 2007 18:49:27 -0600 Subject: [PATCH] changing the way subjects are build in detail.pl If you have a $9 as authority, then you can directly search on an= For example, if you have : 600$912045$aEurope$xFrance$xMarseille (Europe--France--Marseille as subject of the biblio) The link must be "an=12045" The link is not changed in case there is no $9 (still apply on each term, one by one) Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Biblio.pm | 8 +++++++- .../intranet-tmpl/prog/en/modules/catalogue/detail.tmpl | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 7a59204850..73f44dcbf3 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1821,6 +1821,8 @@ sub GetMarcSubjects { my @subfields = $field->subfields(); my $counter = 0; my @link_loop; + # if there is an authority link, build the link with an= subfield9 + my $subfield9 = $field->subfield('9'); for my $subject_subfield (@subfields ) { # don't load unimarc subfields 3,4,5 next if (($marcflavour eq "UNIMARC") and ($subject_subfield->[0] =~ (3|4|5) ) ); @@ -1829,7 +1831,11 @@ sub GetMarcSubjects { my $linkvalue = $value; $linkvalue =~ s/(\(|\))//g; my $operator = " and " unless $counter==0; - push @link_loop, {link => $linkvalue, operator => $operator }; + if ($subfield9) { + @link_loop = ({'limit' => 'an' ,link => "$subfield9" }); + } else { + push @link_loop, {'limit' => 'su', link => $linkvalue, operator => $operator }; + } my $separator = C4::Context->preference("authoritysep") unless $counter==0; # ignore $9 push @subfields_loop, {code => $code, value => $value, link_loop => \@link_loop, separator => $separator} unless ($subject_subfield->[0] == 9 ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl index c6eea2bf5d..7aafc0b0ee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -91,7 +91,7 @@
  • Subjects:
      -
    • +
  • -- 2.39.5