Bugzilla – Attachment 12262 Details for
Bug 8210
Headings in OPAC bib details should link to authority record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8210: add links to authorities in normal mode headings
Bug-8210-add-links-to-authorities-in-normal-mode-h.patch (text/plain), 6.15 KB, created by
Jared Camins-Esakov
on 2012-09-16 13:27:24 UTC
(
hide
)
Description:
Bug 8210: add links to authorities in normal mode headings
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-09-16 13:27:24 UTC
Size:
6.15 KB
patch
obsolete
>From 6359ab028a2ce5f62eb4cb882ba0fbda39d382ff Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 13 Aug 2012 15:34:51 -0400 >Subject: [PATCH] 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> >--- > C4/Biblio.pm | 12 +++++- > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 36 ++++++++++++++------ > 2 files changed, 35 insertions(+), 13 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 5500b30..fbcce2b 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1706,10 +1706,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 >@@ -1745,7 +1747,10 @@ sub GetMarcSubjects { > } > } > >- push @marcsubjects, { MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop }; >+ push @marcsubjects, { >+ MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop, >+ authoritylink => $authoritylink, >+ }; > > } > return \@marcsubjects; >@@ -1831,7 +1836,10 @@ sub GetMarcAuthors { > }; > } > } >- push @marcauthors, { MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop }; >+ push @marcauthors, { >+ MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop, >+ authoritylink => $subfield9, >+ }; > } > return \@marcauthors; > } >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >index be300b1..e7f392b 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -360,11 +360,17 @@ 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 %] >- [% END %] >+ [% 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 %] >+ [% 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> >- [% 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> >+ <span class="results_summary"> >+ <span class="label">Subject(s):</span> >+ [% FOREACH MARCSUBJCT IN MARCSUBJCTS %] >+ [% 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 %] >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8210
:
11359
|
11474
|
11480
|
11519
|
11584
|
11591
|
12261
| 12262