Koha/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc
Tomas Cohen Arazi 910dff2825 Bug 10987: remove duplicate 'see also' and 'see from' labels from authority search results
If an authority record has more than one 4xx$a (or 5xx$a) entries the
corresponding labels 'see also' and 'used for/see from' werwe repeated.
This patch removes duplicate instances of the labels, improving
readability.

To test:
- Have authority records with more than one entry on the 4xx (or 5xx)
  fields.
- Do a search, check "see also:" (or 'used for/see from') appear more
  than once.
- Apply the patch
- Reload and check it looks nicer :-D
- Repeat for: staff auth search, OPAC using ccsr, OPAC using prog
- Signoff

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Work as decribed. No koha-qa errors
Nice view on staff and both opac

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-01-16 23:07:03 +00:00

113 lines
4.6 KiB
HTML

[% BLOCK showreference %]
[%#
Parameters:
heading: the heading itself
linkType: currently 'seefrom' or 'seealso', controls the label for the entry
type:
authid: if it is a linked authority, its authid
%]
[% SET authidurl = '/cgi-bin/koha/opac-authoritiesdetail.pl?authid=' %]
[% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&marclist=mainentry&and_or=and&orderby=HeadingAsc&value=' %]
[% IF marcflavour == 'UNIMARC' %]
[% SWITCH type %]
[% CASE 'broader' %]
<span class="BT">BT: [% heading | html %]</span>
[% CASE 'narrower' %]
<span class="NT">NT: [% heading | html %]</span>
[% CASE 'seefrom' %]
<span class="UF">UF: [% heading | html %]</span>
[% CASE 'seealso' %]
<span class="RT">RT: [% heading | html %]</span>
[% END %]
[% ELSE %]
<span class="heading">
[% IF ( linkType=='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)
[% CASE 'musical' %](Musical composition)
[% CASE 'broader' %](Broader heading)
[% CASE 'narrower' %](Narrower heading)
[% CASE 'parent' %](Immediate parent body)
[% CASE %]
[% IF type %]([% type | html %])[% END %]
[% END %]
</span>
[% END # / UNLESS seefrom %]
[% END # / IF marcflavour = 'UNIMARC' %]
[% END # / BLOCK showreference %]
[% BLOCK authresult %]
[% IF ( summary.summary ) %][% summary.summary | html %]:[% END %]
[% UNLESS ( summary.summaryonly ) %]
<div class="authorizedheading">
[% FOREACH authorize IN summary.authorized %]
<span class="authorizedheading">[% authorize.heading | html %]</span>
[% END %]
</div>
[% IF ( marcflavour == 'UNIMARC' ) %]
[% IF summary.notes %]
<div class="authres_notes">
[% FOREACH note IN summary.notes %]
[% note.note | html %]</span>
[% END %]
</div>
[% END %]
[% IF summary.seealso %]
<div class="authres_seealso">
[% FOREACH see IN summary.seealso %]
[% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %]
[% IF ! loop.last %] ; [% END %]
[% END %]
</div>
[% END %]
[% IF summary.otherscript %]
<div class="authres_otherscript">
[% FOREACH other IN summary.otherscript %]
[% PROCESS language lang=other.lang | trim %]:
[% other.term %]
[% IF ! loop.last %] ; [% END %]
[% END %]
</div>
[% END %]
[% ELSE %]
[% IF ( summary.seefrom ) %]
<span class="seefrom">used for/see from:</span>
[% FOREACH seefro IN summary.seefrom %]
<div class="seefrom authref">
[% PROCESS showreference
heading=seefro.heading
linkType='seefrom'
type=seefro.type
%]
</div>
[% END %]
[% END %]
[% IF ( summary.seealso ) %]
<span class="seealso">see also:</span>
[% FOREACH seeals IN summary.seealso %]
<div class="seealso authref">
[% PROCESS showreference
heading=seeals.heading
linkType='seealso'
type=seeals.type
authid=seeals.authid
%]
</div>
[% END %]
[% END %]
[% END # / IF marcflavour = 'UNIMARC' %]
[% END # / UNLESS summary.summaryonly %]
[% END # / BLOCK authresult %]