Bugzilla – Attachment 11584 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.37 KB, created by
Jared Camins-Esakov
on 2012-08-13 20:01:08 UTC
(
hide
)
Description:
Bug 8210: add links to authorities in normal mode headings
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-08-13 20:01:08 UTC
Size:
6.37 KB
patch
obsolete
>From 6cb1ca764b90d2fc0e84e26cda42f6d183a417d0 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 >Content-Type: text/plain; charset="UTF-8" > >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> >--- > C4/Biblio.pm | 12 +++++- > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 40 ++++++++++++++------ > 2 files changed, 38 insertions(+), 14 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index c479502..308fda1 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1707,6 +1707,7 @@ sub GetMarcSubjects { > > # if there is an authority link, build the link with an= subfield9 > my $found9 = 0; >+ my $authoritylink; > for my $subject_subfield (@subfields) { > > # don't load unimarc subfields 3,4,5 >@@ -1724,6 +1725,7 @@ sub GetMarcSubjects { > } > if ( $code eq 9 ) { > $found9 = 1; >+ $authoritylink = $linkvalue; > @link_loop = ( { 'limit' => 'an', link => "$linkvalue" } ); > } > if ( not $found9 ) { >@@ -1740,7 +1742,10 @@ sub GetMarcSubjects { > $counter++; > } > >- push @marcsubjects, { MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop }; >+ push @marcsubjects, { >+ MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop, >+ authoritylink => $authoritylink, >+ }; > > } > return \@marcsubjects; >@@ -1823,7 +1828,10 @@ sub GetMarcAuthors { > unless ( $authors_subfield->[0] eq '9' || $authors_subfield->[0] eq '0'); > $count_auth++; > } >- 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 54ed48e..71ba359 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -336,12 +336,20 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > </span> > > [% IF ( MARCAUTHORS ) %] >- <span class="results_summary"><span class="label">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 %] >+ <span class="results_summary"> >+ <span class="label">Authors:</span> >+ [% FOREACH MARCAUTHOR IN MARCAUTHORS %] >+ [% authorsloop = loop %] >+ [% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] >+ <a title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" >+ href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link IN SUBFIELD.link_loop %][% link.operator |url %][% link.limit |url %]:[% link.link |url %][% END %]">[% SUBFIELD.value %]</a> >+ [% UNLESS (loop.last) %][% SUBFIELD.separator %][% END %] >+ [% 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 %] > >@@ -395,12 +403,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