Bug 20986: Add 867 and 868 holdings display
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / xslt / MARC21slim2OPACDetail.xsl
blob741e4609fac4ceb56f41d9a38aa5571a92e9301c
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
3 <!-- Edited: Bug 1807 [ENH] XSLT enhancements sponsored by bywater solutions 2015/01/19 WS wsalesky@gmail.com -->
4 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
5 <xsl:stylesheet version="1.0"
6 xmlns:marc="http://www.loc.gov/MARC21/slim"
7 xmlns:items="http://www.koha-community.org/items"
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:str="http://exslt.org/strings"
10 exclude-result-prefixes="marc items str">
11 <xsl:import href="MARC21slimUtils.xsl"/>
12 <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14 <xsl:template match="/">
15 <xsl:apply-templates/>
16 </xsl:template>
18 <xsl:template match="marc:record">
20 <!-- Option: Display Alternate Graphic Representation (MARC 880) -->
21 <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
23 <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
24 <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
25 <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
26 <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
28 <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
29 <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
30 <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
31 <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/>
32 <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/>
33 <xsl:variable name="theme" select="marc:sysprefs/marc:syspref[@name='opacthemes']"/>
34 <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
35 <xsl:variable name="TracingQuotesLeft">
36 <xsl:choose>
37 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
38 <xsl:otherwise>"</xsl:otherwise>
39 </xsl:choose>
40 </xsl:variable>
41 <xsl:variable name="TracingQuotesRight">
42 <xsl:choose>
43 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
44 <xsl:otherwise>"</xsl:otherwise>
45 </xsl:choose>
46 </xsl:variable>
47 <xsl:variable name="leader" select="marc:leader"/>
48 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
49 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
50 <xsl:variable name="leader19" select="substring($leader,20,1)"/>
51 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
52 <xsl:variable name="materialTypeCode">
53 <xsl:choose>
54 <xsl:when test="$leader19='a'">ST</xsl:when>
55 <xsl:when test="$leader6='a'">
56 <xsl:choose>
57 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
58 <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
59 <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
60 </xsl:choose>
61 </xsl:when>
62 <xsl:when test="$leader6='t'">BK</xsl:when>
63 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
64 <xsl:when test="$leader6='m'">CF</xsl:when>
65 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
66 <xsl:when test="$leader6='g'">VM</xsl:when>
67 <xsl:when test="$leader6='k'">PK</xsl:when>
68 <xsl:when test="$leader6='r'">OB</xsl:when>
69 <xsl:when test="$leader6='i'">SO</xsl:when>
70 <xsl:when test="$leader6='j'">MU</xsl:when>
71 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
72 </xsl:choose>
73 </xsl:variable>
74 <xsl:variable name="materialTypeLabel">
75 <xsl:choose>
76 <xsl:when test="$leader19='a'">Set</xsl:when>
77 <xsl:when test="$leader6='a'">
78 <xsl:choose>
79 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Text</xsl:when>
80 <xsl:when test="$leader7='i' or $leader7='s'">
81 <xsl:choose>
82 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing resource</xsl:when>
83 <xsl:otherwise>Series</xsl:otherwise>
84 </xsl:choose>
85 </xsl:when>
86 <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
87 </xsl:choose>
88 </xsl:when>
89 <xsl:when test="$leader6='t'">Text</xsl:when>
90 <xsl:when test="$leader6='o'">Kit</xsl:when>
91 <xsl:when test="$leader6='p'">Mixed materials</xsl:when>
92 <xsl:when test="$leader6='m'">Computer file</xsl:when>
93 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
94 <xsl:when test="$leader6='g'">Film</xsl:when>
95 <xsl:when test="$leader6='k'">Picture</xsl:when>
96 <xsl:when test="$leader6='r'">Object</xsl:when>
97 <xsl:when test="$leader6='j'">Music</xsl:when>
98 <xsl:when test="$leader6='i'">Sound</xsl:when>
99 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
100 </xsl:choose>
101 </xsl:variable>
103 <!-- Schema.org type -->
104 <xsl:variable name="schemaOrgType">
105 <xsl:choose>
106 <xsl:when test="$materialTypeLabel='Book'">Book</xsl:when>
107 <xsl:when test="$materialTypeLabel='Map'">Map</xsl:when>
108 <xsl:when test="$materialTypeLabel='Music'">MusicAlbum</xsl:when>
109 <xsl:otherwise>CreativeWork</xsl:otherwise>
110 </xsl:choose>
111 </xsl:variable>
113 <!-- Wrapper div for our schema.org object -->
114 <xsl:element name="div">
115 <xsl:attribute name="class"><xsl:value-of select="'record'" /></xsl:attribute>
116 <xsl:attribute name="vocab">http://schema.org/</xsl:attribute>
117 <xsl:attribute name="typeof"><xsl:value-of select='$schemaOrgType' /> Product</xsl:attribute>
118 <xsl:attribute name="resource">#record</xsl:attribute>
120 <!-- Title Statement -->
121 <!-- Alternate Graphic Representation (MARC 880) -->
122 <xsl:if test="$display880">
123 <h1 class="title" property="alternateName">
124 <xsl:call-template name="m880Select">
125 <xsl:with-param name="basetags">245</xsl:with-param>
126 <xsl:with-param name="codes">abhfgknps</xsl:with-param>
127 </xsl:call-template>
128 </h1>
129 </xsl:if>
131 <!--Bug 13381 -->
132 <xsl:if test="marc:datafield[@tag=245]">
133 <h1 class="title" property="name">
134 <xsl:for-each select="marc:datafield[@tag=245]">
135 <xsl:call-template name="subfieldSelect">
136 <xsl:with-param name="codes">a</xsl:with-param>
137 </xsl:call-template>
138 <xsl:text> </xsl:text>
139 <!-- 13381 add additional subfields-->
140 <!-- bug17625 adding f and g subfields -->
141 <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
142 <xsl:choose>
143 <xsl:when test="@code='h'">
144 <!-- 13381 Span class around subfield h so it can be suppressed via css -->
145 <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
146 </xsl:when>
147 <xsl:when test="@code='c'">
148 <!-- 13381 Span class around subfield c so it can be suppressed via css -->
149 <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
150 </xsl:when>
151 <xsl:otherwise>
152 <xsl:apply-templates/>
153 <xsl:text> </xsl:text>
154 </xsl:otherwise>
155 </xsl:choose>
156 </xsl:for-each>
157 </xsl:for-each>
158 </h1>
159 </xsl:if>
162 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
163 <xsl:if test="$display880">
164 <h5 class="author">
165 <xsl:call-template name="m880Select">
166 <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
167 <xsl:with-param name="codes">abc</xsl:with-param>
168 <xsl:with-param name="index">au</xsl:with-param>
169 <!-- do not use label 'by ' here, it would be repeated for every occurrence of 100,110,111,700,710,711 -->
170 </xsl:call-template>
171 </h5>
172 </xsl:if>
174 <!--#13382 Added Author Statement to separate Authors and Contributors -->
175 <xsl:call-template name="showAuthor">
176 <xsl:with-param name="authorfield" select="marc:datafield[(@tag=100 or @tag=110 or @tag=111)]"/>
177 <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
178 <xsl:with-param name="materialTypeLabel" select="$materialTypeLabel"/>
179 <xsl:with-param name="theme" select="$theme"/>
180 </xsl:call-template>
182 <xsl:call-template name="showAuthor">
183 <!-- #13382 suppress 700$i and 7xx/@ind2=2 -->
184 <xsl:with-param name="authorfield" select="marc:datafield[(@tag=700 or @tag=710 or @tag=711) and not(@ind2=2) and not(marc:subfield[@code='i'])]"/>
185 <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
186 <xsl:with-param name="materialTypeLabel" select="$materialTypeLabel"/>
187 <xsl:with-param name="theme" select="$theme"/>
188 </xsl:call-template>
190 <xsl:if test="$DisplayOPACiconsXSLT!='0'">
191 <xsl:if test="$materialTypeCode!=''">
192 <span class="results_summary type"><span class="label">Material type: </span>
193 <xsl:element name="img">
194 <xsl:attribute name="src">/opac-tmpl/lib/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute>
195 <xsl:attribute name="alt"><xsl:value-of select="$materialTypeLabel"/></xsl:attribute>
196 <xsl:attribute name="class">materialtype mt_icon_<xsl:value-of select="$materialTypeCode"/></xsl:attribute>
197 </xsl:element>
198 <xsl:value-of select="$materialTypeLabel"/>
199 </span>
200 </xsl:if>
201 </xsl:if>
203 <!--Series: Alternate Graphic Representation (MARC 880) -->
204 <xsl:if test="$display880">
205 <xsl:call-template name="m880Select">
206 <xsl:with-param name="basetags">440,490</xsl:with-param>
207 <xsl:with-param name="codes">av</xsl:with-param>
208 <xsl:with-param name="class">results_summary series</xsl:with-param>
209 <xsl:with-param name="label">Series: </xsl:with-param>
210 <xsl:with-param name="index">se</xsl:with-param>
211 </xsl:call-template>
212 </xsl:if>
214 <!-- Series -->
215 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
216 <span class="results_summary series"><span class="label">Series: </span>
217 <!-- 440 -->
218 <xsl:for-each select="marc:datafield[@tag=440]">
219 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
220 <xsl:call-template name="chopPunctuation">
221 <xsl:with-param name="chopString">
222 <xsl:call-template name="subfieldSelect">
223 <xsl:with-param name="codes">av</xsl:with-param>
224 </xsl:call-template>
225 </xsl:with-param>
226 </xsl:call-template>
227 </a>
228 <xsl:call-template name="part"/>
229 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
230 </xsl:for-each>
232 <!-- 490 Series not traced, Ind1 = 0 -->
233 <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
234 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
235 <xsl:call-template name="chopPunctuation">
236 <xsl:with-param name="chopString">
237 <xsl:call-template name="subfieldSelect">
238 <xsl:with-param name="codes">av</xsl:with-param>
239 </xsl:call-template>
240 </xsl:with-param>
241 </xsl:call-template>
242 </a>
243 <xsl:call-template name="part"/>
244 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
245 </xsl:for-each>
246 <!-- 490 Series traced, Ind1 = 1 -->
247 <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
248 <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811]">
249 <xsl:choose>
250 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
251 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute>
252 <xsl:call-template name="chopPunctuation">
253 <xsl:with-param name="chopString">
254 <xsl:call-template name="subfieldSelect">
255 <xsl:with-param name="codes">a_t</xsl:with-param>
256 </xsl:call-template>
257 </xsl:with-param>
258 </xsl:call-template>
259 </a>
260 </xsl:when>
261 <xsl:otherwise>
262 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())"/>"&amp;q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
263 <xsl:call-template name="chopPunctuation">
264 <xsl:with-param name="chopString">
265 <xsl:call-template name="subfieldSelect">
266 <xsl:with-param name="codes">a_t</xsl:with-param>
267 </xsl:call-template>
268 </xsl:with-param>
269 </xsl:call-template>
270 </a>
271 <xsl:call-template name="part"/>
272 </xsl:otherwise>
273 </xsl:choose>
274 <xsl:text>: </xsl:text>
275 <xsl:value-of select="marc:subfield[@code='v']" />
276 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
277 </xsl:for-each>
278 <xsl:for-each select="marc:datafield[@tag=830]">
279 <xsl:choose>
280 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
281 <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
282 <xsl:call-template name="chopPunctuation">
283 <xsl:with-param name="chopString">
284 <xsl:call-template name="subfieldSelect">
285 <xsl:with-param name="codes">a_t</xsl:with-param>
286 </xsl:call-template>
287 </xsl:with-param>
288 </xsl:call-template>
289 </a>
290 </xsl:when>
291 <xsl:otherwise>
292 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
293 <xsl:call-template name="chopPunctuation">
294 <xsl:with-param name="chopString">
295 <xsl:call-template name="subfieldSelect">
296 <xsl:with-param name="codes">a_t</xsl:with-param>
297 </xsl:call-template>
298 </xsl:with-param>
299 </xsl:call-template>
300 </a>
301 <xsl:call-template name="part"/>
302 </xsl:otherwise>
303 </xsl:choose>
304 <xsl:text>: </xsl:text>
305 <xsl:value-of select="marc:subfield[@code='v']" />
306 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
307 </xsl:for-each>
308 </xsl:if>
309 </span>
310 </xsl:if>
312 <!-- Analytics -->
313 <xsl:if test="$leader7='s'">
314 <span class="results_summary analytics"><span class="label">Analytics: </span>
316 <xsl:choose>
317 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
318 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
319 </xsl:when>
320 <xsl:otherwise>
321 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
322 </xsl:otherwise>
323 </xsl:choose>
324 <xsl:text>Show analytics</xsl:text>
325 </a>
326 </span>
327 </xsl:if>
329 <!-- Volumes of sets and traced series -->
330 <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
331 <span class="results_summary volumes"><span class="label">Volumes: </span>
333 <xsl:choose>
334 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
335 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute>
336 </xsl:when>
337 <xsl:otherwise>
338 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
339 </xsl:otherwise>
340 </xsl:choose>
341 <xsl:text>Show volumes</xsl:text>
342 </a>
343 </span>
344 </xsl:if>
346 <!-- Set -->
347 <xsl:if test="$leader19='c'">
348 <span class="results_summary set"><span class="label">Set: </span>
349 <xsl:for-each select="marc:datafield[@tag=773]">
351 <xsl:choose>
352 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
353 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
354 </xsl:when>
355 <xsl:otherwise>
356 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', ''), true())"/></xsl:attribute>
357 </xsl:otherwise>
358 </xsl:choose>
359 <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
360 </a>
361 <xsl:choose>
362 <xsl:when test="position()=last()"></xsl:when>
363 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
364 </xsl:choose>
365 </xsl:for-each>
366 </span>
367 </xsl:if>
369 <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
370 <xsl:if test="$display880">
371 <xsl:call-template name="m880Select">
372 <xsl:with-param name="basetags">260</xsl:with-param>
373 <xsl:with-param name="codes">abcg</xsl:with-param>
374 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
375 <xsl:with-param name="label">Publisher: </xsl:with-param>
376 </xsl:call-template>
377 </xsl:if>
379 <!-- Publisher info and RDA related info from tags 260, 264 -->
380 <xsl:choose>
381 <xsl:when test="marc:datafield[@tag=264]">
382 <xsl:call-template name="showRDAtag264">
383 <xsl:with-param name="show_url">1</xsl:with-param>
384 </xsl:call-template>
385 </xsl:when>
386 <xsl:when test="marc:datafield[@tag=260]">
387 <span class="results_summary publisher"><span class="label">Publisher: </span>
388 <xsl:for-each select="marc:datafield[@tag=260]">
389 <span property="publisher" typeof="Organization">
390 <xsl:if test="marc:subfield[@code='a']">
391 <span property="location">
392 <xsl:call-template name="subfieldSelect">
393 <xsl:with-param name="codes">a</xsl:with-param>
394 </xsl:call-template>
395 </span>
396 </xsl:if>
397 <xsl:text> </xsl:text>
398 <xsl:if test="marc:subfield[@code='b']">
399 <span property="name"><a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri(marc:subfield[@code='b'], true())"/></xsl:attribute>
400 <xsl:call-template name="subfieldSelect">
401 <xsl:with-param name="codes">b</xsl:with-param>
402 </xsl:call-template>
403 </a></span>
404 </xsl:if>
405 </span>
406 <xsl:text> </xsl:text>
407 <xsl:if test="marc:subfield[@code='c' or @code='g']">
408 <span property="datePublished">
409 <xsl:call-template name="chopPunctuation">
410 <xsl:with-param name="chopString">
411 <xsl:call-template name="subfieldSelect">
412 <xsl:with-param name="codes">cg</xsl:with-param>
413 </xsl:call-template>
414 </xsl:with-param>
415 </xsl:call-template>
416 </span>
417 </xsl:if>
418 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
419 </xsl:for-each>
420 </span>
421 </xsl:when>
422 </xsl:choose>
424 <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
425 <xsl:if test="$display880">
426 <xsl:call-template name="m880Select">
427 <xsl:with-param name="basetags">250</xsl:with-param>
428 <xsl:with-param name="codes">ab</xsl:with-param>
429 <xsl:with-param name="class">results_summary edition</xsl:with-param>
430 <xsl:with-param name="label">Edition: </xsl:with-param>
431 </xsl:call-template>
432 </xsl:if>
434 <xsl:if test="marc:datafield[@tag=250]">
435 <span class="results_summary edition"><span class="label">Edition: </span>
436 <xsl:for-each select="marc:datafield[@tag=250]">
437 <span property="bookEdition">
438 <xsl:call-template name="chopPunctuation">
439 <xsl:with-param name="chopString">
440 <xsl:call-template name="subfieldSelect">
441 <xsl:with-param name="codes">ab</xsl:with-param>
442 </xsl:call-template>
443 </xsl:with-param>
444 </xsl:call-template>
445 </span>
446 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
447 </xsl:for-each>
448 </span>
449 </xsl:if>
451 <!-- Description: Alternate Graphic Representation (MARC 880) -->
452 <xsl:if test="$display880">
453 <xsl:call-template name="m880Select">
454 <xsl:with-param name="basetags">300</xsl:with-param>
455 <xsl:with-param name="codes">abceg</xsl:with-param>
456 <xsl:with-param name="class">results_summary description</xsl:with-param>
457 <xsl:with-param name="label">Description: </xsl:with-param>
458 </xsl:call-template>
459 </xsl:if>
461 <xsl:if test="marc:datafield[@tag=300]">
462 <span class="results_summary description"><span class="label">Description: </span>
463 <xsl:for-each select="marc:datafield[@tag=300]">
464 <span property="description">
465 <xsl:call-template name="chopPunctuation">
466 <xsl:with-param name="chopString">
467 <xsl:call-template name="subfieldSelect">
468 <xsl:with-param name="codes">abcefg</xsl:with-param>
469 </xsl:call-template>
470 </xsl:with-param>
471 </xsl:call-template>
472 </span>
473 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
474 </xsl:for-each>
475 </span>
476 </xsl:if>
479 <!-- Content Type -->
480 <xsl:if test="marc:datafield[@tag=336] or marc:datafield[@tag=337] or marc:datafield[@tag=338]">
481 <span class="results_summary" id="content_type">
482 <xsl:if test="marc:datafield[@tag=336]">
483 <span class="label">Content type: </span>
484 <xsl:for-each select="marc:datafield[@tag=336]">
485 <xsl:call-template name="subfieldSelect">
486 <xsl:with-param name="codes">a</xsl:with-param>
487 <xsl:with-param name="delimeter">, </xsl:with-param>
488 </xsl:call-template>
489 <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
490 </xsl:for-each>
491 </xsl:if>
492 <xsl:text> </xsl:text>
493 <!-- Media Type -->
494 <xsl:if test="marc:datafield[@tag=337]">
495 <span class="label">Media type: </span>
496 <xsl:for-each select="marc:datafield[@tag=337]">
497 <xsl:call-template name="subfieldSelect">
498 <xsl:with-param name="codes">a</xsl:with-param>
499 <xsl:with-param name="delimeter">, </xsl:with-param>
500 </xsl:call-template>
501 <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
502 </xsl:for-each>
503 </xsl:if>
504 <xsl:text> </xsl:text>
505 <!-- Media Type -->
506 <xsl:if test="marc:datafield[@tag=338]">
507 <span class="label">Carrier type: </span>
508 <xsl:for-each select="marc:datafield[@tag=338]">
509 <xsl:call-template name="subfieldSelect">
510 <xsl:with-param name="codes">a</xsl:with-param>
511 <xsl:with-param name="delimeter">, </xsl:with-param>
512 </xsl:call-template>
513 <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
514 </xsl:for-each>
515 </xsl:if>
516 </span>
517 </xsl:if>
521 <xsl:if test="marc:datafield[@tag=020]/marc:subfield[@code='a']">
522 <span class="results_summary isbn"><span class="label">ISBN: </span>
523 <xsl:for-each select="marc:datafield[@tag=020]/marc:subfield[@code='a']">
524 <span property="isbn">
525 <xsl:value-of select="."/>
526 <xsl:choose>
527 <xsl:when test="position()=last()">
528 <xsl:text>.</xsl:text>
529 </xsl:when>
530 <xsl:otherwise>
531 <xsl:text>; </xsl:text>
532 </xsl:otherwise>
533 </xsl:choose>
534 </span>
535 </xsl:for-each>
536 </span>
537 </xsl:if>
539 <!-- Build ISSN -->
540 <xsl:if test="marc:datafield[@tag=022]/marc:subfield[@code='a']">
541 <span class="results_summary issn"><span class="label">ISSN: </span>
542 <xsl:for-each select="marc:datafield[@tag=022]/marc:subfield[@code='a']">
543 <span property="issn">
544 <xsl:value-of select="."/>
545 <xsl:choose>
546 <xsl:when test="position()=last()">
547 <xsl:text>.</xsl:text>
548 </xsl:when>
549 <xsl:otherwise>
550 <xsl:text>; </xsl:text>
551 </xsl:otherwise>
552 </xsl:choose>
553 </span>
554 </xsl:for-each>
555 </span>
556 </xsl:if>
558 <xsl:if test="marc:datafield[@tag=013]">
559 <span class="results_summary patent_info">
560 <span class="label">Patent information: </span>
561 <xsl:for-each select="marc:datafield[@tag=013]">
562 <xsl:call-template name="subfieldSelect">
563 <xsl:with-param name="codes">acdef</xsl:with-param>
564 <xsl:with-param name="delimeter">, </xsl:with-param>
565 </xsl:call-template>
566 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
567 </xsl:for-each>
568 </span>
569 </xsl:if>
571 <xsl:if test="marc:datafield[@tag=088]">
572 <span class="results_summary report_number">
573 <span class="label">Report number: </span>
574 <xsl:for-each select="marc:datafield[@tag=088]">
575 <xsl:call-template name="subfieldSelect">
576 <xsl:with-param name="codes">a</xsl:with-param>
577 </xsl:call-template>
578 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
579 </xsl:for-each>
580 </span>
581 </xsl:if>
583 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
584 <xsl:if test="$display880">
585 <xsl:call-template name="m880Select">
586 <xsl:with-param name="basetags">246</xsl:with-param>
587 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
588 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
589 <xsl:with-param name="label">Other title: </xsl:with-param>
590 </xsl:call-template>
591 </xsl:if>
593 <xsl:if test="marc:datafield[@tag=246]">
594 <span class="results_summary other_title"><span class="label">Other title: </span>
595 <xsl:for-each select="marc:datafield[@tag=246]">
596 <span property="alternateName">
597 <xsl:call-template name="chopPunctuation">
598 <xsl:with-param name="chopString">
599 <xsl:call-template name="subfieldSelect">
600 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
601 </xsl:call-template>
602 </xsl:with-param>
603 </xsl:call-template>
604 <xsl:if test="@ind1=1 and not(marc:subfield[@code='i'])">
605 <xsl:choose>
606 <xsl:when test="@ind2=0"> [Portion of title]</xsl:when>
607 <xsl:when test="@ind2=1"> [Parallel title]</xsl:when>
608 <xsl:when test="@ind2=2"> [Distinctive title]</xsl:when>
609 <xsl:when test="@ind2=3"> [Other title]</xsl:when>
610 <xsl:when test="@ind2=4"> [Cover title]</xsl:when>
611 <xsl:when test="@ind2=5"> [Added title page title]</xsl:when>
612 <xsl:when test="@ind2=6"> [Caption title]</xsl:when>
613 <xsl:when test="@ind2=7"> [Running title]</xsl:when>
614 <xsl:when test="@ind2=8"> [Spine title]</xsl:when>
615 </xsl:choose>
616 </xsl:if>
617 <xsl:if test="marc:subfield[@code='i']">
618 <xsl:value-of select="concat(' [',marc:subfield[@code='i'],']')"/>
619 </xsl:if>
620 </span>
621 <!-- #13386 added separator | -->
622 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise></xsl:choose>
623 </xsl:for-each>
624 </span>
625 </xsl:if>
628 <xsl:if test="marc:datafield[@tag=242]">
629 <span class="results_summary translated_title"><span class="label">Title translated: </span>
630 <xsl:for-each select="marc:datafield[@tag=242]">
631 <span property="alternateName">
632 <xsl:call-template name="chopPunctuation">
633 <xsl:with-param name="chopString">
634 <xsl:call-template name="subfieldSelect">
635 <xsl:with-param name="codes">abchnp</xsl:with-param>
636 </xsl:call-template>
637 </xsl:with-param>
638 </xsl:call-template>
639 </span>
640 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
641 </xsl:for-each>
642 </span>
643 </xsl:if>
645 <!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
646 <xsl:if test="$display880">
647 <span property="alternateName">
648 <xsl:call-template name="m880Select">
649 <xsl:with-param name="basetags">130,240</xsl:with-param>
650 <xsl:with-param name="codes">adfklmor</xsl:with-param>
651 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
652 <xsl:with-param name="label">Uniform titles: </xsl:with-param>
653 </xsl:call-template>
654 </span>
655 </xsl:if>
657 <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
658 <span class="results_summary uniform_titles"><span class="label">Uniform titles: </span>
659 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
660 <span property="alternateName">
661 <xsl:for-each select="marc:subfield">
662 <xsl:if test="contains('adfghklmnoprst',@code)">
663 <xsl:value-of select="text()"/>
664 <xsl:text> </xsl:text>
665 </xsl:if>
666 </xsl:for-each>
667 </span>
668 <xsl:if test="position() != last()">
669 <span class="separator"><xsl:text> | </xsl:text></span>
670 </xsl:if>
671 </xsl:for-each>
672 </span>
673 </xsl:if>
676 <!-- #13382 Added Related works 700$i -->
677 <xsl:if test="marc:datafield[@tag=700][marc:subfield[@code='i']] or marc:datafield[@tag=710][marc:subfield[@code='i']] or marc:datafield[@tag=711][marc:subfield[@code='i']]">
678 <span class="results_summary related_works"><span class="label">Related works: </span>
679 <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='i']] | marc:datafield[@tag=710][marc:subfield[@code='i']] | marc:datafield[@tag=711][marc:subfield[@code='i']]">
680 <xsl:variable name="str">
681 <xsl:call-template name="subfieldSelect">
682 <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
683 </xsl:call-template>
684 </xsl:variable>
685 <xsl:call-template name="chopPunctuation">
686 <xsl:with-param name="chopString">
687 <xsl:value-of select="$str"/>
688 </xsl:with-param>
689 </xsl:call-template>
690 <!-- add relator code too between brackets-->
691 <xsl:if test="marc:subfield[@code='4' or @code='e']">
692 <span class="relatorcode">
693 <xsl:text> [</xsl:text>
694 <xsl:choose>
695 <xsl:when test="marc:subfield[@code='e']">
696 <xsl:for-each select="marc:subfield[@code='e']">
697 <xsl:value-of select="."/>
698 <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
699 </xsl:for-each>
700 </xsl:when>
701 <xsl:otherwise>
702 <xsl:for-each select="marc:subfield[@code='4']">
703 <xsl:value-of select="."/>
704 <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
705 </xsl:for-each>
706 </xsl:otherwise>
707 </xsl:choose>
708 <xsl:text>]</xsl:text>
709 </span>
710 </xsl:if>
711 <xsl:choose>
712 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
713 </xsl:choose>
714 </xsl:for-each>
715 </span>
716 </xsl:if>
718 <!-- #13382 Added Contained Works 7xx@ind2=2 -->
719 <xsl:if test="marc:datafield[@tag=700][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=710][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=711][@ind2=2 and not(marc:subfield[@code='i'])]">
720 <span class="results_summary contained_works"><span class="label">Contained works: </span>
721 <xsl:for-each select="marc:datafield[@tag=700][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=710][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=711][@ind2=2][not(marc:subfield[@code='i'])]">
722 <xsl:variable name="str">
723 <xsl:call-template name="subfieldSelect">
724 <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
725 </xsl:call-template>
726 </xsl:variable>
727 <xsl:call-template name="chopPunctuation">
728 <xsl:with-param name="chopString">
729 <xsl:value-of select="$str"/>
730 </xsl:with-param>
731 </xsl:call-template>
732 <!-- add relator code too between brackets-->
733 <xsl:if test="marc:subfield[@code='4' or @code='e']">
734 <span class="relatorcode">
735 <xsl:text> [</xsl:text>
736 <xsl:choose>
737 <xsl:when test="marc:subfield[@code='e']">
738 <xsl:for-each select="marc:subfield[@code='e']">
739 <xsl:value-of select="."/>
740 <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
741 </xsl:for-each>
742 </xsl:when>
743 <xsl:otherwise>
744 <xsl:for-each select="marc:subfield[@code='4']">
745 <xsl:value-of select="."/>
746 <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
747 </xsl:for-each>
748 </xsl:otherwise>
749 </xsl:choose>
750 <xsl:text>]</xsl:text>
751 </span>
752 </xsl:if>
753 <xsl:choose>
754 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
755 </xsl:choose>
756 </xsl:for-each>
757 </span>
758 </xsl:if>
760 <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6' and not(@tag=655)]">
761 <span class="results_summary subjects"><span class="label">Subject(s): </span>
762 <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6'][not(@tag=655)]">
763 <span property="keywords">
765 <xsl:choose>
766 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
767 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
768 </xsl:when>
769 <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
770 <xsl:when test="$TraceSubjectSubdivisions='1'">
771 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelectSubject">
772 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
773 <xsl:with-param name="delimeter"> AND </xsl:with-param>
774 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
775 <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
776 <xsl:with-param name="urlencode">1</xsl:with-param>
777 </xsl:call-template>
778 </xsl:attribute>
779 </xsl:when>
780 <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
781 <xsl:otherwise>
782 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='a'],'()',''), true())"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
783 </xsl:otherwise>
784 </xsl:choose>
785 <xsl:call-template name="chopPunctuation">
786 <xsl:with-param name="chopString">
787 <xsl:call-template name="subfieldSelect">
788 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
789 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
790 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
791 </xsl:call-template>
792 </xsl:with-param>
793 </xsl:call-template>
794 </a>
795 </span>
796 <xsl:if test="marc:subfield[@code=9]">
797 <a class='authlink'>
798 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
799 <xsl:element name="img">
800 <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute>
801 <xsl:attribute name="style">vertical-align:middle</xsl:attribute>
802 <xsl:attribute name="height">15</xsl:attribute>
803 <xsl:attribute name="width">15</xsl:attribute>
804 </xsl:element>
805 </a>
806 </xsl:if>
807 <xsl:choose>
808 <xsl:when test="position()=last()"></xsl:when>
809 <xsl:otherwise> | </xsl:otherwise>
810 </xsl:choose>
812 </xsl:for-each>
813 </span>
814 </xsl:if>
816 <!-- Genre/Form -->
817 <xsl:if test="marc:datafield[@tag=655]">
818 <span class="results_summary genre"><span class="label">Genre/Form: </span>
819 <xsl:for-each select="marc:datafield[@tag=655]">
821 <xsl:choose>
822 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
823 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
824 </xsl:when>
825 <xsl:when test="$TraceSubjectSubdivisions='1'">
826 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelectSubject">
827 <xsl:with-param name="codes">avxyz</xsl:with-param>
828 <xsl:with-param name="delimeter"> AND </xsl:with-param>
829 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
830 <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
831 <xsl:with-param name="urlencode">1</xsl:with-param>
832 </xsl:call-template>
833 </xsl:attribute>
834 </xsl:when>
835 <xsl:otherwise>
836 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
837 </xsl:otherwise>
838 </xsl:choose>
839 <xsl:call-template name="subfieldSelect">
840 <xsl:with-param name="codes">avxyz</xsl:with-param>
841 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
842 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
843 </xsl:call-template>
844 </a>
845 <xsl:if test="marc:subfield[@code=9]">
846 <xsl:text> </xsl:text>
847 <a class='authlink'>
848 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
849 <xsl:element name="img">
850 <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute>
851 <xsl:attribute name="alt"></xsl:attribute>
852 <xsl:attribute name="height">15</xsl:attribute>
853 <xsl:attribute name="width">15</xsl:attribute>
854 </xsl:element>
855 </a>
856 </xsl:if>
857 <xsl:if test="position()!=last()"><span class="separator"> | </span></xsl:if>
858 </xsl:for-each>
859 </span>
860 </xsl:if>
862 <!-- MARC21 776 Additional Physical Form Entry -->
863 <xsl:if test="marc:datafield[@tag=776]">
864 <span class="results_summary add_physical_form">
865 <span class="label">Additional physical formats: </span>
866 <xsl:for-each select="marc:datafield[@tag=776]">
867 <xsl:variable name="linktext">
868 <xsl:choose>
869 <xsl:when test="marc:subfield[@code='t']">
870 <xsl:value-of select="marc:subfield[@code='t']"/>
871 </xsl:when>
872 <xsl:when test="marc:subfield[@code='a']">
873 <xsl:value-of select="marc:subfield[@code='a']"/>
874 </xsl:when>
875 <xsl:otherwise>
876 <xsl:text>No title</xsl:text>
877 </xsl:otherwise>
878 </xsl:choose>
879 </xsl:variable>
880 <xsl:if test="@ind2=8 and marc:subfield[@code='i']">
881 <xsl:call-template name="subfieldSelect">
882 <xsl:with-param name="codes">i</xsl:with-param>
883 </xsl:call-template>
884 <xsl:text>: </xsl:text>
885 </xsl:if>
886 <xsl:choose>
887 <xsl:when test="marc:subfield[@code='w']">
889 <xsl:attribute name="href">
890 <xsl:text>/cgi-bin/koha/opac-search.pl?q=control-number:</xsl:text>
891 <xsl:call-template name="extractControlNumber">
892 <xsl:with-param name="subfieldW">
893 <xsl:value-of select="marc:subfield[@code='w']"/>
894 </xsl:with-param>
895 </xsl:call-template>
896 </xsl:attribute>
897 <xsl:value-of select="$linktext"/>
898 </a>
899 </xsl:when>
900 <xsl:otherwise>
901 <xsl:value-of select="$linktext"/>
902 </xsl:otherwise>
903 </xsl:choose>
904 <xsl:if test="position() != last()">
905 <xsl:text>; </xsl:text>
906 </xsl:if>
907 </xsl:for-each>
908 </span>
909 </xsl:if>
911 <!-- DDC classification -->
912 <xsl:if test="marc:datafield[@tag=082]">
913 <span class="results_summary ddc">
914 <span class="label">DDC classification: </span>
915 <xsl:for-each select="marc:datafield[@tag=082]">
916 <xsl:call-template name="subfieldSelect">
917 <xsl:with-param name="codes">a</xsl:with-param>
918 <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
919 </xsl:call-template>
920 <xsl:choose>
921 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
922 <xsl:otherwise> | </xsl:otherwise>
923 </xsl:choose>
924 </xsl:for-each>
925 </span>
926 </xsl:if>
928 <!-- Other classification -->
929 <xsl:if test="marc:datafield[@tag=084]">
930 <span class="results_summary oc">
931 <span class="label">Other classification: </span>
932 <xsl:for-each select="marc:datafield[@tag=084]">
933 <xsl:call-template name="subfieldSelect">
934 <xsl:with-param name="codes">a</xsl:with-param>
935 <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
936 </xsl:call-template>
937 <xsl:choose>
938 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
939 <xsl:otherwise> | </xsl:otherwise>
940 </xsl:choose>
941 </xsl:for-each>
942 </span>
943 </xsl:if>
946 <!-- Image processing code added here, takes precedence over text links including y3z text -->
947 <xsl:if test="marc:datafield[@tag=856]">
948 <span class="results_summary online_resources"><span class="label">Online resources: </span>
949 <xsl:for-each select="marc:datafield[@tag=856]">
950 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
951 <a property="url">
952 <xsl:choose>
953 <xsl:when test="$OPACTrackClicks='track'">
954 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&amp;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
955 </xsl:when>
956 <xsl:when test="$OPACTrackClicks='anonymous'">
957 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&amp;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
958 </xsl:when>
959 <xsl:otherwise>
960 <xsl:attribute name="href">
961 <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))">
962 <xsl:choose>
963 <xsl:when test="@ind1=7">
964 <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text>
965 </xsl:when>
966 <xsl:when test="@ind1=1">
967 <xsl:text>ftp://</xsl:text>
968 </xsl:when>
969 <xsl:otherwise>
970 <xsl:text>http://</xsl:text>
971 </xsl:otherwise>
972 </xsl:choose>
973 </xsl:if>
974 <xsl:value-of select="marc:subfield[@code='u']"/>
975 </xsl:attribute>
976 </xsl:otherwise>
977 </xsl:choose>
978 <xsl:if test="$OPACURLOpenInNewWindow='1'">
979 <xsl:attribute name="target">_blank</xsl:attribute>
980 </xsl:if>
981 <xsl:choose>
982 <xsl:when test="($Show856uAsImage='Details' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')">
983 <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="style">height:100px</xsl:attribute></xsl:element><xsl:text></xsl:text>
984 </xsl:when>
985 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
986 <xsl:call-template name="subfieldSelect">
987 <xsl:with-param name="codes">y3z</xsl:with-param>
988 </xsl:call-template>
989 </xsl:when>
990 <xsl:when test="$URLLinkText!=''">
991 <xsl:value-of select="$URLLinkText"/>
992 </xsl:when>
993 <xsl:otherwise>
994 <xsl:text>Click here to access online</xsl:text>
995 </xsl:otherwise>
996 </xsl:choose>
997 </a>
998 <xsl:choose>
999 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
1000 <xsl:otherwise> | </xsl:otherwise>
1001 </xsl:choose>
1002 </xsl:for-each>
1003 </span>
1004 </xsl:if>
1006 <!-- 530 -->
1007 <xsl:if test="marc:datafield[@tag=530]">
1008 <xsl:for-each select="marc:datafield[@tag=530]">
1009 <span class="results_summary additionalforms">
1010 <xsl:call-template name="subfieldSelect">
1011 <xsl:with-param name="codes">abcd</xsl:with-param>
1012 </xsl:call-template>
1013 <xsl:for-each select="marc:subfield[@code='u']">
1014 <a><xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
1015 <xsl:if test="$OPACURLOpenInNewWindow='1'">
1016 <xsl:attribute name="target">_blank</xsl:attribute>
1017 </xsl:if>
1018 <xsl:value-of select="text()"/>
1019 </a>
1020 </xsl:for-each>
1021 </span>
1022 </xsl:for-each>
1023 </xsl:if>
1025 <!-- 505 -->
1026 <xsl:if test="marc:datafield[@tag=505]">
1027 <div class="results_summary contents">
1028 <xsl:for-each select="marc:datafield[@tag=505]">
1029 <xsl:if test="position()=1">
1030 <xsl:choose>
1031 <xsl:when test="@ind1=1">
1032 <span class="label">Incomplete contents:</span>
1033 </xsl:when>
1034 <xsl:when test="@ind1=2">
1035 <span class="label">Partial contents:</span>
1036 </xsl:when>
1037 <xsl:otherwise>
1038 <span class="label">Contents:</span>
1039 </xsl:otherwise>
1040 </xsl:choose>
1041 </xsl:if>
1042 <div class='contentblock' property='description'>
1043 <xsl:choose>
1044 <xsl:when test="@ind2=0">
1045 <xsl:call-template name="subfieldSelectSpan">
1046 <xsl:with-param name="codes">tru</xsl:with-param>
1047 </xsl:call-template>
1048 </xsl:when>
1049 <xsl:otherwise>
1050 <xsl:call-template name="subfieldSelectSpan">
1051 <xsl:with-param name="codes">atru</xsl:with-param>
1052 </xsl:call-template>
1053 </xsl:otherwise>
1054 </xsl:choose>
1055 </div>
1056 </xsl:for-each>
1057 </div>
1058 </xsl:if>
1060 <!-- 583 -->
1061 <xsl:if test="marc:datafield[@tag=583]">
1062 <xsl:for-each select="marc:datafield[@tag=583]">
1063 <xsl:if test="@ind1=1 or @ind1=' '">
1064 <span class="results_summary actionnote">
1065 <span class="label">Action note: </span>
1066 <xsl:choose>
1067 <xsl:when test="marc:subfield[@code='z']">
1068 <xsl:value-of select="marc:subfield[@code='z']"/>
1069 </xsl:when>
1070 <xsl:otherwise>
1071 <xsl:call-template name="subfieldSelect">
1072 <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param>
1073 </xsl:call-template>
1074 </xsl:otherwise>
1075 </xsl:choose>
1076 </span>
1077 </xsl:if>
1078 </xsl:for-each>
1079 </xsl:if>
1081 <!-- 508 -->
1082 <xsl:if test="marc:datafield[@tag=508]">
1083 <div class="results_summary prod_credits">
1084 <span class="label">Production Credits: </span>
1085 <xsl:for-each select="marc:datafield[@tag=508]">
1086 <xsl:call-template name="subfieldSelectSpan">
1087 <xsl:with-param name="codes">a</xsl:with-param>
1088 </xsl:call-template>
1089 <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
1090 </xsl:for-each>
1091 </div>
1092 </xsl:if>
1094 <!-- 586 -->
1095 <xsl:if test="marc:datafield[@tag=586]">
1096 <span class="results_summary awardsnote">
1097 <xsl:if test="marc:datafield[@tag=586]/@ind1=' '">
1098 <span class="label">Awards: </span>
1099 </xsl:if>
1100 <xsl:for-each select="marc:datafield[@tag=586]">
1101 <xsl:value-of select="marc:subfield[@code='a']"/>
1102 <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
1103 </xsl:for-each>
1104 </span>
1105 </xsl:if>
1107 <!-- 773 -->
1108 <xsl:if test="marc:datafield[@tag=773]">
1109 <xsl:for-each select="marc:datafield[@tag=773]">
1110 <xsl:if test="@ind1 !=1">
1111 <span class="results_summary in"><span class="label">
1112 <xsl:choose>
1113 <xsl:when test="@ind2=' '">
1115 </xsl:when>
1116 <xsl:when test="@ind2=8">
1117 <xsl:if test="marc:subfield[@code='i']">
1118 <xsl:value-of select="marc:subfield[@code='i']"/>
1119 </xsl:if>
1120 </xsl:when>
1121 </xsl:choose>
1122 </span>
1123 <xsl:variable name="f773">
1124 <xsl:call-template name="chopPunctuation">
1125 <xsl:with-param name="chopString">
1126 <xsl:call-template name="subfieldSelect">
1127 <xsl:with-param name="codes">a_t</xsl:with-param>
1128 </xsl:call-template>
1129 </xsl:with-param>
1130 </xsl:call-template>
1131 </xsl:variable>
1132 <xsl:choose>
1133 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1134 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
1135 <xsl:value-of select="translate($f773, '()', '')"/>
1136 </a>
1137 </xsl:when>
1138 <xsl:when test="marc:subfield[@code='0']">
1139 <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute>
1140 <xsl:value-of select="$f773"/>
1141 </a>
1142 </xsl:when>
1143 <xsl:otherwise>
1144 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f773, '()', ''), true())"/></xsl:attribute>
1145 <xsl:value-of select="$f773"/>
1146 </a>
1147 </xsl:otherwise>
1148 </xsl:choose>
1149 <xsl:if test="marc:subfield[@code='g']">
1150 <xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/>
1151 </xsl:if>
1152 </span>
1154 <xsl:if test="marc:subfield[@code='n']">
1155 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
1156 </xsl:if>
1158 </xsl:if>
1159 </xsl:for-each>
1160 </xsl:if>
1162 <xsl:for-each select="marc:datafield[@tag=511]">
1163 <span class="results_summary perf_note">
1164 <span class="label">
1165 <xsl:if test="@ind1=1"><xsl:text>Cast: </xsl:text></xsl:if>
1166 </span>
1167 <xsl:call-template name="subfieldSelect">
1168 <xsl:with-param name="codes">a</xsl:with-param>
1169 </xsl:call-template>
1170 </span>
1171 </xsl:for-each>
1173 <xsl:if test="marc:datafield[@tag=502]">
1174 <span class="results_summary diss_note">
1175 <span class="label">Dissertation note: </span>
1176 <xsl:for-each select="marc:datafield[@tag=502]">
1177 <xsl:call-template name="subfieldSelect">
1178 <xsl:with-param name="codes">abcdgo</xsl:with-param>
1179 </xsl:call-template>
1180 </xsl:for-each>
1181 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
1182 </span>
1183 </xsl:if>
1185 <xsl:for-each select="marc:datafield[@tag=520]">
1186 <span class="results_summary summary"><span class="label">
1187 <xsl:choose>
1188 <xsl:when test="@ind1=0"><xsl:text>Subject: </xsl:text></xsl:when>
1189 <xsl:when test="@ind1=1"><xsl:text>Review: </xsl:text></xsl:when>
1190 <xsl:when test="@ind1=2"><xsl:text>Scope and content: </xsl:text></xsl:when>
1191 <xsl:when test="@ind1=3"><xsl:text>Abstract: </xsl:text></xsl:when>
1192 <xsl:when test="@ind1=4"><xsl:text>Content advice: </xsl:text></xsl:when>
1193 <xsl:otherwise><xsl:text>Summary: </xsl:text></xsl:otherwise>
1194 </xsl:choose>
1195 </span>
1196 <xsl:call-template name="subfieldSelect">
1197 <xsl:with-param name="codes">abcu</xsl:with-param>
1198 </xsl:call-template>
1199 </span>
1200 </xsl:for-each>
1202 <!-- 866 textual holdings -->
1203 <xsl:if test="marc:datafield[@tag=866]">
1204 <span class="results_summary holdings_note"><span class="label">Holdings: </span> <br />
1205 <xsl:for-each select="marc:datafield[@tag=866]">
1206 <xsl:call-template name="subfieldSelect">
1207 <xsl:with-param name="codes">az</xsl:with-param>
1208 </xsl:call-template>
1209 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text><br /></xsl:otherwise></xsl:choose>
1210 </xsl:for-each>
1211 </span>
1212 </xsl:if>
1214 <!-- 867 textual holdings -->
1215 <xsl:if test="marc:datafield[@tag=867]">
1216 <span class="results_summary holdings_note"><span class="label">Supplements: </span> <br />
1217 <xsl:for-each select="marc:datafield[@tag=867]">
1218 <xsl:call-template name="subfieldSelect">
1219 <xsl:with-param name="codes">az</xsl:with-param>
1220 </xsl:call-template>
1221 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text><br /></xsl:otherwise></xsl:choose>
1222 </xsl:for-each>
1223 </span>
1224 </xsl:if>
1226 <!-- 868 textual holdings -->
1227 <xsl:if test="marc:datafield[@tag=868]">
1228 <span class="results_summary holdings_note"><span class="label">Indexes: </span> <br />
1229 <xsl:for-each select="marc:datafield[@tag=868]">
1230 <xsl:call-template name="subfieldSelect">
1231 <xsl:with-param name="codes">az</xsl:with-param>
1232 </xsl:call-template>
1233 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text><br /></xsl:otherwise></xsl:choose>
1234 </xsl:for-each>
1235 </span>
1236 </xsl:if>
1238 <!-- 775 Other Edition -->
1239 <xsl:if test="marc:datafield[@tag=775]">
1240 <span class="results_summary other_editions"><span class="label">Other editions: </span>
1241 <xsl:for-each select="marc:datafield[@tag=775]">
1242 <xsl:variable name="f775">
1243 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
1244 <xsl:with-param name="codes">a_t</xsl:with-param>
1245 </xsl:call-template></xsl:with-param></xsl:call-template>
1246 </xsl:variable>
1247 <xsl:if test="marc:subfield[@code='i']">
1248 <xsl:call-template name="subfieldSelect">
1249 <xsl:with-param name="codes">i</xsl:with-param>
1250 </xsl:call-template>
1251 <xsl:text>: </xsl:text>
1252 </xsl:if>
1254 <xsl:choose>
1255 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1256 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
1257 </xsl:when>
1258 <xsl:otherwise>
1259 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f775, '()', ''), true())"/></xsl:attribute>
1260 </xsl:otherwise>
1261 </xsl:choose>
1262 <xsl:call-template name="subfieldSelect">
1263 <xsl:with-param name="codes">a_t</xsl:with-param>
1264 </xsl:call-template>
1265 </a>
1266 <xsl:choose>
1267 <xsl:when test="position()=last()"></xsl:when>
1268 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
1269 </xsl:choose>
1270 </xsl:for-each>
1271 </span>
1272 </xsl:if>
1274 <!-- 780 -->
1275 <xsl:if test="marc:datafield[@tag=780]">
1276 <xsl:for-each select="marc:datafield[@tag=780]">
1277 <xsl:if test="@ind1=0">
1278 <span class="results_summary preceeding_entry">
1279 <xsl:choose>
1280 <xsl:when test="@ind2=0">
1281 <span class="label">Continues:</span>
1282 </xsl:when>
1283 <xsl:when test="@ind2=1">
1284 <span class="label">Continues in part:</span>
1285 </xsl:when>
1286 <xsl:when test="@ind2=2">
1287 <span class="label">Supersedes:</span>
1288 </xsl:when>
1289 <xsl:when test="@ind2=3">
1290 <span class="label">Supersedes in part:</span>
1291 </xsl:when>
1292 <xsl:when test="@ind2=4">
1293 <span class="label">Formed by the union: ... and: ...</span>
1294 </xsl:when>
1295 <xsl:when test="@ind2=5">
1296 <span class="label">Absorbed:</span>
1297 </xsl:when>
1298 <xsl:when test="@ind2=6">
1299 <span class="label">Absorbed in part:</span>
1300 </xsl:when>
1301 <xsl:when test="@ind2=7">
1302 <span class="label">Separated from:</span>
1303 </xsl:when>
1304 </xsl:choose>
1305 <xsl:text> </xsl:text>
1306 <xsl:variable name="f780">
1307 <xsl:call-template name="subfieldSelect">
1308 <xsl:with-param name="codes">a_t</xsl:with-param>
1309 </xsl:call-template>
1310 </xsl:variable>
1311 <xsl:choose>
1312 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1313 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
1314 <xsl:value-of select="translate($f780, '()', '')"/>
1315 </a>
1316 </xsl:when>
1317 <xsl:otherwise>
1318 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f780, '()', ''), true())"/></xsl:attribute>
1319 <xsl:value-of select="translate($f780, '()', '')"/>
1320 </a>
1321 </xsl:otherwise>
1322 </xsl:choose>
1323 </span>
1325 <xsl:if test="marc:subfield[@code='n']">
1326 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
1327 </xsl:if>
1329 </xsl:if>
1330 </xsl:for-each>
1331 </xsl:if>
1333 <!-- 785 -->
1334 <xsl:if test="marc:datafield[@tag=785]">
1335 <xsl:for-each select="marc:datafield[@tag=785]">
1336 <xsl:if test="@ind1=0">
1337 <span class="results_summary succeeding_entry">
1338 <xsl:choose>
1339 <xsl:when test="@ind2=0">
1340 <span class="label">Continued by:</span>
1341 </xsl:when>
1342 <xsl:when test="@ind2=1">
1343 <span class="label">Continued in part by:</span>
1344 </xsl:when>
1345 <xsl:when test="@ind2=2">
1346 <span class="label">Superseded by:</span>
1347 </xsl:when>
1348 <xsl:when test="@ind2=3">
1349 <span class="label">Superseded in part by:</span>
1350 </xsl:when>
1351 <xsl:when test="@ind2=4">
1352 <span class="label">Absorbed by:</span>
1353 </xsl:when>
1354 <xsl:when test="@ind2=5">
1355 <span class="label">Absorbed in part by:</span>
1356 </xsl:when>
1357 <xsl:when test="@ind2=6">
1358 <span class="label">Split into .. and ...:</span>
1359 </xsl:when>
1360 <xsl:when test="@ind2=7">
1361 <span class="label">Merged with ... to form ...</span>
1362 </xsl:when>
1363 <xsl:when test="@ind2=8">
1364 <span class="label">Changed back to:</span>
1365 </xsl:when>
1366 </xsl:choose>
1367 <xsl:text> </xsl:text>
1368 <xsl:variable name="f785">
1369 <xsl:call-template name="subfieldSelect">
1370 <xsl:with-param name="codes">a_t</xsl:with-param>
1371 </xsl:call-template>
1372 </xsl:variable>
1374 <xsl:choose>
1375 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1376 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
1377 <xsl:value-of select="translate($f785, '()', '')"/>
1378 </a>
1379 </xsl:when>
1380 <xsl:otherwise>
1381 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f785, '()', ''), true())"/></xsl:attribute>
1382 <xsl:value-of select="translate($f785, '()', '')"/>
1383 </a>
1384 </xsl:otherwise>
1385 </xsl:choose>
1387 </span>
1389 <xsl:if test="marc:subfield[@code='n']">
1390 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
1391 </xsl:if>
1393 </xsl:if>
1394 </xsl:for-each>
1395 </xsl:if>
1397 <!-- OpenURL -->
1398 <xsl:variable name="OPACShowOpenURL" select="marc:sysprefs/marc:syspref[@name='OPACShowOpenURL']" />
1399 <xsl:variable name="OpenURLImageLocation" select="marc:sysprefs/marc:syspref[@name='OpenURLImageLocation']" />
1400 <xsl:variable name="OpenURLText" select="marc:sysprefs/marc:syspref[@name='OpenURLText']" />
1401 <xsl:variable name="OpenURLResolverURL" select="marc:variables/marc:variable[@name='OpenURLResolverURL']" />
1403 <xsl:if test="$OPACShowOpenURL = 1 and $OpenURLResolverURL != ''">
1404 <xsl:variable name="openurltext">
1405 <xsl:choose>
1406 <xsl:when test="$OpenURLText != ''">
1407 <xsl:value-of select="$OpenURLText" />
1408 </xsl:when>
1409 <xsl:otherwise>
1410 <xsl:text>OpenURL</xsl:text>
1411 </xsl:otherwise>
1412 </xsl:choose>
1413 </xsl:variable>
1415 <span class="results_summary"><a>
1416 <xsl:attribute name="href">
1417 <xsl:value-of select="$OpenURLResolverURL" />
1418 </xsl:attribute>
1419 <xsl:attribute name="title">
1420 <xsl:value-of select="$openurltext" />
1421 </xsl:attribute>
1422 <xsl:attribute name="class">
1423 <xsl:text>OpenURL</xsl:text>
1424 </xsl:attribute>
1425 <xsl:if test="$OPACURLOpenInNewWindow='1'">
1426 <xsl:attribute name="target">
1427 <xsl:text>_blank</xsl:text>
1428 </xsl:attribute>
1429 </xsl:if>
1430 <xsl:choose>
1431 <xsl:when test="$OpenURLImageLocation != ''">
1432 <img>
1433 <xsl:attribute name="src">
1434 <xsl:value-of select="$OpenURLImageLocation" />
1435 </xsl:attribute>
1436 </img>
1437 </xsl:when>
1438 <xsl:otherwise>
1439 <xsl:value-of select="$openurltext" />
1440 </xsl:otherwise>
1441 </xsl:choose>
1442 </a></span>
1443 </xsl:if>
1444 <!-- End of OpenURL -->
1446 </xsl:element>
1447 </xsl:template>
1449 <xsl:template name="showAuthor">
1450 <xsl:param name="authorfield" />
1451 <xsl:param name="UseAuthoritiesForTracings" />
1452 <xsl:param name="materialTypeLabel" />
1453 <xsl:param name="theme" />
1454 <xsl:if test="count($authorfield)&gt;0">
1455 <h5 class="author">
1456 <xsl:for-each select="$authorfield">
1457 <xsl:choose>
1458 <xsl:when test="position()&gt;1"/>
1459 <!-- #13383 -->
1460 <xsl:when test="@tag&lt;700">By: </xsl:when>
1461 <!--#13382 Changed Additional author to contributor -->
1462 <xsl:otherwise>Contributor(s): </xsl:otherwise>
1463 </xsl:choose>
1464 <xsl:choose>
1465 <xsl:when test="not(@tag=111) or @tag=700 or @tag=710 or @tag=711"/>
1466 <xsl:when test="marc:subfield[@code='n']">
1467 <xsl:text> </xsl:text>
1468 <xsl:call-template name="subfieldSelect">
1469 <xsl:with-param name="codes">n</xsl:with-param>
1470 </xsl:call-template>
1471 <xsl:text> </xsl:text>
1472 </xsl:when>
1473 </xsl:choose>
1475 <xsl:choose>
1476 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1477 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:"<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/>"</xsl:attribute>
1478 </xsl:when>
1479 <xsl:otherwise>
1480 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
1481 </xsl:otherwise>
1482 </xsl:choose>
1483 <span resource="#record"><span>
1484 <xsl:choose>
1485 <xsl:when test="substring(@tag, 1, 1)='1'">
1486 <xsl:choose>
1487 <xsl:when test="$materialTypeLabel='Music'"><xsl:attribute name="property">byArtist</xsl:attribute></xsl:when>
1488 <xsl:otherwise><xsl:attribute name="property">author</xsl:attribute></xsl:otherwise>
1489 </xsl:choose>
1490 </xsl:when>
1491 <xsl:otherwise><xsl:attribute name="property">contributor</xsl:attribute></xsl:otherwise>
1492 </xsl:choose>
1493 <xsl:choose>
1494 <xsl:when test="substring(@tag, 2, 1)='0'">
1495 <xsl:choose>
1496 <xsl:when test="$materialTypeLabel='Music'"><xsl:attribute name="typeof">MusicGroup</xsl:attribute></xsl:when>
1497 <xsl:otherwise><xsl:attribute name="typeof">Person</xsl:attribute></xsl:otherwise>
1498 </xsl:choose>
1499 </xsl:when>
1500 <xsl:otherwise><xsl:attribute name="typeof">Organization</xsl:attribute></xsl:otherwise>
1501 </xsl:choose>
1502 <span property="name">
1503 <xsl:choose>
1504 <xsl:when test="@tag=100 or @tag=110 or @tag=111">
1505 <!-- #13383 -->
1506 <xsl:call-template name="chopPunctuation">
1507 <xsl:with-param name="chopString">
1508 <xsl:call-template name="subfieldSelect">
1509 <xsl:with-param name="codes">
1510 <xsl:choose>
1511 <!-- #13383 include subfield e for field 111, Display only name portion in 1XX -->
1512 <xsl:when test="@tag=111">aeq</xsl:when>
1513 <xsl:when test="@tag=110">ab</xsl:when>
1514 <xsl:otherwise>abcjq</xsl:otherwise>
1515 </xsl:choose>
1516 </xsl:with-param>
1517 </xsl:call-template>
1518 </xsl:with-param>
1519 <xsl:with-param name="punctuation">
1520 <xsl:text>:,;/ </xsl:text>
1521 </xsl:with-param>
1522 </xsl:call-template>
1523 <!-- Display only name and title portion in 110 field -->
1524 <xsl:if test="@tag=110 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
1525 <span class="titleportion">
1526 <xsl:choose>
1527 <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1528 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1529 </xsl:choose>
1530 <xsl:call-template name="chopPunctuation">
1531 <xsl:with-param name="chopString">
1532 <xsl:call-template name="subfieldSelect">
1533 <xsl:with-param name="codes">cdnt</xsl:with-param>
1534 </xsl:call-template>
1535 </xsl:with-param>
1536 </xsl:call-template>
1537 </span>
1538 </xsl:if>
1539 <!-- Display only name and title portion in 111 field -->
1540 <xsl:if test="@tag=111 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
1541 <span class="titleportion">
1542 <xsl:choose>
1543 <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1544 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1545 </xsl:choose>
1547 <xsl:call-template name="chopPunctuation">
1548 <xsl:with-param name="chopString">
1549 <xsl:call-template name="subfieldSelect">
1550 <xsl:with-param name="codes">cdgnt</xsl:with-param>
1551 </xsl:call-template>
1552 </xsl:with-param>
1553 </xsl:call-template>
1554 </span>
1555 </xsl:if>
1556 <!-- Display only dates in 100 field -->
1557 <xsl:if test="@tag=100 and marc:subfield[@code='d']">
1558 <span class="authordates">
1559 <xsl:text>, </xsl:text>
1560 <xsl:call-template name="chopPunctuation">
1561 <xsl:with-param name="chopString">
1562 <xsl:call-template name="subfieldSelect">
1563 <xsl:with-param name="codes">d</xsl:with-param>
1564 </xsl:call-template>
1565 </xsl:with-param>
1566 </xsl:call-template>
1567 </span>
1568 </xsl:if>
1569 </xsl:when>
1570 <!-- #13382 excludes 700$i and ind2=2, displayed as Related Works -->
1571 <!--#13382 Added all relevant subfields 4, e, and d are handled separately -->
1572 <xsl:when test="@tag=700 or @tag=710 or @tag=711">
1573 <!-- Includes major changes for 7XX fields; display name portion in 710 and 711 fields -->
1574 <xsl:if test="@tag=710 or @tag=711">
1575 <xsl:call-template name="chopPunctuation">
1576 <xsl:with-param name="chopString">
1577 <xsl:call-template name="subfieldSelect">
1578 <xsl:with-param name="codes">
1579 <xsl:choose>
1580 <xsl:when test="@tag=711">aeq</xsl:when>
1581 <xsl:otherwise>ab</xsl:otherwise>
1582 </xsl:choose>
1583 </xsl:with-param>
1584 </xsl:call-template>
1585 </xsl:with-param>
1586 <xsl:with-param name="punctuation">
1587 <xsl:text>:,;/ </xsl:text>
1588 </xsl:with-param>
1589 </xsl:call-template>
1590 <!-- Display only name and title portion in 711 field -->
1591 <xsl:if test="@tag=711 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
1592 <span class="titleportion">
1593 <xsl:choose>
1594 <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1595 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1596 </xsl:choose>
1598 <xsl:call-template name="chopPunctuation">
1599 <xsl:with-param name="chopString">
1600 <xsl:call-template name="subfieldSelect">
1601 <xsl:with-param name="codes">cdgnt</xsl:with-param>
1602 </xsl:call-template>
1603 </xsl:with-param>
1604 </xsl:call-template>
1605 </span>
1606 </xsl:if>
1607 <!-- Display only name and title portion in 710 field -->
1608 <xsl:if test="@tag=710 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
1609 <span class="titleportion">
1610 <xsl:choose>
1611 <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1612 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1613 </xsl:choose>
1614 <xsl:call-template name="chopPunctuation">
1615 <xsl:with-param name="chopString">
1616 <xsl:call-template name="subfieldSelect">
1617 <xsl:with-param name="codes">cdnt</xsl:with-param>
1618 </xsl:call-template>
1619 </xsl:with-param>
1620 </xsl:call-template>
1621 </span>
1622 </xsl:if>
1624 </xsl:if>
1625 <!-- Display only name portion in 700 field -->
1626 <xsl:if test="@tag=700">
1627 <xsl:call-template name="chopPunctuation">
1628 <xsl:with-param name="chopString">
1629 <xsl:call-template name="subfieldSelect">
1630 <xsl:with-param name="codes">abcq</xsl:with-param>
1631 </xsl:call-template>
1632 </xsl:with-param>
1633 </xsl:call-template>
1634 </xsl:if>
1635 <!-- Display class "authordates" in 700 field -->
1636 <xsl:if test="@tag=700 and marc:subfield[@code='d']">
1637 <span class="authordates">
1638 <xsl:text>, </xsl:text>
1639 <xsl:call-template name="chopPunctuation">
1640 <xsl:with-param name="chopString">
1641 <xsl:call-template name="subfieldSelect">
1642 <xsl:with-param name="codes">d</xsl:with-param>
1643 </xsl:call-template>
1644 </xsl:with-param>
1645 </xsl:call-template>
1646 </span>
1647 </xsl:if>
1648 <!-- Display class "titleportion" in 700 field -->
1649 <xsl:variable name="titleportionfields" select="boolean(marc:subfield[@code='t' or @code='j' or @code='k' or @code='u'])"/>
1650 <xsl:if test="@tag=700 and $titleportionfields">
1651 <span class="titleportion">
1652 <xsl:text>. </xsl:text>
1653 <xsl:call-template name="chopPunctuation">
1654 <xsl:with-param name="chopString">
1655 <xsl:call-template name="subfieldSelect">
1656 <xsl:with-param name="codes">fghjklmnoprstux</xsl:with-param>
1657 </xsl:call-template>
1658 </xsl:with-param>
1659 </xsl:call-template>
1660 </span>
1661 </xsl:if>
1663 </xsl:when>
1664 </xsl:choose>
1665 </span></span></span>
1667 <!-- #13383 include relator code j for field 111 also include 711$e 'Subordinate unit' -->
1668 <xsl:if test="(@tag!=111 and @tag!=711 and marc:subfield[@code='4' or @code='e']) or ((@tag=111 or @tag=711) and marc:subfield[@code='4' or @code='j'])">
1670 <span class="relatorcode">
1671 <xsl:text> [</xsl:text>
1672 <xsl:choose>
1673 <xsl:when test="@tag=111 or @tag=711">
1674 <xsl:choose>
1675 <!-- Prefer j over 4 for 111 and 711 -->
1676 <xsl:when test="marc:subfield[@code='j']">
1677 <xsl:for-each select="marc:subfield[@code='j']">
1678 <xsl:value-of select="."/>
1679 <xsl:if test="position() != last()">, </xsl:if>
1680 </xsl:for-each>
1681 </xsl:when>
1682 <xsl:otherwise>
1683 <xsl:for-each select="marc:subfield[@code=4]">
1684 <xsl:value-of select="."/>
1685 <xsl:if test="position() != last()">, </xsl:if>
1686 </xsl:for-each>
1687 </xsl:otherwise>
1688 </xsl:choose>
1689 </xsl:when>
1690 <!-- Prefer e over 4 on 100 and 110-->
1691 <xsl:when test="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]">
1692 <xsl:for-each select="marc:subfield[@code='e']">
1693 <xsl:value-of select="."/>
1694 <xsl:if test="position() != last()">, </xsl:if>
1695 </xsl:for-each>
1696 </xsl:when>
1697 <xsl:otherwise>
1698 <xsl:for-each select="marc:subfield[@code=4]">
1699 <xsl:value-of select="."/>
1700 <xsl:if test="position() != last()">, </xsl:if>
1701 </xsl:for-each>
1702 </xsl:otherwise>
1703 </xsl:choose>
1704 <xsl:text>]</xsl:text>
1705 </span>
1706 </xsl:if>
1707 </a>
1708 <xsl:if test="marc:subfield[@code=9]">
1709 <a class='authlink'>
1710 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
1711 <xsl:element name="img">
1712 <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute>
1713 <xsl:attribute name="style">vertical-align:middle</xsl:attribute>
1714 <xsl:attribute name="height">15</xsl:attribute>
1715 <xsl:attribute name="width">15</xsl:attribute>
1716 </xsl:element>
1717 </a>
1718 </xsl:if>
1719 <xsl:choose>
1720 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
1721 </xsl:choose>
1722 </xsl:for-each>
1723 </h5>
1724 </xsl:if>
1725 </xsl:template>
1727 <xsl:template name="nameABCQ">
1728 <xsl:call-template name="chopPunctuation">
1729 <xsl:with-param name="chopString">
1730 <xsl:call-template name="subfieldSelect">
1731 <xsl:with-param name="codes">abcq</xsl:with-param>
1732 </xsl:call-template>
1733 </xsl:with-param>
1734 <xsl:with-param name="punctuation">
1735 <xsl:text>:,;/ </xsl:text>
1736 </xsl:with-param>
1737 </xsl:call-template>
1738 </xsl:template>
1740 <xsl:template name="nameABCDN">
1741 <xsl:call-template name="chopPunctuation">
1742 <xsl:with-param name="chopString">
1743 <xsl:call-template name="subfieldSelect">
1744 <xsl:with-param name="codes">abcdn</xsl:with-param>
1745 </xsl:call-template>
1746 </xsl:with-param>
1747 <xsl:with-param name="punctuation">
1748 <xsl:text>:,;/ </xsl:text>
1749 </xsl:with-param>
1750 </xsl:call-template>
1751 </xsl:template>
1753 <xsl:template name="nameACDEQ">
1754 <xsl:call-template name="subfieldSelect">
1755 <xsl:with-param name="codes">acdeq</xsl:with-param>
1756 </xsl:call-template>
1757 </xsl:template>
1759 <xsl:template name="part">
1760 <xsl:variable name="partNumber">
1761 <xsl:call-template name="specialSubfieldSelect">
1762 <xsl:with-param name="axis">n</xsl:with-param>
1763 <xsl:with-param name="anyCodes">n</xsl:with-param>
1764 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1765 </xsl:call-template>
1766 </xsl:variable>
1767 <xsl:variable name="partName">
1768 <xsl:call-template name="specialSubfieldSelect">
1769 <xsl:with-param name="axis">p</xsl:with-param>
1770 <xsl:with-param name="anyCodes">p</xsl:with-param>
1771 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1772 </xsl:call-template>
1773 </xsl:variable>
1774 <xsl:if test="string-length(normalize-space($partNumber))">
1775 <xsl:call-template name="chopPunctuation">
1776 <xsl:with-param name="chopString" select="$partNumber"/>
1777 </xsl:call-template>
1778 </xsl:if>
1779 <xsl:if test="string-length(normalize-space($partName))">
1780 <xsl:call-template name="chopPunctuation">
1781 <xsl:with-param name="chopString" select="$partName"/>
1782 </xsl:call-template>
1783 </xsl:if>
1784 </xsl:template>
1786 <xsl:template name="specialSubfieldSelect">
1787 <xsl:param name="anyCodes"/>
1788 <xsl:param name="axis"/>
1789 <xsl:param name="beforeCodes"/>
1790 <xsl:param name="afterCodes"/>
1791 <xsl:variable name="str">
1792 <xsl:for-each select="marc:subfield">
1793 <xsl:if test="contains($anyCodes, @code) or (contains($beforeCodes,@code) and following-sibling::marc:subfield[@code=$axis]) or (contains($afterCodes,@code) and preceding-sibling::marc:subfield[@code=$axis])">
1794 <xsl:value-of select="text()"/>
1795 <xsl:text> </xsl:text>
1796 </xsl:if>
1797 </xsl:for-each>
1798 </xsl:variable>
1799 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1800 </xsl:template>
1802 <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
1803 <xsl:template name="subfieldSelectSubject">
1804 <xsl:param name="codes"/>
1805 <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
1806 <xsl:param name="subdivCodes"/>
1807 <xsl:param name="subdivDelimiter"/>
1808 <xsl:param name="prefix"/>
1809 <xsl:param name="suffix"/>
1810 <xsl:param name="urlencode"/>
1811 <xsl:variable name="str">
1812 <xsl:for-each select="marc:subfield">
1813 <xsl:if test="contains($codes, @code)">
1814 <xsl:if test="contains($subdivCodes, @code)">
1815 <xsl:value-of select="$subdivDelimiter"/>
1816 </xsl:if>
1817 <xsl:value-of select="$prefix"/><xsl:value-of select="translate(text(),'()','')"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/>
1818 </xsl:if>
1819 </xsl:for-each>
1820 </xsl:variable>
1821 <xsl:choose>
1822 <xsl:when test="$urlencode=1">
1823 <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/>
1824 </xsl:when>
1825 <xsl:otherwise>
1826 <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
1827 </xsl:otherwise>
1828 </xsl:choose>
1829 </xsl:template>
1830 </xsl:stylesheet>