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