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