Koha/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc
Jonathan Druart 927aedafa1 Bug 10985: [UNIMARC] Fix authority summary
The problem is the template in authority type summary is not respected
at all. It is only read to see which fields and subfields should appear
in the summary.
This patch fixes that.
It also fixes a bug in auth_finder.pl plugin when summary contains
fields other than 2XX.

Test plan:
0/ You must use a UNIMARC setup for those tests
1/ edit an authority type summary with:
     NP : [200a][, 200b][ 200d][-- 152b --][ ; 200c][ (200f)] [001*] [ppn: 009*]
2/ create a new authority with previous fields (it is possible some
   fields don't exist).
3/ search this authority and verify the summary is someting like:
     NP : Name, D.-- NP -- 23849 ppn: my_ppn
4/ Verify some summary for existing authorities and check they are
   correct.
5/ Edit a biblio record and use the plugin auth_finder.pl (for example
   in a 7XX field)
6/ Do a search and verify the summary is correct
7/ Click on 'choose' or one of the numbered links ('1', '2', ... ; you
should have multiple 2XX fields for the numbered links to show up)
8/ Verify that the biblio field is correctly filled.

/!\ For the ppn, it should be defined in the zebra indexes.

In MARC21 and NORMARC setups, this patch should change nothing, please
verify that too (you can check that the auth_finder.pl plugin is still
working and the auth type summary is correctly displayed in authorities
search and auth_finder.pl plugin).

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

It works as described, both in authority search result page, and in authority
data entry plugin.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 11:54:36 -03:00

146 lines
5.3 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/authorities/detail.pl?authid=' %]
[% SET searchurl = '/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&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 %]
[% END %]
[% END %]
[% BLOCK authresult %]
[% IF ( summary.label ) %][% summary.label | html %]:[% END %]
[% IF summary.summary %]
<div class="authority-summary">
[% summary.summary %]
</div>
[% END %]
[% UNLESS ( summary.summaryonly ) %]
<div class="authorizedheading">
[% FOREACH authorize IN summary.authorized %]
<span class="authorizedheading">[% authorize.heading | html %]</span>
[% UNLESS loop.last %] | [% END %]
[% END %]
</div>
[% IF ( marcflavour == 'UNIMARC' ) %]
[% IF summary.notes %]
<div class="authres_notes">
[% FOREACH note IN summary.notes %]
<span>[% note.note | html %]</span>
[% END %]
</div>
[% END %]
[% IF summary.seefrom %]
<div class="authres_seefrom">
[% FOREACH see IN summary.seefrom %]
[% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %]
[% IF ! loop.last %] ; [% END %]
[% 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.size >= 1 ) %]
<div class="seefrom">
<span class="seefrom">used for/see from:</span>
[% FOREACH seefro IN summary.seefrom %]
<div class="authref">
[% PROCESS showreference
heading=seefro.heading
linkType='seefrom'
type=seefro.type
authid=seefro.authid
%]
</div>
[% END %]
</div>
[% END %]
[% IF ( summary.seealso.size >= 1 ) %]
<div class="seealso">
<span class="seealso">see also:</span>
[% FOREACH seeals IN summary.seealso %]
<div class="authref">
[% PROCESS showreference
heading=seeals.heading
linkType='seealso'
type=seeals.type
authid=seeals.authid
%]
</div>
[% END %]
</div>
[% END %]
[% END %]
[% END %]
[% END %]
[% BLOCK language %]
[% SWITCH lang %]
[% CASE ['en', 'eng'] %]English
[% CASE ['fr', 'fre'] %]French
[% CASE ['it', 'ita'] %]Italian
[% CASE ['de', 'ger', 'deu'] %]German
[% CASE ['es', 'spa'] %]Spanish
[% CASE ['heb'] %]Hebrew
[% CASE ['ara'] %]Arabic
[% CASE ['gre'] %]Greek (modern)
[% CASE ['grc'] %]Greek (to 1453)
[% CASE %][% lang %]
[% END %]
[% END %]