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