Bug 8210: add links to authorities in normal mode headings
Cherry-picked from BibLibre's work on bug 5888: opac-detail subject/author links improvements Added a link to opac-authoritiesdetail.pl when possible. Only affects 'Normal view'. Does not affect XSLT display. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
parent
237a43b361
commit
b0ab204bfd
2 changed files with 35 additions and 13 deletions
12
C4/Biblio.pm
12
C4/Biblio.pm
|
@ -1704,10 +1704,12 @@ sub GetMarcSubjects {
|
|||
|
||||
# if there is an authority link, build the links with an= subfield9
|
||||
my $subfield9 = $field->subfield('9');
|
||||
my $authoritylink;
|
||||
if ($subfield9) {
|
||||
my $linkvalue = $subfield9;
|
||||
$linkvalue =~ s/(\(|\))//g;
|
||||
@link_loop = ( { limit => 'an', 'link' => $linkvalue } );
|
||||
$authoritylink = $linkvalue
|
||||
}
|
||||
|
||||
# other subfields
|
||||
|
@ -1743,7 +1745,10 @@ sub GetMarcSubjects {
|
|||
}
|
||||
}
|
||||
|
||||
push @marcsubjects, { MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop };
|
||||
push @marcsubjects, {
|
||||
MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop,
|
||||
authoritylink => $authoritylink,
|
||||
};
|
||||
|
||||
}
|
||||
return \@marcsubjects;
|
||||
|
@ -1829,7 +1834,10 @@ sub GetMarcAuthors {
|
|||
};
|
||||
}
|
||||
}
|
||||
push @marcauthors, { MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop };
|
||||
push @marcauthors, {
|
||||
MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop,
|
||||
authoritylink => $subfield9,
|
||||
};
|
||||
}
|
||||
return \@marcauthors;
|
||||
}
|
||||
|
|
|
@ -361,9 +361,15 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
|
|||
[% IF ( MARCAUTHORS ) %]
|
||||
<span class="results_summary"><span class="label">Additional authors:</span>
|
||||
[% FOREACH MARCAUTHOR IN MARCAUTHORS %]
|
||||
[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %]<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value %]</a>[% END %]
|
||||
[% UNLESS ( loop.last ) %]|
|
||||
[% END %]
|
||||
[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
|
||||
[% MARCAUTHOR_SUBFIELDS_LOO.separator %]
|
||||
<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]"
|
||||
href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value %]</a>
|
||||
[% END %]
|
||||
[% IF (MARCAUTHOR.authoritylink) %]
|
||||
<a class='authlink' href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"></a>
|
||||
[% END %]
|
||||
[% UNLESS ( loop.last ) %]|[% END %]
|
||||
[% END %]
|
||||
</span>
|
||||
[% END %]
|
||||
|
@ -418,12 +424,20 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
|
|||
[% END %]
|
||||
|
||||
[% IF ( MARCSUBJCTS ) %]
|
||||
<span class="results_summary"><span class="label">Subject(s):</span>
|
||||
<span class="results_summary">
|
||||
<span class="label">Subject(s):</span>
|
||||
[% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
|
||||
[% FOREACH MARCSUBJECT_SUBFIELDS_LOO IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
|
||||
[% MARCSUBJECT_SUBFIELDS_LOO.separator %]<a title="$[% MARCSUBJECT_SUBFIELDS_LOO.code %] [% MARCSUBJECT_SUBFIELDS_LOO.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCSUBJECT_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCSUBJECT_SUBFIELDS_LOO.value %]</a>[% END %]
|
||||
[% IF ( loop.last ) %][% ELSE %]|[% END %]
|
||||
[% END %]</span>
|
||||
[% subjectsloop = loop %]
|
||||
[% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
|
||||
[% SUBFIELD.separator %]
|
||||
<a title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN SUBFIELD.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]" onclick="showSubjects(this, [% subjectsloop.count %], [% loop.count %]); return false;">[% SUBFIELD.value %]</a>
|
||||
[% END %]
|
||||
[% IF (MARCSUBJCT.authoritylink) %]
|
||||
<a class="authlink" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCSUBJCT.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png" /></a>
|
||||
[% END %]
|
||||
[% UNLESS ( loop.last ) %] | [% END %]
|
||||
[% END %]
|
||||
</span>
|
||||
[% ELSE %]
|
||||
[% IF ( subjects ) %]<span class="results_summary"><span class="label">Subject(s):</span> [% FOREACH subject IN subjects %]<a href="/cgi-bin/koha/opac-search.pl?q=su:[% subject.subject |url %]">[% subject.subject %]</a> | [% END %]</span>[% END %]
|
||||
[% END %]
|
||||
|
|
Loading…
Reference in a new issue