Bugzilla – Attachment 10697 Details for
Bug 3462
Link see also in authorities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3462: Links in authorities should be hyperlinks
Bug-3462-Links-in-authorities-should-be-hyperlinks.patch (text/plain), 15.86 KB, created by
Jared Camins-Esakov
on 2012-07-08 14:01:56 UTC
(
hide
)
Description:
Bug 3462: Links in authorities should be hyperlinks
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-07-08 14:01:56 UTC
Size:
15.86 KB
patch
obsolete
>From 3ea622499e3a72fc94e43519dc0aaa45daf4def6 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Wed, 30 May 2012 16:29:54 -0400 >Subject: [PATCH] Bug 3462: Links in authorities should be hyperlinks >Content-Type: text/plain; charset="UTF-8" > >Make see also links in both the OPAC and authority module search results >into hyperlinks and not just textual strings. > >To test: >1. Do a search for an authority that will bring up a heading with a > see also reference in the staff client and the OPAC. >2. Confirm that the see also references listed in the search results > are now hyperlinks, which work. >--- > C4/AuthoritiesMarc.pm | 43 +++++++++++++++---- > .../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, 74 insertions(+), 41 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index c92c319..21b895e 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/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')); > 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..')) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc >index 92314b1..27c198f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc >@@ -2,19 +2,22 @@ > [% IF marcflavour == 'UNIMARC' %] > [% SWITCH type %] > [% CASE 'broader' %] >- <span class="BT">[% heading %]</span> -- >+ <span class="BT">[% heading | html %]</span> -- > [% CASE 'narrower' %] >- <span class="NT">[% heading %]</span> -- >+ <span class="NT">[% heading | html %]</span> -- > [% CASE 'narrower' %] >- <span class="NT">[% heading %]</span> -- >+ <span class="NT">[% heading | html %]</span> -- > [% CASE 'seefrom' %] >- <span class="UF">[% heading %]</span> -- >+ <span class="UF">[% heading | html %]</span> -- > [% CASE 'seealso' %] >- <span class="RT">[% heading %]</span> -- >+ <span class="RT">[% heading | html %]</span> -- > [% END %] > [% ELSE %] >- [% IF ( label ) %]<span class="label">[% label %]</span>[% END %] >- <span class="heading">[% heading %]</span> >+ [% IF ( label ) %]<span class="label">[% label | html %]</span>[% END %] >+ <span class="heading"> >+ [% IF ( linkpath && search ) %]<a href="[% link | url %][% search | url %]">[% heading | html %]</a> >+ [% ELSE %][% heading | html %][% END %] >+ </span> > [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% 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 %]</span>[% 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 %] >- <span class="authorizedheading">[% authorize %]</span> >+ <span class="authorizedheading">[% authorize | html %]</span> > [% END %] > [% IF ( marcflavour == 'UNIMARC' ) %] > [% FOREACH note IN summary.notes %] >- <span class="note">[% note %]</span> >+ <span class="note">[% note | html %]</span> > [% 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 %] > <div class="seefrom authref"> >- [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type %] >+ [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type search='' %] > </div> > [% END %] > [% END %] > [% IF ( summary.seealso ) %] > [% FOREACH seeals IN summary.seealso %] > <div class="seealso authref"> >- [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type %] >+ [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type linkpath=link search=seeals.search %] > </div> > [% END %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >index 038959f..362a33a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >@@ -64,7 +64,7 @@ function searchauthority() { > [% ELSE %] > <tr> > [% END %] >- <td>[% PROCESS authresult summary=resul.summary %]</td> >+ <td>[% PROCESS authresult summary=resul.summary link="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=" %]</td> > <td><a href="detail.pl?authid=[% resul.authid %]">Details</a></td> > [% UNLESS ( resul.isEDITORS ) %] > <td> >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc >index 92314b1..27c198f 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc >@@ -2,19 +2,22 @@ > [% IF marcflavour == 'UNIMARC' %] > [% SWITCH type %] > [% CASE 'broader' %] >- <span class="BT">[% heading %]</span> -- >+ <span class="BT">[% heading | html %]</span> -- > [% CASE 'narrower' %] >- <span class="NT">[% heading %]</span> -- >+ <span class="NT">[% heading | html %]</span> -- > [% CASE 'narrower' %] >- <span class="NT">[% heading %]</span> -- >+ <span class="NT">[% heading | html %]</span> -- > [% CASE 'seefrom' %] >- <span class="UF">[% heading %]</span> -- >+ <span class="UF">[% heading | html %]</span> -- > [% CASE 'seealso' %] >- <span class="RT">[% heading %]</span> -- >+ <span class="RT">[% heading | html %]</span> -- > [% END %] > [% ELSE %] >- [% IF ( label ) %]<span class="label">[% label %]</span>[% END %] >- <span class="heading">[% heading %]</span> >+ [% IF ( label ) %]<span class="label">[% label | html %]</span>[% END %] >+ <span class="heading"> >+ [% IF ( linkpath && search ) %]<a href="[% link | url %][% search | url %]">[% heading | html %]</a> >+ [% ELSE %][% heading | html %][% END %] >+ </span> > [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% 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 %]</span>[% 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 %] >- <span class="authorizedheading">[% authorize %]</span> >+ <span class="authorizedheading">[% authorize | html %]</span> > [% END %] > [% IF ( marcflavour == 'UNIMARC' ) %] > [% FOREACH note IN summary.notes %] >- <span class="note">[% note %]</span> >+ <span class="note">[% note | html %]</span> > [% 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 %] > <div class="seefrom authref"> >- [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type %] >+ [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type search='' %] > </div> > [% END %] > [% END %] > [% IF ( summary.seealso ) %] > [% FOREACH seeals IN summary.seealso %] > <div class="seealso authref"> >- [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type %] >+ [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type linkpath=link search=seeals.search %] > </div> > [% END %] > [% END %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt >index 9e6c3d6..661771b 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt >@@ -57,7 +57,7 @@ > [% ELSE %] > <tr> > [% END %] >- <td>[% PROCESS authresult summary=resul.summary %]</td> >+ <td>[% PROCESS authresult summary=resul.summary link="/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&valuec=" %]</td> > <td>[% authtypetext %]</td> > [% UNLESS ( resul.isEDITORS ) %] > <td> >diff --git a/opac/opac-authorities-home.pl b/opac/opac-authorities-home.pl >index 4e9f9ab..b6d8df6 100755 >--- a/opac/opac-authorities-home.pl >+++ b/opac/opac-authorities-home.pl >@@ -58,10 +58,10 @@ foreach my $thisauthtype ( > } > > if ( $op eq "do_search" ) { >- my @marclist = ($query->param('marclista'),$query->param('marclistb'),$query->param('marclistc')); >+ my @marclist = ($query->param('marclista') || '',$query->param('marclistb') || '',$query->param('marclistc') || 'mainentry'); > my @and_or = ($query->param('and_ora'),$query->param('and_orb'),$query->param('and_orc')); > my @excluding = ($query->param('excludinga'),$query->param('excludingb'),$query->param('excludingc'),); >- my @operator = ($query->param('operatora'),$query->param('operatorb'),$query->param('operatorc')); >+ my @operator = ($query->param('operatora') || '',$query->param('operatorb') || '',$query->param('operatorc')); > my $orderby = $query->param('orderby'); > my @value = ($query->param('valuea') || "",$query->param('valueb') || "",$query->param('valuec') || "",); > >-- >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 3462
:
1315
|
1316
|
10422
|
10691
|
10693
|
10695
|
10696
|
10697
|
10698
|
10699
|
11147
|
11256
|
11390
|
12149