@@ -, +, @@ hyperlinks see also reference in the staff client and the OPAC. are now hyperlinks, which work. - Checked links for existing and non existing "see alsos" give correct search results - Verified links show up for all "see alsos" in a result list - Verified links are properly linked with the correct names - Checked logs don't show errors --- C4/AuthoritiesMarc.pm | 45 +++++++++++++++----- .../en/includes/authorities-search-results.inc | 32 ++++++++------ .../en/modules/authorities/searchresultlist.tt | 2 +- .../en/includes/authorities-search-results.inc | 32 ++++++++------ .../en/modules/opac-authoritiessearchresultlist.tt | 2 +- opac/opac-authorities-home.pl | 4 +- 6 files changed, 75 insertions(+), 42 deletions(-) --- a/C4/AuthoritiesMarc.pm +++ a/C4/AuthoritiesMarc.pm @@ -948,7 +948,7 @@ sub BuildSummary { $summary{type} = $authref->{authtypetext}; $summary{summary} = $authref->{summary}; } - my $marc21subfields = 'abcdfghjklmnopqrstuvxyz'; + my $marc21subfields = 'abcdfghjklmnopqrstuvxyz68'; my %marc21controlrefs = ( 'a' => 'earlier', 'b' => 'later', 'd' => 'acronym', @@ -1027,11 +1027,26 @@ sub BuildSummary { # see : foreach my $field ($record->field('5..')) { if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) { - push @seealso, { $field->as_string('abcdefgjxyz'), type => 'broader' }; + push @seealso, { + heading => $field->as_string('abcdefgjxyz'), + type => 'broader', + search => $field->as_string('abcdefgjxyz'), + authid => $field->subfield('9') + }; } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){ - push @seealso, { heading => $field->as_string('abcdefgjxyz'), type => 'narrower' }; + push @seealso, { + heading => $field->as_string('abcdefgjxyz'), + type => 'narrower', + search => $field->as_string('abcdefgjxyz'), + authid => $field->subfield('9') + }; } elsif ($field->subfield('a')) { - push @seealso, { heading => $field->as_string('abcdefgxyz'), type => 'seealso' }; + push @seealso, { + heading => $field->as_string('abcdefgxyz'), + type => 'seealso', + search => $field->as_string('abcdefgjxyz'), + authid => $field->subfield('9') + }; } } # // form @@ -1079,20 +1094,30 @@ sub BuildSummary { } #See From foreach my $field ($record->field('4..')) { my $type = 'seefrom'; - $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w')); + $type = ($marc21controlrefs{substr $field->subfield('w'), '0'} || '') if ($field->subfield('w')); if ($type eq 'subfi') { - push @seefrom, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') }; + push @seefrom, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') || '' }; } else { - push @seefrom, { heading => $field->as_string($marc21subfields), type => $type }; + push @seefrom, { heading => $field->as_string($marc21subfields), type => $type || '' }; } } #See Also foreach my $field ($record->field('5..')) { my $type = 'seealso'; - $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w')); + $type = ($marc21controlrefs{substr $field->subfield('w'), '0'} || '') if ($field->subfield('w')); if ($type eq 'subfi') { - push @seealso, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') }; + push @seealso, { + heading => $field->as_string($marc21subfields), + type => $field->subfield('i') || '', + search => $field->as_string($marc21subfields) || '', + authid => $field->subfield('9') || '' + }; } else { - push @seealso, { heading => $field->as_string($marc21subfields), type => $type }; + push @seealso, { + heading => $field->as_string($marc21subfields), + type => $type || '', + search => $field->as_string($marc21subfields) || '', + authid => $field->subfield('9') || '' + }; } } foreach my $field ($record->field('6..')) { --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc @@ -2,19 +2,22 @@ [% IF marcflavour == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] - [% heading %] -- + [% heading | html %] -- [% CASE 'narrower' %] - [% heading %] -- + [% heading | html %] -- [% CASE 'narrower' %] - [% heading %] -- + [% heading | html %] -- [% CASE 'seefrom' %] - [% heading %] -- + [% heading | html %] -- [% CASE 'seealso' %] - [% heading %] -- + [% heading | html %] -- [% END %] [% ELSE %] - [% IF ( label ) %][% label %][% END %] - [% heading %] + [% IF ( label ) %][% label | html %][% END %] + + [% IF ( linkpath && search ) %][% heading | html %] + [% ELSE %][% heading | html %][% END %] + [% UNLESS ( type=='seefrom' || type=='seealso' ) %][% SWITCH type %] [% CASE 'earlier' %](Earlier heading) [% CASE 'later' %](Later heading) @@ -22,35 +25,36 @@ [% CASE 'musical' %](Musical composition) [% CASE 'broader' %](Broader heading) [% CASE 'narrower' %](Narrower heading) - [% CASE %]([% type %]) + [% CASE 'parent' %](Immediate parent body) + [% CASE %]([% type | html %]) [% END %][% END %] [% END %] [% END %] [% BLOCK authresult %] - [% IF ( summary.summary ) %][% summary.summary %]:[% END %] + [% IF ( summary.summary ) %][% summary.summary | html %]:[% END %] [% UNLESS ( summary.summaryonly ) %] [% FOREACH authorize IN summary.authorized %] - + [% END %] [% IF ( marcflavour == 'UNIMARC' ) %] [% FOREACH note IN summary.notes %] - [% note %] + [% note | html %] [% END %] [% FOREACH seefro IN summary.seefrom %] - [% PROCESS showreference heading=seefro.heading label="" type=seefro.type %] + [% PROCESS showreference heading=seefro.heading label="" type=seefro.type search='' %] [% END %] [% ELSE %] [% IF ( summary.seefrom ) %] [% FOREACH seefro IN summary.seefrom %]