Bug 10691: use authority ID in see-also links in authority search results (OPAC)

This patch changes the URL and data used to show the 'see also' links
on the OPAC's authority search results page.

Bonus points: makes some strings translatable.

To test:
- On your dev setup (master) create some authority records (I created
  personal name authorities).
- Pick one of them and link 400$a to another one, do the same with 500$a
- Add some other 400$a and 500$a without linking (i.e. plain text)
- Make sure zebra is running and changes got indexed.
- In the OPAC search for the authority that is linked to the others.
- Check the 'see also:' link points to an authority search
- Apply the patch
- Reload/re-do the search
- Check the 'see also:' link points to the authority id in the case
  of linked authorities, and to an authority search in the case of
  plain text headings.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Work as described. No errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Tomás Cohen Arazi 2013-09-18 11:33:07 -03:00 committed by Galen Charlton
parent c62557a4fa
commit ae7431608c
2 changed files with 72 additions and 48 deletions

View file

@ -1,4 +1,6 @@
[% BLOCK showreference %]
[% SET authidurl = '/cgi-bin/koha/opac-authoritiesdetail.pl?authid=' %]
[% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=' %]
[% IF marcflavour == 'UNIMARC' %]
[% SWITCH type %]
[% CASE 'broader' %]
@ -11,15 +13,27 @@
<span class="RT">RT: [% heading | html %]</span>
[% END %]
[% ELSE %]
[% IF ( label ) %]<span class="label">[% SWITCH label %]
[% CASE 'see also:' %]see also:
[% CASE 'used for/see from:' %]used for/see from:
[% END %]</span>[% END %]
<span class="heading">
[% IF ( linkpath && search ) %]<a href="[% link | url %][% search | url %]">[% heading | html %]</a>
[% ELSE %][% heading | html %][% END %]
<span class="label">
[% IF ( type=='seefrom' ) %]
used for/see from:
[% ELSIF ( type=='seealso' ) %]
see also:
[% END %]
</span>
[% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% SWITCH type %]
<span class="heading">
[% IF ( type=='seealso' ) %]
[% IF ( authid ) %]
<a href="[% authidurl | url %][% authid | url %]">[% heading | html %]</a>
[% ELSE %]
<a href="[% searchurl | url %][% heading | html %]">[% heading | html %]</a>
[% END %]
[% ELSE %]
[% heading | html %]
[% END %]
</span>
[% UNLESS ( type=='seefrom' || type=='seealso' ) %]
<span class="type">
[% SWITCH type %]
[% CASE 'earlier' %](Earlier heading)
[% CASE 'later' %](Later heading)
[% CASE 'acronym' %](Acronym)
@ -27,8 +41,11 @@
[% CASE 'broader' %](Broader heading)
[% CASE 'narrower' %](Narrower heading)
[% CASE 'parent' %](Immediate parent body)
[% CASE %][% IF type %]([% type | html %])[% END %]
[% END %]</span>[% END %]
[% CASE %][% IF type %]([% type | html %])
[% END %]
[% END %]
</span>
[% END %]
[% END %]
[% END %]
[% BLOCK authresult %]
@ -76,14 +93,21 @@
[% 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 search='' %]
[% PROCESS showreference
heading=seefro.heading
type=seefro.type
%]
</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 linkpath=link search=seeals.search %]
[% PROCESS showreference
heading=seeals.heading
type=seeals.type
authid=seeals.authid
%]
</div>
[% END %]
[% END %]

View file

@ -59,7 +59,7 @@
[% ELSE %]
<tr>
[% END %]
<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&value=" %]</td>
<td>[% PROCESS authresult summary=resul.summary %]</td>
<td>[% resul.authtype %]</td>
[% UNLESS ( resul.isEDITORS ) %]
<td>