1 <?xml version="1.0" encoding="UTF-8"?>
3 <!DOCTYPE stylesheet [<!ENTITY nbsp " " >]>
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 exclude-result-prefixes="marc items">
11 <xsl:import href="UNIMARCslimUtils.xsl"/>
12 <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
13 <xsl:key name="item-by-status" match="items:item" use="items:status"/>
14 <xsl:key name="item-by-status-and-branch-home" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
15 <xsl:key name="item-by-status-and-branch-holding" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/>
17 <xsl:template match="/">
18 <xsl:apply-templates/>
21 <xsl:template match="marc:record">
22 <xsl:variable name="leader" select="marc:leader"/>
23 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
24 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
25 <xsl:variable name="biblionumber"
26 select="marc:datafield[@tag=090]/marc:subfield[@code='a']"/>
27 <xsl:variable name="isbn"
28 select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/>
29 <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/>
30 <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/>
31 <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
32 <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
33 <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
35 <xsl:if test="marc:datafield[@tag=200]">
36 <xsl:for-each select="marc:datafield[@tag=200]">
37 <xsl:call-template name="addClassRtl" />
38 <xsl:for-each select="marc:subfield">
40 <xsl:when test="@code='a'">
41 <xsl:variable name="title" select="."/>
42 <xsl:variable name="ntitle"
43 select="translate($title, 'ˆ‰˜œ','')"/>
45 <xsl:attribute name="href">
46 <xsl:call-template name="buildBiblioDefaultViewURL">
47 <xsl:with-param name="BiblioDefaultView">
48 <xsl:value-of select="$BiblioDefaultView"/>
51 <xsl:value-of select="$biblionumber"/>
53 <xsl:attribute name="class">title</xsl:attribute>
54 <xsl:value-of select="$ntitle" />
57 <xsl:when test="@code='b'">
58 <xsl:text> [</xsl:text>
59 <xsl:value-of select="."/>
60 <xsl:text>]</xsl:text>
62 <xsl:when test="@code='d'">
63 <xsl:text> = </xsl:text>
64 <xsl:value-of select="."/>
66 <xsl:when test="@code='e'">
67 <xsl:text> : </xsl:text>
68 <xsl:value-of select="."/>
70 <xsl:when test="@code='f'">
71 <xsl:text> / </xsl:text>
72 <xsl:value-of select="."/>
74 <xsl:when test="@code='g'">
75 <xsl:text> ; </xsl:text>
76 <xsl:value-of select="."/>
79 <xsl:text>, </xsl:text>
80 <xsl:value-of select="."/>
87 <xsl:call-template name="tag_title">
88 <xsl:with-param name="tag">454</xsl:with-param>
89 <xsl:with-param name="label">Translation of</xsl:with-param>
90 <xsl:with-param name="spanclass">original_title</xsl:with-param>
93 <xsl:call-template name="tag_title">
94 <xsl:with-param name="tag">461</xsl:with-param>
95 <xsl:with-param name="label">Set Level</xsl:with-param>
96 <xsl:with-param name="spanclass">set_level</xsl:with-param>
99 <xsl:call-template name="tag_title">
100 <xsl:with-param name="tag">464</xsl:with-param>
101 <xsl:with-param name="label">Piece-Analytic Level</xsl:with-param>
102 <xsl:with-param name="spanclass">piece_analytic_level</xsl:with-param>
105 <xsl:call-template name="tag_210" />
107 <xsl:call-template name="tag_215" />
109 <span class="results_summary availability">
110 <span class="label">Availability: </span>
112 <xsl:when test="marc:datafield[@tag=856]">
113 <xsl:for-each select="marc:datafield[@tag=856]">
115 <xsl:when test="@ind2=0">
117 <xsl:attribute name="href">
118 <xsl:value-of select="marc:subfield[@code='u']"/>
120 <xsl:if test="$OPACURLOpenInNewWindow='1'">
121 <xsl:attribute name="target">_blank</xsl:attribute>
124 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
125 <xsl:call-template name="subfieldSelect">
126 <xsl:with-param name="codes">y3z</xsl:with-param>
129 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
130 Click here to access online
135 <xsl:when test="position()=last()"></xsl:when>
136 <xsl:otherwise> | </xsl:otherwise>
142 <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">
145 <xsl:when test="count(key('item-by-status', 'available'))>0">
146 <span class="available">
147 <b><xsl:text>Items available for loan: </xsl:text></b>
148 <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
150 <xsl:when test="$singleBranchMode=1">
151 <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
152 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
153 <xsl:text> (</xsl:text>
154 <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
155 <xsl:text>)</xsl:text>
156 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
161 <xsl:when test="$OPACResultsLibrary='homebranch'">
162 <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
163 <xsl:value-of select="items:homebranch"/>
164 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]
166 <xsl:text> (</xsl:text>
167 <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
168 <xsl:text>)</xsl:text>
170 <xsl:when test="position()=last()">
171 <xsl:text>. </xsl:text>
174 <xsl:text>, </xsl:text>
180 <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
181 <xsl:value-of select="items:holdingbranch"/>
182 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]
184 <xsl:text> (</xsl:text>
185 <xsl:value-of select="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))"/>
186 <xsl:text>)</xsl:text>
188 <xsl:when test="position()=last()">
189 <xsl:text>. </xsl:text>
192 <xsl:text>, </xsl:text>
204 <xsl:when test="count(key('item-by-status', 'reference'))>0">
205 <span class="available">
206 <b><xsl:text>Items available for reference: </xsl:text></b>
207 <xsl:variable name="reference_items"
208 select="key('item-by-status', 'reference')"/>
209 <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
210 <xsl:if test="$singleBranchMode=0">
211 <xsl:value-of select="items:homebranch"/>
213 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
214 <xsl:text> (</xsl:text>
215 <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
216 <xsl:text>)</xsl:text>
218 <xsl:when test="position()=last()">
219 <xsl:text>. </xsl:text>
222 <xsl:text>, </xsl:text>
229 <xsl:if test="count(key('item-by-status', 'Checked out'))>0">
230 <span class="unavailable">
231 <xsl:text>Checked out (</xsl:text>
232 <xsl:value-of select="count(key('item-by-status', 'Checked out'))"/>
233 <xsl:text>). </xsl:text>
236 <xsl:if test="count(key('item-by-status', 'Withdrawn'))>0">
237 <span class="unavailable">
238 <xsl:text>Withdrawn (</xsl:text>
239 <xsl:value-of select="count(key('item-by-status', 'Withdrawn'))"/>
240 <xsl:text>). </xsl:text>
243 <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0">
244 <span class="unavailable">
245 <xsl:text>Lost (</xsl:text>
246 <xsl:value-of select="count(key('item-by-status', 'Lost'))"/>
247 <xsl:text>). </xsl:text>
250 <xsl:if test="count(key('item-by-status', 'Damaged'))>0">
251 <span class="unavailable">
252 <xsl:text>Damaged (</xsl:text>
253 <xsl:value-of select="count(key('item-by-status', 'Damaged'))"/>
254 <xsl:text>). </xsl:text>
257 <xsl:if test="count(key('item-by-status', 'On order'))>0">
258 <span class="unavailable">
259 <xsl:text>On order (</xsl:text>
260 <xsl:value-of select="count(key('item-by-status', 'On order'))"/>
261 <xsl:text>). </xsl:text>
264 <xsl:if test="count(key('item-by-status', 'In transit'))>0">
265 <span class="unavailable">
266 <xsl:text>In transit (</xsl:text>
267 <xsl:value-of select="count(key('item-by-status', 'In transit'))"/>
268 <xsl:text>). </xsl:text>
271 <xsl:if test="count(key('item-by-status', 'Waiting'))>0">
272 <span class="unavailable">
273 <xsl:text>On hold (</xsl:text>
274 <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/>
275 <xsl:text>). </xsl:text>