Bug 16522: (follow-up) MARC display templates and get_marc_host fixes
[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' %]<span>(Earlier heading)</span>
43             [% CASE 'later' %]<span>(Later heading)</span>
44             [% CASE 'acronym' %]<span>(Acronym)</span>
45             [% CASE 'musical' %]<span>(Musical composition)</span>
46             [% CASE 'broader' %]<span>(Broader heading)</span>
47             [% CASE 'narrower' %]<span>(Narrower heading)</span>
48             [% CASE 'parent' %]<span>(Immediate parent body)</span>
49             [% CASE %][% IF type %]([% type | html %])
50             [% END %]
51         [% END %]
52         </span>
53         [% END %]
54     [% END %]
55 [% END %]
56
57 [% BLOCK authresult %]
58     [% IF ( summary.label ) %][% summary.label | html %]:[% END %]
59     [% IF summary.summary %]
60       <div class="authority-summary">
61         [% summary.summary | html %]
62       </div>
63     [% END %]
64     [% UNLESS ( summary.summaryonly ) %]
65         <div class="authorizedheading">
66           [% FOREACH authorize IN summary.authorized %]
67             <span class="authorizedheading [% IF auth_preview %]authority_preview[% END %]">
68                 <a data-authid="[% authid | html %]" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | uri %]">[% authorize.heading | html %]</a>
69             </span>
70             [% UNLESS loop.last %] | [% END %]
71           [% END %]
72         </div>
73         [% IF ( marcflavour == 'UNIMARC' ) %]
74           [% IF summary.notes %]
75            <div class="authres_notes">
76            [% FOREACH note IN summary.notes %]
77              <span>[% note.note | html %]</span>
78            [% END %]
79            </div>
80           [% END %]
81           [% IF summary.seefrom %]
82             <div class="authres_seefrom">
83             [% FOREACH see IN summary.seefrom %]
84               [% PROCESS showreference heading=see.heading linkType="" type=see.type authid=see.authid %]
85               [% IF ! loop.last %] ; [% END %]
86             [% END %]
87             </div>
88           [% END %]
89             [% IF summary.seealso %]
90               <div class="authres_seealso">
91               [% FOREACH see IN summary.seealso %]
92                  [% PROCESS showreference heading=see.heading linkType="" type=see.type authid=see.authid %]
93                  [% IF ! loop.last %] ; [% END %]
94               [% END %]
95               </div>
96             [% END %]
97             [% IF summary.otherscript %]
98               <div class="authres_otherscript">
99               [% FOREACH other IN summary.otherscript %]
100                 [% PROCESS language lang=other.lang | trim %]:
101                 [% other.term | html %]
102                 [% IF ! loop.last %] ; [% END %]
103               [% END %]
104               </div>
105             [% END %]
106         [% ELSE %]
107             [% IF ( summary.seefrom.size >= 1 ) %]
108             <div class="seefrom">
109                 <span class="seefrom">used for/see from:</span>
110                 [% FOREACH seefro IN summary.seefrom %]
111                     <div class="authref">
112                     [%# Following on one line for translatability %]
113                     [% PROCESS showreference heading=seefro.heading linkType='seefrom' type=seefro.type authid=seefro.authid %]
114                     </div>
115                 [% END %]
116             </div>
117             [% END %]
118             [% IF ( summary.seealso.size >= 1 ) %]
119             <div class="seealso">
120                 <span class="seealso">see also:</span>
121                 [% FOREACH seeals IN summary.seealso %]
122                     <div class="authref">
123                     [%# Following on one line for translatability %]
124                     [% PROCESS showreference heading=seeals.heading linkType='seealso' type=seeals.type authid=seeals.authid %]
125                     </div>
126                 [% END %]
127             </div>
128             [% END %]
129         [% END %]
130     [% END %]
131 [% END %]
132
133 [% BLOCK language %]
134   [% SWITCH lang %]
135    [% CASE ['en', 'eng'] %]<span>English</span>
136    [% CASE ['fr', 'fre'] %]<span>French</span>
137    [% CASE ['it', 'ita'] %]<span>Italian</span>
138    [% CASE ['de', 'ger', 'deu'] %]<span>German</span>
139    [% CASE ['es', 'spa'] %]<span>Spanish</span>
140    [% CASE ['heb'] %]<span>Hebrew</span>
141    [% CASE ['ara'] %]<span>Arabic</span>
142    [% CASE ['gre'] %]<span>Greek (modern)</span>
143    [% CASE ['grc'] %]<span>Greek (to 1453)</span>
144    [% CASE %]<span>[% lang | html %]</span>
145   [% END %]
146 [% END %]