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" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
16 <xsl:template match="/">
17 <xsl:apply-templates/>
20 <xsl:template match="marc:record">
21 <xsl:variable name="leader" select="marc:leader"/>
22 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
23 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
24 <xsl:variable name="biblionumber"
25 select="marc:datafield[@tag=090]/marc:subfield[@code='a']"/>
26 <xsl:variable name="isbn"
27 select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/>
29 <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
30 <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
32 <xsl:if test="marc:datafield[@tag=200]">
33 <xsl:for-each select="marc:datafield[@tag=200]">
34 <xsl:call-template name="addClassRtl" />
35 <xsl:for-each select="marc:subfield">
37 <xsl:when test="@code='a'">
38 <xsl:variable name="title" select="."/>
39 <xsl:variable name="ntitle"
40 select="translate($title, 'ˆ‰˜œ','')"/>
42 <xsl:attribute name="href">
43 <xsl:text>/cgi-bin/koha/opac-detail.pl?biblionumber=</xsl:text>
44 <xsl:value-of select="$biblionumber"/>
46 <xsl:value-of select="$ntitle" />
49 <xsl:when test="@code='b'">
50 <xsl:text> [</xsl:text>
51 <xsl:value-of select="."/>
52 <xsl:text>]</xsl:text>
54 <xsl:when test="@code='d'">
55 <xsl:text> = </xsl:text>
56 <xsl:value-of select="."/>
58 <xsl:when test="@code='e'">
59 <xsl:text> : </xsl:text>
60 <xsl:value-of select="."/>
62 <xsl:when test="@code='f'">
63 <xsl:text> / </xsl:text>
64 <xsl:value-of select="."/>
66 <xsl:when test="@code='g'">
67 <xsl:text> ; </xsl:text>
68 <xsl:value-of select="."/>
71 <xsl:text>, </xsl:text>
72 <xsl:value-of select="."/>
79 <xsl:call-template name="tag_title">
80 <xsl:with-param name="tag">454</xsl:with-param>
81 <xsl:with-param name="label">Translation of</xsl:with-param>
84 <xsl:call-template name="tag_title">
85 <xsl:with-param name="tag">461</xsl:with-param>
86 <xsl:with-param name="label">Set Level</xsl:with-param>
89 <xsl:call-template name="tag_title">
90 <xsl:with-param name="tag">464</xsl:with-param>
91 <xsl:with-param name="label">Piece-Analytic Level</xsl:with-param>
94 <xsl:call-template name="tag_210" />
96 <xsl:call-template name="tag_215" />
98 <span class="results_summary">
99 <span class="label">Availability: </span>
101 <xsl:when test="marc:datafield[@tag=856]">
102 <xsl:for-each select="marc:datafield[@tag=856]">
104 <xsl:when test="@ind2=0">
106 <xsl:attribute name="href">
107 <xsl:value-of select="marc:subfield[@code='u']"/>
110 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
111 <xsl:call-template name="subfieldSelect">
112 <xsl:with-param name="codes">y3z</xsl:with-param>
115 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
116 Click here to access online
121 <xsl:when test="position()=last()"></xsl:when>
122 <xsl:otherwise> | </xsl:otherwise>
128 <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">
131 <xsl:when test="count(key('item-by-status', 'available'))>0">
132 <span class="available">
133 <b><xsl:text>Copies available for loan: </xsl:text></b>
134 <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
136 <xsl:when test="$singleBranchMode=1">
137 <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
138 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
139 <xsl:text> (</xsl:text>
140 <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
141 <xsl:text>)</xsl:text>
142 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
146 <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
147 <xsl:value-of select="items:homebranch"/>
148 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]
150 <xsl:text> (</xsl:text>
151 <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
152 <xsl:text>)</xsl:text>
154 <xsl:when test="position()=last()">
155 <xsl:text>. </xsl:text>
158 <xsl:text>, </xsl:text>
168 <xsl:when test="count(key('item-by-status', 'reference'))>0">
169 <span class="available">
170 <b><xsl:text>Copies available for reference: </xsl:text></b>
171 <xsl:variable name="reference_items"
172 select="key('item-by-status', 'reference')"/>
173 <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
174 <xsl:value-of select="items:homebranch"/>
175 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
176 <xsl:text> (</xsl:text>
177 <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
178 <xsl:text>)</xsl:text>
180 <xsl:when test="position()=last()">
181 <xsl:text>. </xsl:text>
184 <xsl:text>, </xsl:text>
191 <xsl:if test="count(key('item-by-status', 'Checked out'))>0">
192 <span class="unavailable">
193 <xsl:text>Checked out (</xsl:text>
194 <xsl:value-of select="count(key('item-by-status', 'Checked out'))"/>
195 <xsl:text>). </xsl:text>
198 <xsl:if test="count(key('item-by-status', 'Withdrawn'))>0">
199 <span class="unavailable">
200 <xsl:text>Withdrawn (</xsl:text>
201 <xsl:value-of select="count(key('item-by-status', 'Withdrawn'))"/>
202 <xsl:text>). </xsl:text>
205 <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0">
206 <span class="unavailable">
207 <xsl:text>Lost (</xsl:text>
208 <xsl:value-of select="count(key('item-by-status', 'Lost'))"/>
209 <xsl:text>). </xsl:text>
212 <xsl:if test="count(key('item-by-status', 'Damaged'))>0">
213 <span class="unavailable">
214 <xsl:text>Damaged (</xsl:text>
215 <xsl:value-of select="count(key('item-by-status', 'Damaged'))"/>
216 <xsl:text>). </xsl:text>
219 <xsl:if test="count(key('item-by-status', 'On order'))>0">
220 <span class="unavailable">
221 <xsl:text>On order (</xsl:text>
222 <xsl:value-of select="count(key('item-by-status', 'On order'))"/>
223 <xsl:text>). </xsl:text>
226 <xsl:if test="count(key('item-by-status', 'In transit'))>0">
227 <span class="unavailable">
228 <xsl:text>In transit (</xsl:text>
229 <xsl:value-of select="count(key('item-by-status', 'In transit'))"/>
230 <xsl:text>). </xsl:text>
233 <xsl:if test="count(key('item-by-status', 'Waiting'))>0">
234 <span class="unavailable">
235 <xsl:text>On hold (</xsl:text>
236 <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/>
237 <xsl:text>). </xsl:text>