);
}
-# 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 {
[% l("Note:") %]
</span>
<span class="browse-public-general-note-body">
- [% FOR piece IN note;
- IF piece.heading;
- mkurl_args = {bterm => piece.bterm};
- IF piece.org_id;
- mkurl_args.locg = piece.org_id;
- END;
- %]
- <a href="[% mkurl('', mkurl_args, ['bpivot']) %]">[% piece.heading | html %]</a>
- [% ELSIF piece.institution %]
- <span class="browse-public-general-note-institution">
- [% piece.institution | html %]
- </span>
- [% ELSE %]
- [% piece | html %]
- [% END;
- END %]
+ [% FOR piece IN note; piece | html; END %]
</span>
</div>
[% END;