From: Lebbeous Fogle-Weekley Date: Fri, 21 Jun 2013 22:03:00 +0000 (-0400) Subject: OPAC Browse: Don't try to build hyperlinks from 680 ‡a X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=91621e645d782cf34387f722805de8f0912b1cba;p=working%2FEvergreen.git OPAC Browse: Don't try to build hyperlinks from 680 ‡a Public general notes can be formatted in too many way to try to cleverly build browse links out of the contents. Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Browse.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Browse.pm index 5431774cd5..c31e42421d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Browse.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Browse.pm @@ -76,43 +76,24 @@ sub prepare_browse_parameters { ); } -# Break out any Public General Notes (field 680) for display and -# hyperlinking. These are sometimes (erroneously?) called "scope notes." -# I say erroneously, tentatively, because LoC doesn't seem to document -# a "scope notes" field for authority records, while it does so for -# classification records, which are something else. But I am not a -# librarian. +# Break out any Public General Notes (field 680) for display. These are +# sometimes (erroneously?) called "scope notes." I say erroneously, +# tentatively, because LoC doesn't seem to document a "scope notes" +# field for authority records, while it does so for classification +# records, which are something else. But I am not a librarian. sub extract_public_general_notes { my ($self, $record, $row) = @_; - my @notes; - foreach my $note ($record->field('680')) { - my @note; - my $last_heading; - - foreach my $subfield ($note->subfields) { - my ($code, $value) = @$subfield; - - if ($code eq 'i') { - push @note, $value; - } elsif ($code eq '5') { - if ($last_heading) { - my $org = $self->ctx->{get_aou_by_shortname}->($value); - $last_heading->{org_id} = $org->id if $org; - } - push @note, { institution => $value }; - } elsif ($code eq 'a') { - $last_heading = { - heading => $value, bterm => search_normalize($value) - }; - push @note, $last_heading; - } - } - - push @notes, \@note if @note; - } - - $row->{notes} = \@notes; + # Make a list of strings, each string being a concatentation of any + # subfields 'i', '5', or 'a' from one field 680, in order of appearance. + $row->{notes} = [ + map { + join( + " ", + map { $_->[1] } grep { $_->[0] =~ /[i5a]/ } $_->subfields + ) + } $record->field('680') + ]; } sub find_authority_headings_and_notes { diff --git a/Open-ILS/src/templates/opac/browse.tt2 b/Open-ILS/src/templates/opac/browse.tt2 index df0e7fc02e..ac12438f2a 100644 --- a/Open-ILS/src/templates/opac/browse.tt2 +++ b/Open-ILS/src/templates/opac/browse.tt2 @@ -161,22 +161,7 @@ [% l("Note:") %] - [% FOR piece IN note; - IF piece.heading; - mkurl_args = {bterm => piece.bterm}; - IF piece.org_id; - mkurl_args.locg = piece.org_id; - END; - %] - [% piece.heading | html %] - [% ELSIF piece.institution %] - - [% piece.institution | html %] - - [% ELSE %] - [% piece | html %] - [% END; - END %] + [% FOR piece IN note; piece | html; END %] [% END;