print notice that member returned all books
[koha_fer] / koha-tmpl / opac-tmpl / prog / en / xslt / NORMARCslim2OPACDetail.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
4
5 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
6 <xsl:stylesheet version="1.0"
7   xmlns:marc="http://www.loc.gov/MARC21/slim"
8   xmlns:items="http://www.koha-community.org/items"
9   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10   exclude-result-prefixes="marc items">
11     <xsl:import href="NORMARCslimUtils.xsl"/>
12     <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
13     <xsl:template match="/">
14             <xsl:apply-templates/>
15     </xsl:template>
16
17     <xsl:template match="marc:record">
18
19         <!-- Sysprefs -->
20         <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
21         <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
22         <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
23         <xsl:variable name="TracingQuotesLeft">
24           <xsl:choose>
25             <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
26             <xsl:otherwise>"</xsl:otherwise>
27           </xsl:choose>
28         </xsl:variable>
29         <xsl:variable name="TracingQuotesRight">
30           <xsl:choose>
31             <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
32             <xsl:otherwise>"</xsl:otherwise>
33           </xsl:choose>
34         </xsl:variable>
35         <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
36
37         <xsl:variable name="leader" select="marc:leader"/>
38         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
39         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
40         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
41         <xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
42         <xsl:variable name="typeOf008">
43             <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
44             <xsl:choose>
45                 <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
46                 <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
47                 <xsl:when test="$field019b='c' or $field019b='d' or contains($field019b,'da') or contains($field019b,'db') or contains($field019b,'dc') or contains($field019b,'dd') or contains($field019b,'dg') or contains($field019b,'dh') or contains($field019b,'di') or contains($field019b,'dj') or contains($field019b,'dk') or $leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Mus</xsl:when>
48                 <xsl:when test="$field019b='a' or contains($field019b,'ab') or contains($field019b,'aj') or $leader6='e' or $leader6='f'">Kar</xsl:when>
49                 <xsl:when test="$field019b='f' or $field019b='i' or contains($field019b,'ib') or contains($field019b,'ic') or contains($field019b,'fd') or contains($field019b,'ff') or contains($field019b,'fi') or $leader6='k'">gra</xsl:when>
50                 <xsl:when test="$field019b='g' or contains($field019b,'gb') or contains($field019b,'gd') or contains($field019b,'ge') or $leader6='m'">Fil</xsl:when>
51                 <xsl:when test="$leader6='o'">kom</xsl:when>
52                 <xsl:when test="$field019b='h' or $leader6='r'">trd</xsl:when>
53                 <xsl:when test="$field019b='j' or $leader6='a'">
54                     <xsl:choose>
55                         <xsl:when test="$leader7='a' or $leader7='c' or $leader7='m' or $leader7='p'">Mon</xsl:when>
56                         <xsl:when test="$field019b='j' or $leader7='b' or $leader7='s'">Per</xsl:when>
57                     </xsl:choose>
58                 </xsl:when>
59             </xsl:choose>
60         </xsl:variable>
61
62         <!-- Tittel og ansvarsopplysninger -->
63         <xsl:if test="marc:datafield[@tag=245]">
64         <h1 class="title">
65             <xsl:for-each select="marc:datafield[@tag=245]">
66                     <xsl:call-template name="subfieldSelect">
67                         <xsl:with-param name="codes">a</xsl:with-param>
68                     </xsl:call-template>
69                     <xsl:if test="marc:subfield[@code='h']">
70                         <xsl:text> </xsl:text>
71                         (<xsl:call-template name="subfieldSelect">
72                             <xsl:with-param name="codes">h</xsl:with-param>
73                         </xsl:call-template>) 
74                     </xsl:if>
75                     <xsl:if test="marc:subfield[@code='b']">
76                         <xsl:text> : </xsl:text>
77                         <xsl:call-template name="subfieldSelect">
78                             <xsl:with-param name="codes">b</xsl:with-param>
79                         </xsl:call-template>
80                     </xsl:if>
81                     <xsl:text> </xsl:text>
82                     <xsl:call-template name="subfieldSelect">
83                         <xsl:with-param name="codes">np</xsl:with-param>
84                     </xsl:call-template>
85             </xsl:for-each>
86         </h1>
87         </xsl:if>
88
89         <!-- Author Statement -->
90                 <!-- 245$9 is Koha authority number --> 
91         <xsl:choose>
92         <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]">
93         <h5 class="author">av
94         <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
95         <a>
96         <xsl:choose>
97             <xsl:when test="marc:subfield[@code=9]">
98                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
99             </xsl:when>
100             <xsl:otherwise>
101             <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
102             </xsl:otherwise>
103         </xsl:choose>
104         <xsl:call-template name="nameABCDQ"/></a>
105         <xsl:if test="marc:subfield[@code=9]">
106             <a class='authlink'>
107                 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
108                 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
109             </a>
110         </xsl:if>
111         <xsl:choose>
112         <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
113         </xsl:for-each>
114
115         <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]">
116         <a>
117         <xsl:choose>
118             <xsl:when test="marc:subfield[@code=9]">
119                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
120             </xsl:when>
121             <xsl:otherwise>
122             <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>      
123             </xsl:otherwise>
124         </xsl:choose>
125         <xsl:call-template name="nameABCDN"/></a>
126         <xsl:if test="marc:subfield[@code=9]">
127             <a class='authlink'>
128                 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
129                 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
130             </a>
131         </xsl:if>
132         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
133         </xsl:for-each>
134
135         <xsl:for-each select="marc:datafield[@tag=111 or @tag=711]">
136         <a>
137         <xsl:choose>
138             <xsl:when test="marc:subfield[@code=9]">
139                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
140             </xsl:when>
141             <xsl:otherwise>
142             <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
143             </xsl:otherwise>
144         </xsl:choose>
145         <xsl:call-template name="nameACDEQ"/></a>
146         <xsl:if test="marc:subfield[@code=9]">
147             <a class='authlink'>
148                 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
149                 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
150             </a>
151         </xsl:if>
152         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
153
154         </xsl:for-each>
155         </h5>
156         </xsl:when>
157         </xsl:choose>
158
159     <xsl:if test="$DisplayOPACiconsXSLT!='0'">
160         <xsl:if test="$typeOf008!=''">
161         <span class="results_summary">
162             <span class="label">Materialtype: </span>
163             <xsl:choose>
164                 <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/lib/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
165                 <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/lib/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
166                 <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/lib/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
167                 <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/lib/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
168                 <xsl:when test="$typeOf008='FV'"><img  src="/opac-tmpl/lib/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
169                 <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/lib/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
170                 <xsl:when test="$typeOf008='gra'"><img src="/opac-tmpl/lib/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
171                 <xsl:when test="$typeOf008='kom'"><img src="/opac-tmpl/lib/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
172                 <xsl:when test="$typeOf008='trd'"><img src="/opac-tmpl/lib/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
173             </xsl:choose>
174         </span>
175         </xsl:if>
176     </xsl:if>
177
178         <!--Series -->
179         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
180                 <span class="results_summary"><span class="label">Series: </span>
181                 <xsl:for-each select="marc:datafield[@tag=440]">
182                      <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
183                     <xsl:call-template name="chopPunctuation">
184                                     <xsl:with-param name="chopString">
185                                         <xsl:call-template name="subfieldSelect">
186                                             <xsl:with-param name="codes">av</xsl:with-param>
187                                         </xsl:call-template>
188                                     </xsl:with-param>
189                                 </xsl:call-template>
190                                 </a>
191                             <xsl:text> </xsl:text><xsl:call-template name="part"/>
192                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
193                 </xsl:for-each>
194         
195                 <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
196                      <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
197                                 <xsl:call-template name="chopPunctuation">
198                                     <xsl:with-param name="chopString">
199                                         <xsl:call-template name="subfieldSelect">
200                                             <xsl:with-param name="codes">av</xsl:with-param>
201                                         </xsl:call-template>
202                                     </xsl:with-param>
203                                 </xsl:call-template>
204                     </a>
205                             <xsl:call-template name="part"/>
206                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
207                 </xsl:for-each>
208                 </span>
209         </xsl:if>
210
211         <!-- Analytics -->
212         <xsl:if test="$leader7='s' or $leader7='c'">
213         <span class="results_summary analytics"><span class="label">Analytics: </span>
214             <a>
215             <xsl:choose>
216             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
217                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
218             </xsl:when>
219             <xsl:otherwise>
220                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
221             </xsl:otherwise>
222             </xsl:choose>
223             <xsl:text>Show analytics</xsl:text>
224             </a>
225         </span>
226         </xsl:if>
227
228         <!-- 773 - Links from child to parent -->
229         <xsl:if test="marc:datafield[@tag=773]">
230         <xsl:for-each select="marc:datafield[@tag=773]">
231         <xsl:if test="@ind1=0">
232         <span class="results_summary in"><span class="label">
233         <xsl:choose>
234         <xsl:when test="@ind2=' '">
235             In:
236         </xsl:when>
237         <xsl:when test="@ind2=8">
238             <xsl:if test="marc:subfield[@code='i']">
239                 <xsl:value-of select="marc:subfield[@code='i']"/>
240             </xsl:if>
241         </xsl:when>
242         </xsl:choose>
243         </span>
244                 <xsl:variable name="f773">
245                     <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
246                         <xsl:with-param name="codes">a_t</xsl:with-param>
247                     </xsl:call-template></xsl:with-param></xsl:call-template>
248                 </xsl:variable>
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=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
252                         <xsl:value-of select="translate($f773, '()', '')"/>
253                     </a>
254                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
255                 </xsl:when>
256                 <xsl:when test="marc:subfield[@code='0']">
257                     <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
258                         <xsl:value-of select="$f773"/>
259                     </a>
260                 </xsl:when>
261                 <xsl:otherwise>
262                     <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
263                         <xsl:value-of select="$f773"/>
264                     </a>
265                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
266                 </xsl:otherwise>
267             </xsl:choose>
268         </span>
269         <xsl:if test="marc:subfield[@code='n']">
270             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
271         </xsl:if>
272         </xsl:if>
273         </xsl:for-each>
274         </xsl:if>
275
276         <!-- Publisher Statement -->
277         
278         <xsl:if test="marc:datafield[@tag=260]">
279         <span class="results_summary"><span class="label">Utgiver: </span>
280             <xsl:for-each select="marc:datafield[@tag=260]">
281                 <xsl:call-template name="chopPunctuation">
282                   <xsl:with-param name="chopString">
283                     <xsl:call-template name="subfieldSelect">
284                         <xsl:with-param name="codes">bcg</xsl:with-param>
285                     </xsl:call-template>
286                    </xsl:with-param>
287                </xsl:call-template>
288                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
289             </xsl:for-each>
290         </span> 
291         </xsl:if>
292
293         <!-- Edition Statement -->
294         
295         <xsl:if test="marc:datafield[@tag=250]">
296         <span class="results_summary"><span class="label">Utgave: </span>
297             <xsl:for-each select="marc:datafield[@tag=250]">
298                 <xsl:call-template name="chopPunctuation">
299                   <xsl:with-param name="chopString">
300                     <xsl:call-template name="subfieldSelect">
301                         <xsl:with-param name="codes">ab</xsl:with-param>
302                     </xsl:call-template>
303                    </xsl:with-param>
304                </xsl:call-template>
305                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
306             </xsl:for-each>
307         </span>
308         </xsl:if>
309
310         <!-- Description -->
311         
312         <xsl:if test="marc:datafield[@tag=300]">
313         <span class="results_summary"><span class="label">Beskrivelse: </span>
314             <xsl:for-each select="marc:datafield[@tag=300]">
315                 <xsl:call-template name="chopPunctuation">
316                   <xsl:with-param name="chopString">
317                     <xsl:call-template name="subfieldSelect">
318                         <xsl:with-param name="codes">abceg</xsl:with-param>
319                     </xsl:call-template>
320                    </xsl:with-param>
321                </xsl:call-template>
322                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
323             </xsl:for-each>
324         </span>
325        </xsl:if>
326
327        <abbr class="unapi-id" title="koha:biblionumber:{marc:datafield[@tag=999]/marc:subfield[@code='c']}" ><!-- unAPI --></abbr>
328
329        <xsl:if test="marc:datafield[@tag=020]">
330         <span class="results_summary"><span class="label">ISBN: </span>
331         <xsl:for-each select="marc:datafield[@tag=020]">
332         <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
333                 <xsl:value-of select="marc:subfield[@code='a']"/>
334                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
335         </xsl:for-each>
336         </span>
337         </xsl:if>
338
339         <xsl:if test="marc:datafield[@tag=022]">
340         <span class="results_summary"><span class="label">ISSN: </span>
341         <xsl:for-each select="marc:datafield[@tag=022]">
342                 <xsl:value-of select="marc:subfield[@code='a']"/>
343                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
344         </xsl:for-each>
345         </span>
346         </xsl:if>
347
348         <!-- Other Title  Statement -->
349
350         <xsl:if test="marc:datafield[@tag=246]">
351         <span class="results_summary"><span class="label">Parallelltittel: </span>
352             <xsl:for-each select="marc:datafield[@tag=246]">
353                 <xsl:call-template name="chopPunctuation">
354                   <xsl:with-param name="chopString">
355                     <xsl:call-template name="subfieldSelect">
356                         <xsl:with-param name="codes">abhfgnp</xsl:with-param>
357                     </xsl:call-template>
358                    </xsl:with-param>
359                </xsl:call-template>
360                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
361             </xsl:for-each>
362         </span>
363        </xsl:if>
364
365         <!-- Uniform Title  Statement -->
366
367         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
368         <span class="results_summary"><span class="label">Standardtittel: </span>
369         <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
370             <xsl:variable name="str">
371                 <xsl:for-each select="marc:subfield">
372                     <xsl:if test="(contains('adfklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))">
373                         <xsl:value-of select="text()"/>
374                         <xsl:text> </xsl:text>
375                      </xsl:if>
376                 </xsl:for-each>
377             </xsl:variable>
378             <xsl:call-template name="chopPunctuation">
379                 <xsl:with-param name="chopString">
380                     <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
381                         
382                 </xsl:with-param>
383             </xsl:call-template>
384             <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
385         </xsl:for-each>
386         </span>
387         </xsl:if>
388
389         <!-- Subjects -->
390
391         <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
392             <span class="results_summary subjects"><span class="label">Emne(r): </span>
393             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
394             <a>
395             <xsl:choose>
396             <!-- Will implement this later
397                 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
398                     <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
399                 </xsl:when>
400             -->
401             <xsl:when test="$TraceSubjectSubdivisions='1'">
402                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect">
403                         <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
404                         <xsl:with-param name="delimeter"> AND </xsl:with-param>
405                         <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
406                         <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
407                     </xsl:call-template>
408                 </xsl:attribute>
409             </xsl:when>
410             <xsl:otherwise>
411                 <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="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
412             </xsl:otherwise>
413             </xsl:choose>
414             <xsl:call-template name="chopPunctuation">
415                 <xsl:with-param name="chopString">
416                     <xsl:call-template name="subfieldSelect">
417                         <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
418                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
419                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
420                     </xsl:call-template>
421                 </xsl:with-param>
422             </xsl:call-template>
423             </a>
424             <xsl:if test="marc:subfield[@code=9]">
425                 <a class='authlink'>
426                     <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
427                     <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
428                 </a>
429             </xsl:if>
430             <xsl:choose>
431             <xsl:when test="position()=last()"></xsl:when>
432             <xsl:otherwise> | </xsl:otherwise>
433             </xsl:choose>
434
435             </xsl:for-each>
436             </span>
437         </xsl:if>
438
439         <xsl:if test="marc:datafield[@tag=856]">
440         <span class="results_summary"><span class="label">Nettbasert ressurs: </span>
441         <xsl:for-each select="marc:datafield[@tag=856]">
442             <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
443         <xsl:choose>
444             <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
445                     <xsl:call-template name="subfieldSelect">
446                         <xsl:with-param name="codes">y3z</xsl:with-param>
447                     </xsl:call-template>
448             </xsl:when>
449         <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
450         Klikk her for tilgang
451         </xsl:when>
452         </xsl:choose>
453         </a>
454             <xsl:choose>
455             <xsl:when test="position()=last()"></xsl:when>
456             <xsl:otherwise> | </xsl:otherwise>
457             </xsl:choose>  
458         </xsl:for-each>
459         </span>
460         </xsl:if>
461         
462         <!-- NORMARC does not define indicators for 505
463         <xsl:if test="marc:datafield[@tag=505]">
464         <xsl:for-each select="marc:datafield[@tag=505]">
465         <span class="results_summary"><span class="label">
466         <xsl:choose>
467         <xsl:when test="@ind1=0">
468             Contents:
469         </xsl:when>
470         <xsl:when test="@ind1=1">
471             Incomplete contents:
472         </xsl:when>
473         <xsl:when test="@ind1=1">
474             Partial contents:
475         </xsl:when>
476         </xsl:choose>  
477         </span>
478         <xsl:choose>
479         <xsl:when test="@ind2=0">
480             <xsl:for-each select="marc:subfield[@code='t']">
481                 <xsl:value-of select="marc:subfield[@code=t]"/> <xsl:value-of select="marc:subfield[@code=r]"/>
482             </xsl:for-each> 
483         </xsl:when>
484         <xsl:otherwise>
485             <xsl:call-template name="subfieldSelect">
486                 <xsl:with-param name="codes">au</xsl:with-param>
487             </xsl:call-template>
488         </xsl:otherwise>
489         </xsl:choose>
490         </span>
491         </xsl:for-each>
492         </xsl:if>
493         -->
494         <xsl:if test="marc:datafield[@tag=505]">
495                 <xsl:call-template name="subfieldSelect">
496                 <xsl:with-param name="codes">a</xsl:with-param>
497             </xsl:call-template>
498                 </xsl:if>
499                 
500         <!-- 780 -->
501         <xsl:if test="marc:datafield[@tag=780]">
502         <xsl:for-each select="marc:datafield[@tag=780]">
503         <span class="results_summary"><span class="label">
504         <xsl:choose>
505                 <xsl:when test="@ind2=0">
506                     Fortsettelse av:
507                 </xsl:when>
508                 <xsl:when test="@ind2=1">
509                     Delvis fortsettelse av:
510                 </xsl:when>
511                 <xsl:when test="@ind2=2">
512                     Avløser:
513                 </xsl:when>
514                 <xsl:when test="@ind2=3">
515                     Avløser delvis:
516                 </xsl:when>
517                 <xsl:when test="@ind2=4">
518                     Sammenslåing av: ... ; og ...
519                 </xsl:when>
520                 <xsl:when test="@ind2=5">
521                     Har tatt opp:
522                 </xsl:when>
523                 <xsl:when test="@ind2=6">
524                     Har delvis tatt opp:
525                 </xsl:when>
526                 <xsl:when test="@ind2=7">
527                     Utskilt fra:
528                 </xsl:when>
529         </xsl:choose>
530         </span>
531                 <xsl:variable name="f780">
532                     <xsl:call-template name="subfieldSelect">
533                         <xsl:with-param name="codes">a_t</xsl:with-param>
534                     </xsl:call-template>
535                 </xsl:variable>
536              <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
537                 <xsl:value-of select="translate($f780, '()', '')"/>
538             </a>
539         </span>
540  
541         <xsl:choose>
542         <xsl:when test="@ind1=0">
543             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
544         </xsl:when>
545         </xsl:choose>
546
547         </xsl:for-each>
548         </xsl:if>
549
550         <!-- 785 -->
551         <xsl:if test="marc:datafield[@tag=785]">
552         <xsl:for-each select="marc:datafield[@tag=785]">
553         <span class="results_summary"><span class="label">
554         <xsl:choose>
555                 <xsl:when test="@ind2=0">
556                     Fortsettelse i:
557                 </xsl:when>
558                 <xsl:when test="@ind2=1">
559                     Fortsettes delvis i:
560                 </xsl:when>
561                 <xsl:when test="@ind2=2">
562                     Avløst av:
563                 </xsl:when>
564                 <xsl:when test="@ind2=3">
565                     Delvsi avløst av:
566                 </xsl:when>
567                 <xsl:when test="@ind2=4">
568                     Gått inn i:
569                 </xsl:when>
570                 <xsl:when test="@ind2=5">
571                     Delvis gått inn i:
572                 </xsl:when>
573                 <xsl:when test="@ind2=6">
574                     Fortsettes av: ...; og ...
575                 </xsl:when>
576                 <xsl:when test="@ind2=7">
577                         Slått sammen med: .., til: ...
578                 </xsl:when>
579         </xsl:choose>
580         </span>
581                    <xsl:variable name="f785">
582                     <xsl:call-template name="subfieldSelect">
583                         <xsl:with-param name="codes">a_t</xsl:with-param>
584                     </xsl:call-template>
585                 </xsl:variable>
586
587                 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
588                 <xsl:value-of select="translate($f785, '()', '')"/>
589             </a>
590
591         </span>
592         </xsl:for-each>
593         </xsl:if>
594
595     </xsl:template>
596
597     <xsl:template name="part">
598         <xsl:variable name="partNumber">
599             <xsl:call-template name="specialSubfieldSelect">
600                 <xsl:with-param name="axis">n</xsl:with-param>
601                 <xsl:with-param name="anyCodes">n</xsl:with-param>
602                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
603             </xsl:call-template>
604         </xsl:variable>
605         <xsl:variable name="partName">
606             <xsl:call-template name="specialSubfieldSelect">
607                 <xsl:with-param name="axis">p</xsl:with-param>
608                 <xsl:with-param name="anyCodes">p</xsl:with-param>
609                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
610             </xsl:call-template>
611         </xsl:variable>
612         <xsl:if test="string-length(normalize-space($partNumber))">
613                 <xsl:call-template name="chopPunctuation">
614                     <xsl:with-param name="chopString" select="$partNumber"/>
615                 </xsl:call-template>
616         </xsl:if>
617         <xsl:if test="string-length(normalize-space($partName))">
618                 <xsl:call-template name="chopPunctuation">
619                     <xsl:with-param name="chopString" select="$partName"/>
620                 </xsl:call-template>
621         </xsl:if>
622     </xsl:template>
623
624     <xsl:template name="specialSubfieldSelect">
625         <xsl:param name="anyCodes"/>
626         <xsl:param name="axis"/>
627         <xsl:param name="beforeCodes"/>
628         <xsl:param name="afterCodes"/>
629         <xsl:variable name="str">
630             <xsl:for-each select="marc:subfield">
631                 <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])">
632                     <xsl:value-of select="text()"/>
633                     <xsl:text> </xsl:text>
634                 </xsl:if>
635             </xsl:for-each>
636         </xsl:variable>
637         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
638     </xsl:template>
639 </xsl:stylesheet>