Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / authorities-search-results.inc
1 [% BLOCK showreference %]
2 [%# Parameters: %]
3 [%# heading: the heading itself %]
4 [%# linkType: currently 'seefrom' or 'seealso', controls the label for the entry type: %]
5 [%# authid: if it is a linked authority, its authid %]
6
7     [% SET authidurl = '/cgi-bin/koha/authorities/detail.pl?authid=' %]
8     [% SET searchurl = '/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=' %]
9
10     [% IF marcflavour == 'UNIMARC' %]
11         [% SWITCH type %]
12         [% CASE 'broader' %]
13             <span class="BT"><abbr title="Broader Term">BT</abbr>: [% heading | html %]</span>
14         [% CASE 'narrower' %]
15             <span class="NT"><abbr title="Narrower Term">NT</abbr>: [% heading | html %]</span>
16         [% CASE 'seefrom' %]
17             <span class="UF"><abbr title="Used For">UF</abbr>: [% heading | html %]</span>
18         [% CASE 'seealso' %]
19             <span class="RT"><abbr title="Related Term">RT</abbr>: [% heading | html %]</span>
20         [% END %]
21     [% ELSE %]
22         <span class="heading">
23         [% IF ( linkType=='seealso' ) %]
24             [% IF ( authid ) %]
25             <a href="[% authidurl | url %][% authid | url %]">[% heading | html %]</a>
26             [% ELSE %]
27             <a href="[% searchurl | url %][% heading | html %]">[% heading | html %]</a>
28             [% END %]
29         [% ELSE %]
30             [% heading | html %]
31         [% END %]
32         </span>
33         [% UNLESS ( type=='seefrom' || type=='seealso' ) %]
34         <span class="type">
35             [% SWITCH type %]
36             [% CASE 'earlier' %](Earlier heading)
37             [% CASE 'later' %](Later heading)
38             [% CASE 'acronym' %](Acronym)
39             [% CASE 'musical' %](Musical composition)
40             [% CASE 'broader' %](Broader heading)
41             [% CASE 'narrower' %](Narrower heading)
42             [% CASE 'parent' %](Immediate parent body)
43             [% CASE %][% IF type %]([% type | html %])
44             [% END %]
45         [% END %]
46         </span>
47         [% END %]
48     [% END %]
49 [% END %]
50 [% BLOCK authresult %]
51     [% IF ( summary.label ) %][% summary.label | html %]:[% END %]
52     [% IF summary.summary %]
53       <div class="authority-summary">
54         [% summary.summary | html %]
55       </div>
56     [% END %]
57     [% UNLESS ( summary.summaryonly ) %]
58         <div class="authorizedheading">
59           [% FOREACH authorize IN summary.authorized %]
60             <span class="authorizedheading">[% authorize.heading | html %]</span>
61             [% UNLESS loop.last %] | [% END %]
62           [% END %]
63         </div>
64         [% IF ( marcflavour == 'UNIMARC' ) %]
65           [% IF summary.notes %]
66            <div class="authres_notes">
67            [% FOREACH note IN summary.notes %]
68              <span>[% note.note | html %]</span>
69            [% END %]
70            </div>
71           [% END %]
72           [% IF summary.seefrom %]
73             <div class="authres_seefrom">
74             [% FOREACH see IN summary.seefrom %]
75               [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %]
76               [% IF ! loop.last %] ; [% END %]
77             [% END %]
78             </div>
79           [% END %]
80             [% IF summary.seealso %]
81               <div class="authres_seealso">
82               [% FOREACH see IN summary.seealso %]
83                  [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %]
84                  [% IF ! loop.last %] ; [% END %]
85               [% END %]
86               </div>
87             [% END %]
88             [% IF summary.otherscript %]
89               <div class="authres_otherscript">
90               [% FOREACH other IN summary.otherscript %]
91                 [% PROCESS language lang=other.lang | trim %]:
92                 [% other.term | html %]
93                 [% IF ! loop.last %] ; [% END %]
94               [% END %]
95               </div>
96             [% END %]
97         [% ELSE %]
98             [% IF ( summary.seefrom.size >= 1 ) %]
99             <div class="seefrom">
100                 <span class="seefrom">used for/see from:</span>
101                 [% FOREACH seefro IN summary.seefrom %]
102                     <div class="authref">
103                     [%# Following on one line for translatability %]
104                     [% PROCESS showreference heading=seefro.heading linkType='seefrom' type=seefro.type authid=seefro.authid %]
105                     </div>
106                 [% END %]
107             </div>
108             [% END %]
109             [% IF ( summary.seealso.size >= 1 ) %]
110             <div class="seealso">
111                 <span class="seealso">see also:</span>
112                 [% FOREACH seeals IN summary.seealso %]
113                     <div class="authref">
114                     [%# Following on one line for translatability %]
115                     [% PROCESS showreference heading=seeals.heading linkType='seealso' type=seeals.type authid=seeals.authid %]
116                     </div>
117                 [% END %]
118             </div>
119             [% END %]
120         [% END %]
121     [% END %]
122 [% END %]
123 [% BLOCK language %]
124   [% SWITCH lang %]
125    [% CASE ['en', 'eng'] %]English
126    [% CASE ['fr', 'fre'] %]French
127    [% CASE ['it', 'ita'] %]Italian
128    [% CASE ['de', 'ger', 'deu'] %]German
129    [% CASE ['es', 'spa'] %]Spanish
130    [% CASE ['heb'] %]Hebrew
131    [% CASE ['ara'] %]Arabic
132    [% CASE ['gre'] %]Greek (modern)
133    [% CASE ['grc'] %]Greek (to 1453)
134    [% CASE %][% lang | html %]
135   [% END %]
136 [% END %]