1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
4 <xsl:stylesheet version="1.0"
5 xmlns:marc="http://www.loc.gov/MARC21/slim"
6 xmlns:items="http://www.koha-community.org/items"
7 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8 xmlns:exsl="http://exslt.org/common"
9 xmlns:str="http://exslt.org/strings"
10 exclude-result-prefixes="marc items str" extension-element-prefixes="exsl">
11 <xsl:import href="MARC21slimUtils.xsl"/>
12 <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14 <xsl:key name="item-by-status" match="items:item" use="items:status"/>
16 <xsl:template match="/">
17 <xsl:apply-templates/>
19 <xsl:template match="marc:record">
21 <xsl:variable name="itemcount" select="count(items:items/items:item)"/>
23 <!-- Option: Display Alternate Graphic Representation (MARC 880) -->
24 <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
26 <xsl:variable name="OPACResultsMaxItems" select="number(marc:sysprefs/marc:syspref[@name='OPACResultsMaxItems']+0)"/>
27 <xsl:variable name="OPACResultsMaxItemsUnavailable" select="number(marc:sysprefs/marc:syspref[@name='OPACResultsMaxItemsUnavailable']+0)"/>
28 <xsl:variable name="OPACResultsUnavailableGroupingBy" select="marc:sysprefs/marc:syspref[@name='OPACResultsUnavailableGroupingBy']"/>
29 <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
30 <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
31 <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/>
32 <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
33 <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
34 <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
35 <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
36 <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/>
37 <xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
38 <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/>
39 <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/>
40 <xsl:variable name="OPACItemLocation" select="marc:sysprefs/marc:syspref[@name='OPACItemLocation']"/>
41 <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/>
42 <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/>
43 <xsl:variable name="leader" select="marc:leader"/>
44 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
45 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
46 <xsl:variable name="leader19" select="substring($leader,20,1)"/>
47 <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
48 <xsl:variable name="isbn" select="marc:datafield[@tag=020]/marc:subfield[@code='a']"/>
49 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
50 <xsl:variable name="typeOf008">
52 <xsl:when test="$leader19='a'">ST</xsl:when>
53 <xsl:when test="$leader6='a'">
55 <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
56 <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">CR</xsl:when>
59 <xsl:when test="$leader6='t'">BK</xsl:when>
60 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
61 <xsl:when test="$leader6='m'">CF</xsl:when>
62 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
63 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
64 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
65 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
68 <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/>
69 <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
70 <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/>
71 <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
72 <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
73 <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
74 <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
75 <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
76 <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
78 <xsl:variable name="physicalDescription">
79 <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a']">
82 <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='b']">
85 <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='d']">
86 digitized other analog
89 <xsl:variable name="check008-23">
90 <xsl:if test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='CR' or $typeOf008='MX'">
91 <xsl:value-of select="true()"></xsl:value-of>
94 <xsl:variable name="check008-29">
95 <xsl:if test="$typeOf008='MP' or $typeOf008='VM'">
96 <xsl:value-of select="true()"></xsl:value-of>
100 <xsl:when test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')">
103 <xsl:when test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='CR') and ($controlField008-23=' ' or $controlField008='r'))">
106 <xsl:when test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')">
109 <xsl:when test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')">
112 <xsl:when test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')">
115 <xsl:when test="($controlField008-23='d' and ($typeOf008='BK' or $typeOf008='CR'))">
120 <xsl:if test="marc:datafield[@tag=130]/marc:subfield[@code='h']">
121 <xsl:call-template name="chopBrackets">
122 <xsl:with-param name="chopString">
123 <xsl:value-of select="marc:datafield[@tag=130]/marc:subfield[@code='h']"></xsl:value-of>
127 <xsl:if test="marc:datafield[@tag=240]/marc:subfield[@code='h']">
128 <xsl:call-template name="chopBrackets">
129 <xsl:with-param name="chopString">
130 <xsl:value-of select="marc:datafield[@tag=240]/marc:subfield[@code='h']"></xsl:value-of>
134 <xsl:if test="marc:datafield[@tag=242]/marc:subfield[@code='h']">
135 <xsl:call-template name="chopBrackets">
136 <xsl:with-param name="chopString">
137 <xsl:value-of select="marc:datafield[@tag=242]/marc:subfield[@code='h']"></xsl:value-of>
141 <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='h']">
142 <xsl:call-template name="chopBrackets">
143 <xsl:with-param name="chopString">
144 <xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='h']"></xsl:value-of>
148 <xsl:if test="marc:datafield[@tag=246]/marc:subfield[@code='h']">
149 <xsl:call-template name="chopBrackets">
150 <xsl:with-param name="chopString">
151 <xsl:value-of select="marc:datafield[@tag=246]/marc:subfield[@code='h']"></xsl:value-of>
155 <xsl:if test="marc:datafield[@tag=730]/marc:subfield[@code='h']">
156 <xsl:call-template name="chopBrackets">
157 <xsl:with-param name="chopString">
158 <xsl:value-of select="marc:datafield[@tag=730]/marc:subfield[@code='h']"></xsl:value-of>
162 <xsl:for-each select="marc:datafield[@tag=256]/marc:subfield[@code='a']">
163 <xsl:value-of select="."></xsl:value-of>
165 <xsl:for-each select="marc:controlfield[@tag=007][substring(text(),1,1)='c']">
167 <xsl:when test="substring(text(),14,1)='a'">
170 <xsl:when test="substring(text(),14,1)='p'">
173 <xsl:when test="substring(text(),14,1)='r'">
179 <xsl:variable name="controlField007" select="marc:controlfield[@tag=007]"/>
180 <xsl:variable name="cf007ss11" select="substring($controlField007,1,1)"/>
181 <xsl:variable name="cf007ss21" select="substring($controlField007,2,1)"/>
182 <xsl:if test="$cf007ss11 = 'c' and $cf007ss21 = 'b'">
185 <xsl:if test="$cf007ss11 = 'c' and $cf007ss21 = 'c'">
186 <img src="/opac-tmpl/lib/famfamfam/cd.png" alt="computer optical disc cartridge" class="format"/>
188 <xsl:if test="$cf007ss11 = 'c' and $cf007ss21 = 'j'">
191 <xsl:if test="$cf007ss11 = 'c' and $cf007ss21 = 'm'">
194 <xsl:if test="$cf007ss11 = 'c' and $cf007ss21 = 'o'">
195 <img src="/opac-tmpl/lib/famfamfam/cd.png" alt="optical disc" class="format"/>
197 <xsl:if test="$cf007ss11 = 'c' and $cf007ss21 = 'r'">
199 <img src="/opac-tmpl/lib/famfamfam/drive_web.png" alt="remote" class="format"/>
201 <xsl:if test="$cf007ss11 = 'c' and $cf007ss21 = 'a'">
204 <xsl:if test="$cf007ss11 = 'c' and $cf007ss21 = 'f'">
207 <xsl:if test="$cf007ss11 = 'c' and $cf007ss21 = 'h'">
211 <xsl:if test="$cf007ss11 = 'd' and $cf007ss21 = 'a'">
212 <img src="/opac-tmpl/lib/famfamfam/world.png" alt="celestial globe" class="format"/>
214 <xsl:if test="$cf007ss11 = 'd' and $cf007ss21 = 'e'">
215 <img src="/opac-tmpl/lib/famfamfam/world.png" alt="earth moon globe" class="format"/>
217 <xsl:if test="$cf007ss11 = 'd' and $cf007ss21 = 'b'">
218 <img src="/opac-tmpl/lib/famfamfam/world.png" alt="planetary or lunar globe" class="format"/>
220 <xsl:if test="$cf007ss11 = 'd' and $cf007ss21 = 'c'">
221 <img src="/opac-tmpl/lib/famfamfam/world.png" alt="terrestrial globe" class="format"/>
224 <xsl:if test="$cf007ss11 = 'o' and $cf007ss21 = 'o'">
228 <xsl:if test="$cf007ss11 = 'a' and $cf007ss21 = 'd'">
231 <xsl:if test="$cf007ss11 = 'a' and $cf007ss21 = 'g'">
234 <xsl:if test="$cf007ss11 = 'a' and $cf007ss21 = 'j'">
237 <xsl:if test="$cf007ss11 = 'a' and $cf007ss21 = 'q'">
240 <xsl:if test="$cf007ss11 = 'a' and $cf007ss21 = 'k'">
243 <xsl:if test="$cf007ss11 = 'a' and $cf007ss21 = 'r'">
246 <xsl:if test="$cf007ss11 = 'a' and $cf007ss21 = 's'">
249 <xsl:if test="$cf007ss11 = 'a' and $cf007ss21 = 'y'">
253 <xsl:if test="$cf007ss11 = 'h' and $cf007ss21 = 'a'">
256 <xsl:if test="$cf007ss11 = 'h' and $cf007ss21 = 'e'">
259 <xsl:if test="$cf007ss11 = 'h' and $cf007ss21 = 'f'">
262 <xsl:if test="$cf007ss11 = 'h' and $cf007ss21 = 'b'">
265 <xsl:if test="$cf007ss11 = 'h' and $cf007ss21 = 'c'">
268 <xsl:if test="$cf007ss11 = 'h' and $cf007ss21 = 'd'">
271 <xsl:if test="$cf007ss11 = 'h' and $cf007ss21 = 'g'">
274 <xsl:if test="$cf007ss11 = 'm' and $cf007ss21 = 'c'">
277 <xsl:if test="$cf007ss11 = 'm' and $cf007ss21 = 'f'">
280 <xsl:if test="$cf007ss11 = 'm' and $cf007ss21 = 'r'">
283 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'n'">
284 <img src="/opac-tmpl/lib/famfamfam/chart_curve.png" alt="chart" class="format"/>
286 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'c'">
289 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'd'">
290 <img src="/opac-tmpl/lib/famfamfam/pencil.png" alt="drawing" class="format"/>
292 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'o'">
293 <img src="/opac-tmpl/lib/famfamfam/note.png" alt="flash card" class="format"/>
295 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'e'">
296 <img src="/opac-tmpl/lib/famfamfam/paintbrush.png" alt="painting" class="format"/>
298 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'f'">
299 photomechanical print
301 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'g'">
304 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'h'">
307 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'i'">
308 <img src="/opac-tmpl/lib/famfamfam/picture.png" alt="picture" class="format"/>
310 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'j'">
313 <xsl:if test="$cf007ss11 = 'k' and $cf007ss21 = 'l'">
316 <xsl:if test="$cf007ss11 = 'q' and $cf007ss21 = 'q'">
317 <img src="/opac-tmpl/lib/famfamfam/script.png" alt="notated music" class="format"/>
319 <xsl:if test="$cf007ss11 = 'g' and $cf007ss21 = 'd'">
322 <xsl:if test="$cf007ss11 = 'g' and $cf007ss21 = 'c'">
325 <xsl:if test="$cf007ss11 = 'g' and $cf007ss21 = 'o'">
328 <xsl:if test="$cf007ss11 = 'g' and $cf007ss21 = 'f'">
331 <xsl:if test="$cf007ss11 = 'g' and $cf007ss21 = 's'">
332 <img src="/opac-tmpl/lib/famfamfam/pictures.png" alt="slide" class="format"/>
334 <xsl:if test="$cf007ss11 = 'g' and $cf007ss21 = 't'">
337 <xsl:if test="$cf007ss11 = 'r' and $cf007ss21 = 'r'">
340 <xsl:if test="$cf007ss11 = 's' and $cf007ss21 = 'e'">
343 <xsl:if test="$cf007ss11 = 's' and $cf007ss21 = 'q'">
346 <xsl:if test="$cf007ss11 = 's' and $cf007ss21 = 'g'">
349 <xsl:if test="$cf007ss11 = 's' and $cf007ss21 = 's'">
352 <xsl:if test="$cf007ss11 = 's' and $cf007ss21 = 'd'">
353 <img src="/opac-tmpl/lib/famfamfam/cd.png" alt="sound disc" class="format"/>
355 <xsl:if test="$cf007ss11 = 's' and $cf007ss21 = 't'">
358 <xsl:if test="$cf007ss11 = 's' and $cf007ss21 = 'i'">
361 <xsl:if test="$cf007ss11 = 's' and $cf007ss21 = 'w'">
364 <xsl:if test="$cf007ss11 = 'f' and $cf007ss21 = 'c'">
367 <xsl:if test="$cf007ss11 = 'f' and $cf007ss21 = 'b'">
370 <xsl:if test="$cf007ss11 = 'f' and $cf007ss21 = 'a'">
373 <xsl:if test="$cf007ss11 = 'f' and $cf007ss21 = 'd'">
374 tactile, with no writing system
376 <xsl:if test="$cf007ss11 = 't' and $cf007ss21 = 'c'">
379 <xsl:if test="$cf007ss11 = 't' and $cf007ss21 = 'b'">
380 <img src="/opac-tmpl/lib/famfamfam/magnifier.png" alt="large print" class="format"/>
382 <xsl:if test="$cf007ss11 = 't' and $cf007ss21 = 'a'">
385 <xsl:if test="$cf007ss11 = 't' and $cf007ss21 = 'd'">
386 text in looseleaf binder
388 <xsl:if test="$cf007ss11 = 'v' and $cf007ss21 = 'c'">
391 <xsl:if test="$cf007ss11 = 'v' and $cf007ss21 = 'f'">
394 <xsl:if test="$cf007ss11 = 'v' and $cf007ss21 = 'd'">
395 <img src="/opac-tmpl/lib/famfamfam/dvd.png" alt="videodisc" class="format"/>
397 <xsl:if test="$cf007ss11 = 'v' and $cf007ss21 = 'r'">
401 <xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q'][string-length(.)>1]">
402 <xsl:value-of select="."></xsl:value-of>
404 <xsl:for-each select="marc:datafield[@tag=300]">
405 <xsl:call-template name="subfieldSelect">
406 <xsl:with-param name="codes">abce</xsl:with-param>
412 <!-- Title Statement: Alternate Graphic Representation (MARC 880) -->
413 <xsl:if test="$display880">
414 <xsl:call-template name="m880Select">
415 <xsl:with-param name="basetags">245</xsl:with-param>
416 <xsl:with-param name="codes">abhfgknps</xsl:with-param>
417 <xsl:with-param name="bibno"><xsl:value-of select="$biblionumber"/></xsl:with-param>
422 <xsl:attribute name="href">
423 <xsl:call-template name="buildBiblioDefaultViewURL">
424 <xsl:with-param name="BiblioDefaultView">
425 <xsl:value-of select="$BiblioDefaultView"/>
428 <xsl:value-of select="str:encode-uri($biblionumber, true())"/>
430 <xsl:attribute name="class"><xsl:value-of select="'title'" /></xsl:attribute>
432 <xsl:if test="marc:datafield[@tag=245]">
433 <xsl:for-each select="marc:datafield[@tag=245]">
434 <xsl:call-template name="subfieldSelect">
435 <xsl:with-param name="codes">a</xsl:with-param>
437 <xsl:text> </xsl:text>
438 <!-- 13381 add additional subfields-->
439 <!-- bz 17625 adding subfields f and g -->
440 <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
442 <xsl:when test="@code='h'">
443 <!-- 13381 Span class around subfield h so it can be suppressed via css -->
444 <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
446 <xsl:when test="@code='c'">
447 <!-- 13381 Span class around subfield c so it can be suppressed via css -->
448 <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
451 <xsl:apply-templates/>
452 <xsl:text> </xsl:text>
461 <xsl:variable name="OPACShowOpenURL" select="marc:sysprefs/marc:syspref[@name='OPACShowOpenURL']" />
462 <xsl:variable name="OpenURLImageLocation" select="marc:sysprefs/marc:syspref[@name='OpenURLImageLocation']" />
463 <xsl:variable name="OpenURLText" select="marc:sysprefs/marc:syspref[@name='OpenURLText']" />
464 <xsl:variable name="OpenURLResolverURL" select="marc:variables/marc:variable[@name='OpenURLResolverURL']" />
466 <xsl:if test="$OPACShowOpenURL = 1 and $OpenURLResolverURL != ''">
467 <xsl:variable name="openurltext">
469 <xsl:when test="$OpenURLText != ''">
470 <xsl:value-of select="$OpenURLText" />
473 <xsl:text>OpenURL</xsl:text>
478 <div class="results_summary"><a>
479 <xsl:attribute name="href">
480 <xsl:value-of select="$OpenURLResolverURL" />
482 <xsl:attribute name="title">
483 <xsl:value-of select="$openurltext" />
485 <xsl:attribute name="class">
486 <xsl:text>OpenURL</xsl:text>
488 <xsl:if test="$OPACURLOpenInNewWindow='1'">
489 <xsl:attribute name="target">
490 <xsl:text>_blank</xsl:text>
494 <xsl:when test="$OpenURLImageLocation != ''">
496 <xsl:attribute name="src">
497 <xsl:value-of select="$OpenURLImageLocation" />
502 <xsl:value-of select="$openurltext" />
507 <!-- End of OpenURL -->
509 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
510 <xsl:if test="$display880">
511 <xsl:call-template name="m880Select">
512 <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
513 <xsl:with-param name="codes">abc</xsl:with-param>
518 <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]">
520 <span class="byAuthor">by</span><xsl:text> </xsl:text>
521 <ul class="author resource_list">
523 <xsl:for-each select="marc:datafield[(@tag=100 or @tag=700 or @tag=110 or @tag=710 or @tag=111 or @tag=711) and @ind1!='z']">
527 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
528 <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>
531 <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>
534 <xsl:call-template name="chopPunctuation">
535 <xsl:with-param name="chopString">
536 <xsl:call-template name="subfieldSelect">
537 <xsl:with-param name="codes">
539 <!-- #13383 include subfield e for field 111 -->
540 <xsl:when test="@tag=111 or @tag=711">aeq</xsl:when>
541 <xsl:when test="@tag=110 or @tag=710">ab</xsl:when>
542 <xsl:otherwise>abcjq</xsl:otherwise>
547 <xsl:with-param name="punctuation">
548 <xsl:text>:,;/ </xsl:text>
551 <!-- Display title portion for 110 and 710 fields -->
552 <xsl:if test="(@tag=110 or @tag=710) and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
553 <span class="titleportion">
555 <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
556 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
558 <xsl:call-template name="chopPunctuation">
559 <xsl:with-param name="chopString">
560 <xsl:call-template name="subfieldSelect">
561 <xsl:with-param name="codes">cdnt</xsl:with-param>
567 <!-- Display title portion for 111 and 711 fields -->
568 <xsl:if test="(@tag=111 or @tag=711) and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
569 <span class="titleportion">
571 <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>
572 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
575 <xsl:call-template name="chopPunctuation">
576 <xsl:with-param name="chopString">
577 <xsl:call-template name="subfieldSelect">
578 <xsl:with-param name="codes">cdgnt</xsl:with-param>
584 <!-- Display dates for 100 and 700 fields -->
585 <xsl:if test="(@tag=100 or @tag=700) and marc:subfield[@code='d']">
586 <span class="authordates">
587 <xsl:text>, </xsl:text>
588 <xsl:call-template name="chopPunctuation">
589 <xsl:with-param name="chopString">
590 <xsl:call-template name="subfieldSelect">
591 <xsl:with-param name="codes">d</xsl:with-param>
597 <!-- Display title portion for 100 and 700 fields -->
598 <xsl:if test="@tag=700 and marc:subfield[@code='t']">
599 <span class="titleportion">
600 <xsl:text>. </xsl:text>
601 <xsl:call-template name="chopPunctuation">
602 <xsl:with-param name="chopString">
603 <xsl:call-template name="subfieldSelect">
604 <xsl:with-param name="codes">t</xsl:with-param>
610 <!-- Display relators for 1XX and 7XX fields -->
611 <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])">
612 <span class="relatorcode">
613 <xsl:text> [</xsl:text>
615 <xsl:when test="@tag=111 or @tag=711">
617 <!-- Prefer j over 4 for 111 and 711 -->
618 <xsl:when test="marc:subfield[@code='j']">
619 <xsl:for-each select="marc:subfield[@code='j']">
620 <xsl:value-of select="."/>
621 <xsl:if test="position() != last()">, </xsl:if>
625 <xsl:for-each select="marc:subfield[@code=4]">
626 <xsl:value-of select="."/>
627 <xsl:if test="position() != last()">, </xsl:if>
632 <!-- Prefer e over 4 on 100 and 110 -->
633 <xsl:when test="marc:subfield[@code='e']">
634 <xsl:for-each select="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]">
635 <xsl:value-of select="."/>
636 <xsl:if test="position() != last()">, </xsl:if>
640 <xsl:for-each select="marc:subfield[@code=4]">
641 <xsl:value-of select="."/>
642 <xsl:if test="position() != last()">, </xsl:if>
646 <xsl:text>]</xsl:text>
656 <xsl:call-template name="show-series">
657 <xsl:with-param name="searchurl">/cgi-bin/koha/opac-search.pl</xsl:with-param>
658 <xsl:with-param name="UseControlNumber" select="$UseControlNumber"/>
659 <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
662 <xsl:if test="marc:datafield[@tag=250]">
663 <div class="results_summary edition">
664 <span class="label">Edition: </span>
665 <xsl:for-each select="marc:datafield[@tag=250]">
666 <xsl:call-template name="subfieldSelect">
667 <xsl:with-param name="codes">ab</xsl:with-param>
673 <xsl:if test="$DisplayOPACiconsXSLT!='0'">
674 <div class="results_summary type">
675 <xsl:if test="$typeOf008!=''">
676 <span class="results_material_type">
677 <span class="label">Material type: </span>
679 <xsl:when test="$leader19='a'"><img src="/opac-tmpl/lib/famfamfam/ST.png" alt="Set" class="materialtype mt_icon_ST"/> Set</xsl:when>
680 <xsl:when test="$leader6='a'">
682 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'"><img src="/opac-tmpl/lib/famfamfam/BK.png" alt="Text" class="materialtype mt_icon_BK"/> Text</xsl:when>
683 <xsl:when test="$leader7='i' or $leader7='s'"><img src="/opac-tmpl/lib/famfamfam/SE.png" alt="Continuing resource" class="materialtype mt_icon_SE"/> Continuing resource</xsl:when>
684 <xsl:when test="$leader7='a' or $leader7='b'"><img src="/opac-tmpl/lib/famfamfam/AR.png" alt="Article" class="materialtype mt_icon_AR"/> Article</xsl:when>
687 <xsl:when test="$leader6='t'"><img src="/opac-tmpl/lib/famfamfam/BK.png" alt="Text" class="materialtype mt_icon_BK"/> Text</xsl:when>
688 <xsl:when test="$leader6='o'"><img src="/opac-tmpl/lib/famfamfam/MM.png" alt="Kit" class="materialtype mt_icon_MM"/> Kit</xsl:when>
689 <xsl:when test="$leader6='p'"><img src="/opac-tmpl/lib/famfamfam/MM.png" alt="Mixed materials" class="materialtype mt_icon_MM"/>Mixed materials</xsl:when>
690 <xsl:when test="$leader6='m'"><img src="/opac-tmpl/lib/famfamfam/CF.png" alt="Computer file" class="materialtype mt_icon_CF"/> Computer file</xsl:when>
691 <xsl:when test="$leader6='e' or $leader6='f'"><img src="/opac-tmpl/lib/famfamfam/MP.png" alt="Map" class="materialtype mt_icon_MP"/> Map</xsl:when>
692 <xsl:when test="$leader6='g'"><img src="/opac-tmpl/lib/famfamfam/VM.png" alt="Film" class="materialtype mt_icon_VM"/> Film</xsl:when>
693 <xsl:when test="$leader6='k'"><img src="/opac-tmpl/lib/famfamfam/GR.png" alt="Picture" class="materialtype mt_icon_GR"/> Picture</xsl:when>
694 <xsl:when test="$leader6='r'"><img src="/opac-tmpl/lib/famfamfam/OB.png" alt="Object" class="materialtype mt_icon_OB"/> Object</xsl:when>
695 <xsl:when test="$leader6='c' or $leader6='d'"><img src="/opac-tmpl/lib/famfamfam/PR.png" alt="Score" class="materialtype mt_icon_PR"/> Score</xsl:when>
696 <xsl:when test="$leader6='i'"><img src="/opac-tmpl/lib/famfamfam/MU.png" alt="Sound" class="materialtype mt_icon_MU"/> Sound</xsl:when>
697 <xsl:when test="$leader6='j'"><img src="/opac-tmpl/lib/famfamfam/PR.png" alt="Music" class="materialtype mt_icon_PR"/> Music</xsl:when>
701 <xsl:if test="string-length(normalize-space($physicalDescription))">
702 <span class="results_format">
703 <span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of>
707 <xsl:if test="$controlField008-21 or $controlField008-22 or $controlField008-24 or $controlField008-26 or $controlField008-29 or $controlField008-34 or $controlField008-33 or $controlField008-30-31 or $controlField008-33">
709 <xsl:if test="$typeOf008='CR'">
710 <span class="results_typeofcontinuing">
711 <xsl:if test="$controlField008-21 and $controlField008-21 !='|' and $controlField008-21 !=' '">
712 <span class="label">; Type of continuing resource: </span>
715 <xsl:when test="$controlField008-21='d'">
716 <img src="/opac-tmpl/lib/famfamfam/database.png" alt="database" class="format"/>
718 <xsl:when test="$controlField008-21='l'">
721 <xsl:when test="$controlField008-21='m'">
724 <xsl:when test="$controlField008-21='n'">
727 <xsl:when test="$controlField008-21='p'">
730 <xsl:when test="$controlField008-21='w'">
731 <img src="/opac-tmpl/lib/famfamfam/world_link.png" alt="web site" class="format"/>
736 <xsl:if test="$typeOf008='BK' or $typeOf008='CR'">
737 <xsl:if test="contains($controlField008-24,'abcdefghijklmnopqrstvwxyz')">
738 <span class="results_natureofcontents">
739 <span class="label">; Nature of contents: </span>
741 <xsl:when test="contains($controlField008-24,'a')">
744 <xsl:when test="contains($controlField008-24,'b')">
746 <img src="/opac-tmpl/lib/famfamfam/text_list_bullets.png" alt="bibliography" class="natureofcontents"/>
748 <xsl:when test="contains($controlField008-24,'c')">
751 <xsl:when test="contains($controlField008-24,'d')">
754 <xsl:when test="contains($controlField008-24,'e')">
757 <xsl:when test="contains($controlField008-24,'f')">
760 <xsl:when test="contains($controlField008-24,'g')">
763 <xsl:when test="contains($controlField008-24,'i')">
766 <xsl:when test="contains($controlField008-24,'k')">
769 <xsl:when test="contains($controlField008-24,'l')">
772 <xsl:when test="contains($controlField008-24,'m')">
775 <xsl:when test="contains($controlField008-24,'n')">
778 <xsl:when test="contains($controlField008-24,'o')">
781 <xsl:when test="contains($controlField008-24,'p')">
784 <xsl:when test="contains($controlField008-24,'q')">
787 <xsl:when test="contains($controlField008-24,'r')">
790 <xsl:when test="contains($controlField008-24,'s')">
793 <xsl:when test="contains($controlField008-24,'t')">
794 <img src="/opac-tmpl/lib/famfamfam/report.png" alt="technical report" class="natureofcontents"/>
796 <xsl:when test="contains($controlField008-24,'v')">
797 legal case and case notes
799 <xsl:when test="contains($controlField008-24,'w')">
802 <xsl:when test="contains($controlField008-24,'z')">
807 <xsl:when test="$controlField008-29='1'">
808 conference publication
814 <xsl:if test="$typeOf008='CF'">
815 <span class="results_typeofcomp">
816 <xsl:if test="$controlField008-26='a' or $controlField008-26='e' or $controlField008-26='f' or $controlField008-26='g'">
817 <span class="label">; Type of computer file: </span>
820 <xsl:when test="$controlField008-26='a'">
823 <xsl:when test="$controlField008-26='e'">
824 <img src="/opac-tmpl/lib/famfamfam/database.png" alt="database" class="format"/>
826 <xsl:when test="$controlField008-26='f'">
827 <img src="/opac-tmpl/lib/famfamfam/font.png" alt="font" class="format"/>
829 <xsl:when test="$controlField008-26='g'">
830 <img src="/opac-tmpl/lib/famfamfam/controller.png" alt="game" class="format"/>
835 <xsl:if test="$typeOf008='BK'">
836 <span class="results_contents_literary">
837 <xsl:if test="(substring($controlField008,25,1)='j') or (substring($controlField008,25,1)='1') or ($controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d')">
838 <span class="label">; Nature of contents: </span>
840 <xsl:if test="substring($controlField008,25,1)='j'">
843 <xsl:if test="substring($controlField008,31,1)='1'">
846 <xsl:if test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
847 <img src="/opac-tmpl/lib/famfamfam/user.png" alt="biography" class="natureofcontents"/>
850 <xsl:if test="$controlField008-33 and $controlField008-33!='|' and $controlField008-33!='u' and $controlField008-33!=' '">
851 <span class="label">; Literary form: </span>
854 <xsl:when test="$controlField008-33='0'">
857 <xsl:when test="$controlField008-33='1'">
860 <xsl:when test="$controlField008-33='d'">
863 <xsl:when test="$controlField008-33='e'">
866 <xsl:when test="$controlField008-33='f'">
869 <xsl:when test="$controlField008-33='h'">
872 <xsl:when test="$controlField008-33='i'">
875 <xsl:when test="$controlField008-33='j'">
878 <xsl:when test="$controlField008-33='m'">
881 <xsl:when test="$controlField008-33='p'">
884 <xsl:when test="$controlField008-33='s'">
890 <xsl:if test="$typeOf008='MU' and $controlField008-30-31 and $controlField008-30-31!='||' and $controlField008-30-31!=' '">
891 <span class="results_literaryform">
892 <span class="label">; Literary form: </span> <!-- Literary text for sound recordings -->
893 <xsl:if test="contains($controlField008-30-31,'b')">
896 <xsl:if test="contains($controlField008-30-31,'c')">
897 conference publication
899 <xsl:if test="contains($controlField008-30-31,'d')">
902 <xsl:if test="contains($controlField008-30-31,'e')">
905 <xsl:if test="contains($controlField008-30-31,'f')">
908 <xsl:if test="contains($controlField008-30-31,'o')">
911 <xsl:if test="contains($controlField008-30-31,'h')">
914 <xsl:if test="contains($controlField008-30-31,'k')">
917 <xsl:if test="contains($controlField008-30-31,'m')">
920 <xsl:if test="contains($controlField008-30-31,'p')">
923 <xsl:if test="contains($controlField008-30-31,'r')">
926 <xsl:if test="contains($controlField008-30-31,'g')">
929 <xsl:if test="contains($controlField008-30-31,'s')">
932 <xsl:if test="contains($controlField008-30-31,'l')">
937 <xsl:if test="$typeOf008='VM'">
938 <span class="results_typeofvisual">
939 <span class="label">; Type of visual material: </span>
941 <xsl:when test="$controlField008-33='a'">
944 <xsl:when test="$controlField008-33='b'">
947 <xsl:when test="$controlField008-33='c'">
950 <xsl:when test="$controlField008-33='d'">
953 <xsl:when test="$controlField008-33='f'">
956 <xsl:when test="$controlField008-33='g'">
959 <xsl:when test="$controlField008-33='i'">
962 <xsl:when test="$controlField008-33='k'">
965 <xsl:when test="$controlField008-33='l'">
968 <xsl:when test="$controlField008-33='m'">
971 <xsl:when test="$controlField008-33='n'">
974 <xsl:when test="$controlField008-33='o'">
977 <xsl:when test="$controlField008-33='p'">
980 <xsl:when test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
983 <xsl:when test="$controlField008-33='r'">
986 <xsl:when test="$controlField008-33='s'">
989 <xsl:when test="$controlField008-33='t'">
992 <xsl:when test="$controlField008-33='v'">
995 <xsl:when test="$controlField008-33='w'">
1003 <xsl:if test="($typeOf008='BK' or $typeOf008='CF' or $typeOf008='MU' or $typeOf008='VM') and ($controlField008-22='a' or $controlField008-22='b' or $controlField008-22='c' or $controlField008-22='d' or $controlField008-22='e' or $controlField008-22='g' or $controlField008-22='j' or $controlField008-22='f')">
1004 <span class="results_audience">
1005 <span class="label">; Audience: </span>
1007 <xsl:when test="$controlField008-22='a'">
1010 <xsl:when test="$controlField008-22='b'">
1013 <xsl:when test="$controlField008-22='c'">
1016 <xsl:when test="$controlField008-22='d'">
1019 <xsl:when test="$controlField008-22='e'">
1022 <xsl:when test="$controlField008-22='g'">
1025 <xsl:when test="$controlField008-22='j'">
1028 <xsl:when test="$controlField008-22='f'">
1034 <xsl:text> </xsl:text> <!-- added blank space to fix font display problem, see Bug 3671 -->
1038 <xsl:call-template name="show-lang-041"/>
1040 <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
1041 <xsl:if test="$display880">
1042 <xsl:call-template name="m880Select">
1043 <xsl:with-param name="basetags">260</xsl:with-param>
1044 <xsl:with-param name="codes">abcg</xsl:with-param>
1045 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
1046 <xsl:with-param name="label">Publication details: </xsl:with-param>
1047 </xsl:call-template>
1050 <!-- Publisher or Distributor Number -->
1051 <xsl:if test="marc:datafield[@tag=028]">
1052 <div class="results_summary publisher_number ">
1053 <span class="label">Publisher number: </span>
1054 <ul class="resource_list">
1055 <xsl:for-each select="marc:datafield[@tag=028]">
1057 <xsl:call-template name="subfieldSelect">
1058 <xsl:with-param name="codes">abq</xsl:with-param>
1059 </xsl:call-template>
1066 <!-- Publisher info and RDA related info from tags 260, 264 -->
1068 <xsl:when test="marc:datafield[@tag=264]">
1069 <xsl:call-template name="showRDAtag264"/>
1071 <xsl:when test="marc:datafield[@tag=260]">
1072 <div class="results_summary publisher"><span class="label">Publication details: </span>
1073 <xsl:for-each select="marc:datafield[@tag=260]">
1074 <xsl:if test="marc:subfield[@code='a']">
1075 <span class="publisher_place" property="location">
1076 <xsl:call-template name="subfieldSelect">
1077 <xsl:with-param name="codes">a</xsl:with-param>
1078 </xsl:call-template>
1081 <xsl:text> </xsl:text>
1082 <xsl:if test="marc:subfield[@code='b']">
1083 <span property="name" class="publisher_name">
1084 <xsl:call-template name="subfieldSelect">
1085 <xsl:with-param name="codes">b</xsl:with-param>
1086 </xsl:call-template>
1089 <xsl:text> </xsl:text>
1090 <span property="datePublished" class="publisher_date">
1091 <xsl:call-template name="chopPunctuation">
1092 <xsl:with-param name="chopString">
1093 <xsl:call-template name="subfieldSelect">
1094 <xsl:with-param name="codes">cg</xsl:with-param>
1095 </xsl:call-template>
1097 </xsl:call-template>
1099 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
1101 <xsl:if test="marc:datafield[@tag=264]">
1102 <xsl:text>; </xsl:text>
1103 <xsl:call-template name="showRDAtag264"/>
1109 <!-- Dissertation note -->
1110 <xsl:if test="marc:datafield[@tag=502]">
1111 <div class="results_summary diss_note">
1112 <span class="label">Dissertation note: </span>
1113 <xsl:for-each select="marc:datafield[@tag=502]">
1114 <xsl:call-template name="subfieldSelect">
1115 <xsl:with-param name="codes">abcdgo</xsl:with-param>
1116 </xsl:call-template>
1118 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
1122 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
1123 <xsl:if test="$display880">
1124 <xsl:call-template name="m880Select">
1125 <xsl:with-param name="basetags">246</xsl:with-param>
1126 <xsl:with-param name="codes">ab</xsl:with-param>
1127 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
1128 <xsl:with-param name="label">Other title: </xsl:with-param>
1129 </xsl:call-template>
1132 <xsl:if test="marc:datafield[@tag=246]">
1133 <div class="results_summary other_title">
1134 <span class="label">Other title: </span>
1135 <ul class="resource_list">
1136 <xsl:for-each select="marc:datafield[@tag=246]">
1138 <xsl:call-template name="subfieldSelect">
1139 <xsl:with-param name="codes">ab</xsl:with-param>
1140 </xsl:call-template>
1146 <xsl:if test="marc:datafield[@tag=242]">
1147 <div class="results_summary translated_title">
1148 <span class="label">Title translated: </span>
1149 <xsl:for-each select="marc:datafield[@tag=242]">
1150 <xsl:call-template name="subfieldSelect">
1151 <xsl:with-param name="codes">abh</xsl:with-param>
1152 </xsl:call-template>
1153 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
1158 <xsl:call-template name="host-item-entries">
1159 <xsl:with-param name="UseControlNumber" select="$UseControlNumber"/>
1160 </xsl:call-template>
1162 <!-- Content Warning -->
1163 <xsl:variable name="ContentWarningField" select="marc:sysprefs/marc:syspref[@name='ContentWarningField']"/>
1164 <xsl:if test="marc:datafield[@tag=$ContentWarningField]">
1165 <span class="results_summary content_warning">
1166 <span class="label">Content warning: </span>
1167 <xsl:for-each select="marc:datafield[@tag=$ContentWarningField]">
1169 <xsl:when test="marc:subfield[@code='u']">
1171 <xsl:attribute name="href">
1172 <xsl:value-of select="marc:subfield[@code='u']"/>
1175 <xsl:when test="marc:subfield[@code='a']">
1176 <xsl:value-of select="marc:subfield[@code='a']"/>
1179 <xsl:value-of select="marc:subfield[@code='u']"/>
1183 <xsl:text> </xsl:text>
1185 <xsl:when test="not(marc:subfield[@code='u']) and marc:subfield[@code='a']">
1186 <xsl:value-of select="marc:subfield[@code='a']"/><xsl:text> </xsl:text>
1189 <xsl:call-template name="subfieldSelect">
1190 <xsl:with-param name="codes">bcdefghijklmnopqrstvwyz</xsl:with-param>
1191 </xsl:call-template>
1192 <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
1197 <xsl:if test="marc:datafield[@tag=856]">
1198 <div class="results_summary online_resources">
1199 <span class="label">Online access: </span>
1200 <ul class="resource_list">
1201 <xsl:for-each select="marc:datafield[@tag=856]">
1202 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
1203 <xsl:if test="$OPACURLOpenInNewWindow='0'">
1206 <xsl:when test="$OPACTrackClicks='track'">
1207 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
1209 <xsl:when test="$OPACTrackClicks='anonymous'">
1210 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
1213 <xsl:attribute name="href">
1214 <xsl:call-template name="AddMissingProtocol">
1215 <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/>
1216 <xsl:with-param name="indicator1" select="@ind1"/>
1217 <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/>
1218 </xsl:call-template>
1219 <xsl:value-of select="marc:subfield[@code='u']"/>
1224 <xsl:when test="($Show856uAsImage='Results' 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')">
1225 <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>
1227 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
1228 <xsl:call-template name="subfieldSelect">
1229 <xsl:with-param name="codes">y3z</xsl:with-param>
1230 </xsl:call-template>
1232 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
1234 <xsl:when test="$URLLinkText!=''">
1235 <xsl:value-of select="$URLLinkText"/>
1238 <xsl:text>Click here to access online</xsl:text>
1245 <xsl:if test="$OPACURLOpenInNewWindow='1'">
1246 <li><a target='_blank'>
1248 <xsl:when test="$OPACTrackClicks='track'">
1249 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
1251 <xsl:when test="$OPACTrackClicks='anonymous'">
1252 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
1255 <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
1259 <xsl:when test="($Show856uAsImage='Results' or $Show856uAsImage='Both') and ($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')">
1260 <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>
1262 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
1263 <xsl:call-template name="subfieldSelect">
1264 <xsl:with-param name="codes">y3z</xsl:with-param>
1265 </xsl:call-template>
1267 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
1269 <xsl:when test="$URLLinkText!=''">
1270 <xsl:value-of select="$URLLinkText"/>
1273 <xsl:text>Click here to access online</xsl:text>
1285 <!-- Availability line -->
1286 <div class="results_summary availability">
1288 <xsl:variable name="item_status_list">
1289 <status english="Checked out">Checked out</status>
1290 <status english="Withdrawn">Withdrawn</status>
1291 <status english="Lost">Lost</status>
1292 <status english="Damaged">Damaged</status>
1293 <status english="Pending hold">Pending hold</status>
1294 <status english="In transit">In transit</status>
1295 <status english="Hold waiting">On hold</status>
1296 <status english="Recall waiting">Waiting recall</status>
1297 <status english="Not for loan">Not for loan</status>
1300 <span class="label">Availability: </span>
1303 <!-- When there are no items, try alternate holdings -->
1304 <xsl:when test="$itemcount=0">
1306 <xsl:when test="string-length($AlternateHoldingsField)=3 and marc:datafield[@tag=$AlternateHoldingsField]">
1307 <xsl:variable name="AlternateHoldingsCount" select="count(marc:datafield[@tag=$AlternateHoldingsField])"/>
1308 <xsl:for-each select="marc:datafield[@tag=$AlternateHoldingsField][1]">
1309 <xsl:call-template name="subfieldSelect">
1310 <xsl:with-param name="codes"><xsl:value-of select="$AlternateHoldingsSubfields"/></xsl:with-param>
1311 <xsl:with-param name="delimeter"><xsl:value-of select="$AlternateHoldingsSeparator"/></xsl:with-param>
1312 </xsl:call-template>
1314 (<xsl:value-of select="$AlternateHoldingsCount"/>)
1316 <xsl:otherwise><span class="noitems">No items available.</span> </xsl:otherwise>
1321 <xsl:variable name="sumAv" select="count(key('item-by-status', 'available'))"/>
1322 <xsl:variable name="sumRef" select="count(key('item-by-status', 'reference'))"/>
1324 <!-- Availability part 1: ITEMS FOR LOAN -->
1325 <xsl:if test="$sumAv>0"><span class="available reallyavailable">
1326 <span class="AvailabilityLabel"><strong><xsl:text>Items available for loan: </xsl:text></strong></span>
1327 <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
1328 <!-- group by branch, see also pref OPACResultsLibrary -->
1329 <xsl:for-each select="$available_items[not(items:resultbranch=preceding-sibling::*[items:status='available']/items:resultbranch)]">
1330 <xsl:sort select="items:resultbranch"/>
1331 <xsl:variable name="currentbranch" select="items:resultbranch"/>
1332 <span class="ItemSummary">
1333 <xsl:call-template name="listCallNumbers">
1334 <xsl:with-param name="items" select="$available_items[items:resultbranch=$currentbranch]"/>
1335 <xsl:with-param name="max" select="$OPACResultsMaxItems"/>
1336 <xsl:with-param name="status_text" select="$currentbranch"/>
1337 <xsl:with-param name="class_block" select="'available'"/>
1338 <xsl:with-param name="class_status" select="'ItemBranch'"/>
1339 <xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/>
1340 </xsl:call-template>
1345 <!-- Availability part 2: ITEMS FOR REFERENCE (see also pref Reference_NFL_Statuses) -->
1346 <xsl:if test="$sumRef>0"><span class="available reference">
1347 <span class="AvailabilityLabel"><strong><xsl:text>Items available for reference: </xsl:text></strong></span>
1348 <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1349 <!-- group by branch, then by substatus -->
1350 <xsl:for-each select="$reference_items[not(items:resultbranch=preceding-sibling::*[items:status='reference']/items:resultbranch)]">
1351 <xsl:sort select="items:resultbranch"/>
1352 <xsl:variable name="currentbranch" select="items:resultbranch"/>
1353 <xsl:for-each select="$reference_items[not(items:substatus=preceding-sibling::*[items:status='reference']/items:substatus)]">
1354 <xsl:sort select="items:substatus"/>
1355 <xsl:variable name="current_substatus" select="items:substatus"/>
1356 <span class="ItemSummary">
1357 <xsl:call-template name="listCallNumbers">
1358 <xsl:with-param name="items" select="$reference_items[items:resultbranch=$currentbranch and items:substatus=$current_substatus]"/>
1359 <xsl:with-param name="max" select="$OPACResultsMaxItems"/>
1360 <xsl:with-param name="status_text">
1361 <xsl:value-of select="concat($currentbranch,': ')"/>
1362 <xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/>
1363 <!-- Note that value-of here picks string value of first node only from the union; keep in mind too that current_substatus may contain an authorised value -->
1365 <xsl:with-param name="class_block" select="concat('notforloandesc_',$current_substatus)"/>
1366 <xsl:with-param name="class_status" select="'ItemBranch'"/>
1367 <xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/>
1368 </xsl:call-template>
1374 <!-- Availability part 3: UNAVAILABLE ITEMS (see also pref Reference_NFL_Statuses); status reallynotforloan or status other -->
1375 <xsl:if test="number($sumAv+$sumRef) < number($itemcount)"><span class="unavailable">
1376 <span class="AvailabilityLabel"><strong><xsl:text>Not available: </xsl:text></strong></span>
1377 <xsl:variable name="unavailable_items" select="key('item-by-status', 'reallynotforloan')|key('item-by-status', 'other')"/>
1379 <xsl:when test="$OPACResultsUnavailableGroupingBy='branch'">
1380 <!-- First group by branch -->
1381 <xsl:for-each select="items:items/items:item[not(items:resultbranch=preceding-sibling::*/items:resultbranch)]">
1382 <xsl:sort select="items:resultbranch"/>
1383 <xsl:variable name="currentbranch" select="items:resultbranch"/>
1384 <span class="ItemSummary unavailable">
1385 <!-- Within same branch, group by substatus -->
1386 <xsl:for-each select="$unavailable_items[not(items:substatus=preceding-sibling::*[items:status='reallynotforloan' or items:status='other']/items:substatus)]">
1387 <xsl:sort select="items:substatus"/>
1388 <xsl:variable name="current_substatus" select="items:substatus"/>
1389 <xsl:call-template name="listCallNumbers">
1390 <xsl:with-param name="items" select="$unavailable_items[items:resultbranch=$currentbranch and items:substatus=$current_substatus]"/>
1391 <xsl:with-param name="max" select="$OPACResultsMaxItemsUnavailable"/>
1392 <xsl:with-param name="status_text">
1393 <xsl:value-of select="$currentbranch"/>
1394 <xsl:text>: </xsl:text>
1395 <xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/><!-- See former comment on value-of and union -->
1397 <xsl:with-param name="class_block" select="concat('unavailable_',items:substatus)"/>
1398 <xsl:with-param name="class_status" select="'ItemBranch'"/>
1399 <xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/>
1400 </xsl:call-template>
1405 <xsl:when test="$OPACResultsUnavailableGroupingBy='substatus'">
1406 <!-- Only group by substatus, do not list branch names and individual call numbers. Meant for large consortia -->
1407 <xsl:for-each select="$unavailable_items[not(items:substatus=preceding-sibling::*[items:status='reallynotforloan' or items:status='other']/items:substatus)]">
1408 <xsl:sort select="items:substatus"/>
1409 <xsl:variable name="current_substatus" select="items:substatus"/>
1410 <xsl:call-template name="listCallNumbers">
1411 <xsl:with-param name="items" select="$unavailable_items[items:substatus=$current_substatus]"/>
1412 <xsl:with-param name="max" select="0"/>
1413 <xsl:with-param name="status_text">
1414 <xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/><!-- See former comment on value-of and union -->
1416 <xsl:with-param name="class_block" select="concat('unavailable_',$current_substatus)"/>
1417 <xsl:with-param name="class_status" select="UnavailableSubstatus"/>
1418 </xsl:call-template>
1421 <xsl:when test="$OPACResultsUnavailableGroupingBy='branchonly'">
1422 <!-- Only group by branch, do not list substatuses and individual call numbers -->
1423 <xsl:for-each select="items:items/items:item[not(items:resultbranch=preceding-sibling::*/items:resultbranch)]">
1424 <xsl:sort select="items:resultbranch"/>
1425 <xsl:variable name="currentbranch" select="items:resultbranch"/>
1426 <xsl:if test="count($unavailable_items[items:resultbranch=$currentbranch])>0">
1427 <span class="ItemSummary unavailable">
1428 <xsl:value-of select="$currentbranch"/>
1429 <span class="unavailable">
1430 <xsl:text> (</xsl:text>
1431 <xsl:value-of select="count($unavailable_items[items:resultbranch=$currentbranch])"/>
1432 <xsl:text>)</xsl:text>
1434 <xsl:text>. </xsl:text>
1445 <!-- End of Availability line -->
1449 <xsl:template name="nameABCQ">
1450 <xsl:call-template name="chopPunctuation">
1451 <xsl:with-param name="chopString">
1452 <xsl:call-template name="subfieldSelect">
1453 <xsl:with-param name="codes">abcq</xsl:with-param>
1454 </xsl:call-template>
1456 <xsl:with-param name="punctuation">
1457 <xsl:text>:,;/ </xsl:text>
1459 </xsl:call-template>
1462 <xsl:template name="nameABCDN">
1463 <xsl:call-template name="chopPunctuation">
1464 <xsl:with-param name="chopString">
1465 <xsl:call-template name="subfieldSelect">
1466 <xsl:with-param name="codes">abcdn</xsl:with-param>
1467 </xsl:call-template>
1469 <xsl:with-param name="punctuation">
1470 <xsl:text>:,;/ </xsl:text>
1472 </xsl:call-template>
1475 <xsl:template name="nameACDEQ">
1476 <xsl:call-template name="subfieldSelect">
1477 <xsl:with-param name="codes">acdeq</xsl:with-param>
1478 </xsl:call-template>
1481 <xsl:template name="nameDate">
1482 <xsl:for-each select="marc:subfield[@code='d']">
1483 <xsl:call-template name="chopPunctuation">
1484 <xsl:with-param name="chopString" select="."/>
1485 </xsl:call-template>
1489 <xsl:template name="role">
1490 <xsl:for-each select="marc:subfield[@code='e']">
1491 <xsl:value-of select="."/>
1493 <xsl:for-each select="marc:subfield[@code='4']">
1494 <xsl:value-of select="."/>
1498 <xsl:template name="specialSubfieldSelect">
1499 <xsl:param name="anyCodes"/>
1500 <xsl:param name="axis"/>
1501 <xsl:param name="beforeCodes"/>
1502 <xsl:param name="afterCodes"/>
1503 <xsl:variable name="str">
1504 <xsl:for-each select="marc:subfield">
1505 <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])">
1506 <xsl:value-of select="text()"/>
1507 <xsl:text> </xsl:text>
1511 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1514 <xsl:template name="subtitle">
1515 <xsl:if test="marc:subfield[@code='b']">
1516 <xsl:call-template name="chopPunctuation">
1517 <xsl:with-param name="chopString">
1518 <xsl:value-of select="marc:subfield[@code='b']"/>
1520 <!--<xsl:call-template name="subfieldSelect">
1521 <xsl:with-param name="codes">b</xsl:with-param>
1522 </xsl:call-template>-->
1524 </xsl:call-template>
1528 <xsl:template name="chopBrackets">
1529 <xsl:param name="chopString"></xsl:param>
1530 <xsl:variable name="string">
1531 <xsl:call-template name="chopPunctuation">
1532 <xsl:with-param name="chopString" select="$chopString"></xsl:with-param>
1533 </xsl:call-template>
1535 <xsl:if test="substring($string, 1,1)='['">
1536 <xsl:value-of select="substring($string,2, string-length($string)-2)"></xsl:value-of>
1538 <xsl:if test="substring($string, 1,1)!='['">
1539 <xsl:value-of select="$string"></xsl:value-of>
1543 <xsl:template name="listCallNumbers">
1544 <xsl:param name="items"/>
1545 <xsl:param name="max"/>
1546 <xsl:param name="status_text"/>
1547 <xsl:param name="class_block"/>
1548 <xsl:param name="class_status"/>
1549 <xsl:param name="OPACItemLocation"/>
1550 <xsl:if test="count($items)>0">
1551 <span><xsl:attribute name="class"><xsl:value-of select="$class_block"/></xsl:attribute>
1553 <xsl:attribute name="class"><xsl:value-of select="$class_status"/></xsl:attribute>
1554 <xsl:value-of select="$status_text"/>
1556 <xsl:text> (</xsl:text>
1557 <xsl:value-of select="count($items)"/>
1558 <xsl:text>)</xsl:text>
1559 <xsl:if test="$max>0 and count($items[items:itemcallnumber!=''])>0 and $OPACItemLocation!='library'">
1560 <span class="CallNumberAndLabel">
1561 <span class="LabelCallNumber">
1562 <xsl:if test="$OPACItemLocation='callnum'">Call number: </xsl:if>
1563 <xsl:if test="$OPACItemLocation='ccode'">Collection, call number: </xsl:if>
1564 <xsl:if test="$OPACItemLocation='location'">Location, call number: </xsl:if>
1566 <span class="CallNumber">
1567 <xsl:for-each select="$items[items:itemcallnumber!=''][position() <= $max]">
1568 <xsl:if test="$OPACItemLocation='location'">
1569 <strong><xsl:value-of select="concat(items:location,' ')"/></strong>
1571 <xsl:if test="$OPACItemLocation='ccode'">
1572 <strong><xsl:value-of select="concat(items:ccode,' ')"/></strong>
1574 <xsl:value-of select="items:itemcallnumber"/>
1575 <xsl:if test="position()!=last()">
1576 <xsl:text>, </xsl:text>
1578 <xsl:if test="position()=last() and (count($items)>$max or count($items[items:itemcallnumber=''])>0)">
1579 <xsl:text>, ..</xsl:text>
1585 <xsl:text>. </xsl:text>