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 = "xml" indent="yes" omit-xml-declaration = "yes" />
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']"/>
31 <xsl:if test="marc:datafield[@tag=200]">
32 <xsl:for-each select="marc:datafield[@tag=200]">
33 <xsl:call-template name="addClassRtl" />
34 <xsl:for-each select="marc:subfield">
36 <xsl:when test="@code='a'">
37 <xsl:variable name="title" select="."/>
38 <xsl:variable name="ntitle"
39 select="translate($title, 'ˆ‰˜œ','')"/>
41 <xsl:attribute name="href">
42 <xsl:text>/cgi-bin/koha/opac-detail.pl?biblionumber=</xsl:text>
43 <xsl:value-of select="$biblionumber"/>
45 <xsl:value-of select="$ntitle" />
48 <xsl:when test="@code='b'">
49 <xsl:text> [</xsl:text>
50 <xsl:value-of select="."/>
51 <xsl:text>]</xsl:text>
53 <xsl:when test="@code='d'">
54 <xsl:text> = </xsl:text>
55 <xsl:value-of select="."/>
57 <xsl:when test="@code='e'">
58 <xsl:text> : </xsl:text>
59 <xsl:value-of select="."/>
61 <xsl:when test="@code='f'">
62 <xsl:text> / </xsl:text>
63 <xsl:value-of select="."/>
65 <xsl:when test="@code='g'">
66 <xsl:text> ; </xsl:text>
67 <xsl:value-of select="."/>
70 <xsl:text>, </xsl:text>
71 <xsl:value-of select="."/>
78 <xsl:call-template name="tag_title">
79 <xsl:with-param name="tag">454</xsl:with-param>
80 <xsl:with-param name="label">Translation of</xsl:with-param>
83 <xsl:call-template name="tag_title">
84 <xsl:with-param name="tag">461</xsl:with-param>
85 <xsl:with-param name="label">Set Level</xsl:with-param>
88 <xsl:call-template name="tag_title">
89 <xsl:with-param name="tag">464</xsl:with-param>
90 <xsl:with-param name="label">Piece-Analytic Level</xsl:with-param>
93 <xsl:call-template name="tag_210" />
95 <xsl:call-template name="tag_215" />
97 <span class="results_summary">
98 <span class="label">Availability: </span>
100 <xsl:when test="marc:datafield[@tag=856]">
101 <xsl:for-each select="marc:datafield[@tag=856]">
103 <xsl:when test="@ind2=0">
105 <xsl:attribute name="href">
106 <xsl:value-of select="marc:subfield[@code='u']"/>
109 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
110 <xsl:call-template name="subfieldSelect">
111 <xsl:with-param name="codes">y3z</xsl:with-param>
114 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
115 Click here to access online
120 <xsl:when test="position()=last()"></xsl:when>
121 <xsl:otherwise> | </xsl:otherwise>
127 <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">
130 <xsl:when test="count(key('item-by-status', 'available'))>0">
131 <span class="available">
132 <b><xsl:text>Copies available for loan: </xsl:text></b>
133 <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
134 <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
135 <xsl:value-of select="items:homebranch"/>
136 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]
138 <xsl:text> (</xsl:text>
139 <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
140 <xsl:text>)</xsl:text>
142 <xsl:when test="position()=last()">
143 <xsl:text>. </xsl:text>
146 <xsl:text>, </xsl:text>
154 <xsl:when test="count(key('item-by-status', 'reference'))>0">
155 <span class="available">
156 <b><xsl:text>Copies available for reference: </xsl:text></b>
157 <xsl:variable name="reference_items"
158 select="key('item-by-status', 'reference')"/>
159 <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
160 <xsl:value-of select="items:homebranch"/>
161 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
162 <xsl:text> (</xsl:text>
163 <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
164 <xsl:text>)</xsl:text>
166 <xsl:when test="position()=last()">
167 <xsl:text>. </xsl:text>
170 <xsl:text>, </xsl:text>
177 <xsl:if test="count(key('item-by-status', 'Checked out'))>0">
178 <span class="unavailable">
179 <xsl:text>Checked out (</xsl:text>
180 <xsl:value-of select="count(key('item-by-status', 'Checked out'))"/>
181 <xsl:text>). </xsl:text>
184 <xsl:if test="count(key('item-by-status', 'Withdrawn'))>0">
185 <span class="unavailable">
186 <xsl:text>Withdrawn (</xsl:text>
187 <xsl:value-of select="count(key('item-by-status', 'Withdrawn'))"/>
188 <xsl:text>). </xsl:text>
191 <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0">
192 <span class="unavailable">
193 <xsl:text>Lost (</xsl:text>
194 <xsl:value-of select="count(key('item-by-status', 'Lost'))"/>
195 <xsl:text>). </xsl:text>
198 <xsl:if test="count(key('item-by-status', 'Damaged'))>0">
199 <span class="unavailable">
200 <xsl:text>Damaged (</xsl:text>
201 <xsl:value-of select="count(key('item-by-status', 'Damaged'))"/>
202 <xsl:text>). </xsl:text>
205 <xsl:if test="count(key('item-by-status', 'On Orangemanr'))>0">
206 <span class="unavailable">
207 <xsl:text>On order (</xsl:text>
208 <xsl:value-of select="count(key('item-by-status', 'On order'))"/>
209 <xsl:text>). </xsl:text>
212 <xsl:if test="count(key('item-by-status', 'In transit'))>0">
213 <span class="unavailable">
214 <xsl:text>In transit (</xsl:text>
215 <xsl:value-of select="count(key('item-by-status', 'In transit'))"/>
216 <xsl:text>). </xsl:text>
219 <xsl:if test="count(key('item-by-status', 'Waiting'))>0">
220 <span class="unavailable">
221 <xsl:text>On hold (</xsl:text>
222 <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/>
223 <xsl:text>). </xsl:text>