Bug 8210: add links to authorities to headings in OPAC
[koha.git] / 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" />
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="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
21         <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
22         <xsl:variable name="TracingQuotesLeft">
23           <xsl:choose>
24             <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
25             <xsl:otherwise>"</xsl:otherwise>
26           </xsl:choose>
27         </xsl:variable>
28         <xsl:variable name="TracingQuotesRight">
29           <xsl:choose>
30             <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
31             <xsl:otherwise>"</xsl:otherwise>
32           </xsl:choose>
33         </xsl:variable>
34         <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
35
36         <xsl:variable name="leader" select="marc:leader"/>
37         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
38         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
39         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
40         <xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
41         <xsl:variable name="materialTypeCode">
42             <xsl:choose>
43                 <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
44                 <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>
45                 <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>
46                 <xsl:when test="$field019b='a' or contains($field019b,'ab') or contains($field019b,'aj') or $leader6='e' or $leader6='f'">Kar</xsl:when>
47                 <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>
48                 <xsl:when test="$field019b='g' or contains($field019b,'gb') or contains($field019b,'gd') or contains($field019b,'ge') or $leader6='m'">Fil</xsl:when>
49                 <xsl:when test="$leader6='o'">kom</xsl:when>
50                 <xsl:when test="$field019b='h' or $leader6='r'">trd</xsl:when>
51                 <xsl:when test="$field019b='j' or $leader6='a'">
52                     <xsl:choose>
53                         <xsl:when test="$leader7='a' or $leader7='c' or $leader7='m' or $leader7='p'">Mon</xsl:when>
54                         <xsl:when test="$field019b='j' or $leader7='b' or $leader7='s'">Per</xsl:when>
55                     </xsl:choose>
56                 </xsl:when>
57             </xsl:choose>
58         </xsl:variable>
59         <xsl:variable name="materialTypeLabel">
60                         <xsl:choose>
61                 <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Bok</xsl:when>
62                 <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">Film og video</xsl:when>
63                 <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'">Musikalier</xsl:when>
64                 <xsl:when test="$field019b='a' or contains($field019b,'ab') or contains($field019b,'aj') or $leader6='e' or $leader6='f'">Kart</xsl:when>
65                 <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'">Grafisk materiale</xsl:when>
66                 <xsl:when test="$field019b='g' or contains($field019b,'gb') or contains($field019b,'gd') or contains($field019b,'ge') or $leader6='m'">Fil</xsl:when>
67                 <xsl:when test="$leader6='o'">Kombidokument</xsl:when>
68                 <xsl:when test="$field019b='h' or $leader6='r'">Tredimensjonal gjenstand</xsl:when>
69                 <xsl:when test="$field019b='j' or $leader6='a'">
70                     <xsl:choose>
71                         <xsl:when test="$leader7='a' or $leader7='c' or $leader7='m' or $leader7='p'">Bok</xsl:when>
72                         <xsl:when test="$field019b='j' or $leader7='b' or $leader7='s'">Periodikum</xsl:when>
73                     </xsl:choose>
74                 </xsl:when>
75             </xsl:choose>
76
77         </xsl:variable>
78
79         <!-- Tittel og ansvarsopplysninger -->
80         <xsl:if test="marc:datafield[@tag=245]">
81         <h1>
82             <xsl:for-each select="marc:datafield[@tag=245]">
83                     <xsl:call-template name="subfieldSelect">
84                         <xsl:with-param name="codes">a</xsl:with-param>
85                     </xsl:call-template>
86                     <xsl:if test="marc:subfield[@code='b']">
87                         <xsl:text> : </xsl:text>
88                         <xsl:call-template name="subfieldSelect">
89                             <xsl:with-param name="codes">b</xsl:with-param>
90                         </xsl:call-template>
91                     </xsl:if>
92                     <xsl:if test="marc:subfield[@code='h']">
93                         <xsl:text> </xsl:text>
94                         (<xsl:call-template name="subfieldSelect">
95                             <xsl:with-param name="codes">h</xsl:with-param>
96                         </xsl:call-template>) 
97                     </xsl:if>
98                     <xsl:text> </xsl:text>
99                     <xsl:call-template name="subfieldSelect">
100                         <xsl:with-param name="codes">np</xsl:with-param>
101                     </xsl:call-template>
102             </xsl:for-each>
103         </h1>
104         </xsl:if>
105
106         <!-- Author Statement -->
107                 <!-- 245$9 is Koha authority number --> 
108         <xsl:choose>
109         <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]">
110         <h5 class="author">av
111         <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
112         <a>
113         <xsl:choose>
114             <xsl:when test="marc:subfield[@code=9]">
115                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
116             </xsl:when>
117             <xsl:otherwise>
118             <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
119             </xsl:otherwise>
120         </xsl:choose>
121         <xsl:call-template name="nameABCDQ"/></a>
122         <xsl:if test="marc:subfield[@code=9]">
123             <a class='authlink'>
124                 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
125                 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
126             </a>
127         </xsl:if>
128         <xsl:choose>
129         <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
130         </xsl:for-each>
131
132         <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]">
133         <a>
134         <xsl:choose>
135             <xsl:when test="marc:subfield[@code=9]">
136                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
137             </xsl:when>
138             <xsl:otherwise>
139             <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>      
140             </xsl:otherwise>
141         </xsl:choose>
142         <xsl:call-template name="nameABCDN"/></a>
143         <xsl:if test="marc:subfield[@code=9]">
144             <a class='authlink'>
145                 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
146                 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
147             </a>
148         </xsl:if>
149         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
150         </xsl:for-each>
151
152         <xsl:for-each select="marc:datafield[@tag=111 or @tag=711]">
153         <a>
154         <xsl:choose>
155             <xsl:when test="marc:subfield[@code=9]">
156                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
157             </xsl:when>
158             <xsl:otherwise>
159             <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
160             </xsl:otherwise>
161         </xsl:choose>
162         <xsl:call-template name="nameACDEQ"/></a>
163         <xsl:if test="marc:subfield[@code=9]">
164             <a class='authlink'>
165                 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
166                 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
167             </a>
168         </xsl:if>
169         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
170
171         </xsl:for-each>
172         </h5>
173         </xsl:when>
174         </xsl:choose>
175
176     <xsl:if test="$DisplayOPACiconsXSLT!='0'">
177         <xsl:if test="$materialTypeCode!=''">
178         <span class="results_summary"><span class="label">Materialtype: </span>
179         <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
180         <xsl:value-of select="$materialTypeLabel"/>
181         </span>
182         </xsl:if>
183     </xsl:if>
184
185         <!--Series -->
186         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
187                 <span class="results_summary"><span class="label">Series: </span>
188                 <xsl:for-each select="marc:datafield[@tag=440]">
189                      <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
190                     <xsl:call-template name="chopPunctuation">
191                                     <xsl:with-param name="chopString">
192                                         <xsl:call-template name="subfieldSelect">
193                                             <xsl:with-param name="codes">av</xsl:with-param>
194                                         </xsl:call-template>
195                                     </xsl:with-param>
196                                 </xsl:call-template>
197                                 </a>
198                             <xsl:text> </xsl:text><xsl:call-template name="part"/>
199                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
200                 </xsl:for-each>
201         
202                 <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
203                      <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
204                                 <xsl:call-template name="chopPunctuation">
205                                     <xsl:with-param name="chopString">
206                                         <xsl:call-template name="subfieldSelect">
207                                             <xsl:with-param name="codes">av</xsl:with-param>
208                                         </xsl:call-template>
209                                     </xsl:with-param>
210                                 </xsl:call-template>
211                     </a>
212                             <xsl:call-template name="part"/>
213                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
214                 </xsl:for-each>
215                 </span>
216         </xsl:if>
217
218         <!-- Publisher Statement -->
219         
220         <xsl:if test="marc:datafield[@tag=260]">
221         <span class="results_summary"><span class="label">Utgiver: </span>
222             <xsl:for-each select="marc:datafield[@tag=260]">
223                 <xsl:call-template name="chopPunctuation">
224                   <xsl:with-param name="chopString">
225                     <xsl:call-template name="subfieldSelect">
226                         <xsl:with-param name="codes">bcg</xsl:with-param>
227                     </xsl:call-template>
228                    </xsl:with-param>
229                </xsl:call-template>
230                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
231             </xsl:for-each>
232         </span> 
233         </xsl:if>
234
235         <!-- Edition Statement -->
236         
237         <xsl:if test="marc:datafield[@tag=250]">
238         <span class="results_summary"><span class="label">Utgave: </span>
239             <xsl:for-each select="marc:datafield[@tag=250]">
240                 <xsl:call-template name="chopPunctuation">
241                   <xsl:with-param name="chopString">
242                     <xsl:call-template name="subfieldSelect">
243                         <xsl:with-param name="codes">ab</xsl:with-param>
244                     </xsl:call-template>
245                    </xsl:with-param>
246                </xsl:call-template>
247                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
248             </xsl:for-each>
249         </span>
250         </xsl:if>
251
252         <!-- Description -->
253         
254         <xsl:if test="marc:datafield[@tag=300]">
255         <span class="results_summary"><span class="label">Beskrivelse: </span>
256             <xsl:for-each select="marc:datafield[@tag=300]">
257                 <xsl:call-template name="chopPunctuation">
258                   <xsl:with-param name="chopString">
259                     <xsl:call-template name="subfieldSelect">
260                         <xsl:with-param name="codes">abceg</xsl:with-param>
261                     </xsl:call-template>
262                    </xsl:with-param>
263                </xsl:call-template>
264                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
265             </xsl:for-each>
266         </span>
267        </xsl:if>
268
269        <abbr class="unapi-id" title="koha:biblionumber:{marc:datafield[@tag=999]/marc:subfield[@code='c']}" ><!-- unAPI --></abbr>
270
271        <xsl:if test="marc:datafield[@tag=020]">
272         <span class="results_summary"><span class="label">ISBN: </span>
273         <xsl:for-each select="marc:datafield[@tag=020]">
274         <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
275                 <xsl:value-of select="marc:subfield[@code='a']"/>
276                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
277         </xsl:for-each>
278         </span>
279         </xsl:if>
280
281         <xsl:if test="marc:datafield[@tag=022]">
282         <span class="results_summary"><span class="label">ISSN: </span>
283         <xsl:for-each select="marc:datafield[@tag=022]">
284                 <xsl:value-of select="marc:subfield[@code='a']"/>
285                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
286         </xsl:for-each>
287         </span>
288         </xsl:if>
289
290         <!-- Other Title  Statement -->
291
292         <xsl:if test="marc:datafield[@tag=246]">
293         <span class="results_summary"><span class="label">Parallelltittel: </span>
294             <xsl:for-each select="marc:datafield[@tag=246]">
295                 <xsl:call-template name="chopPunctuation">
296                   <xsl:with-param name="chopString">
297                     <xsl:call-template name="subfieldSelect">
298                         <xsl:with-param name="codes">abhfgnp</xsl:with-param>
299                     </xsl:call-template>
300                    </xsl:with-param>
301                </xsl:call-template>
302                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
303             </xsl:for-each>
304         </span>
305        </xsl:if>
306
307         <!-- Uniform Title  Statement -->
308
309         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
310         <span class="results_summary"><span class="label">Standardtittel: </span>
311         <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
312             <xsl:variable name="str">
313                 <xsl:for-each select="marc:subfield">
314                     <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'])))">
315                         <xsl:value-of select="text()"/>
316                         <xsl:text> </xsl:text>
317                      </xsl:if>
318                 </xsl:for-each>
319             </xsl:variable>
320             <xsl:call-template name="chopPunctuation">
321                 <xsl:with-param name="chopString">
322                     <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
323                         
324                 </xsl:with-param>
325             </xsl:call-template>
326             <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
327         </xsl:for-each>
328         </span>
329         </xsl:if>
330
331         <!-- Subjects -->
332
333         <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
334             <span class="results_summary subjects"><span class="label">Emne(r): </span>
335             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
336             <a>
337             <xsl:choose>
338             <!-- Will implement this later
339                 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
340                     <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
341                 </xsl:when>
342             -->
343             <xsl:when test="$TraceSubjectSubdivisions='1'">
344                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect">
345                         <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
346                         <xsl:with-param name="delimeter"> AND </xsl:with-param>
347                         <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
348                         <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
349                     </xsl:call-template>
350                 </xsl:attribute>
351             </xsl:when>
352             <xsl:otherwise>
353                 <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>
354             </xsl:otherwise>
355             </xsl:choose>
356             <xsl:call-template name="chopPunctuation">
357                 <xsl:with-param name="chopString">
358                     <xsl:call-template name="subfieldSelect">
359                         <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
360                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
361                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
362                     </xsl:call-template>
363                 </xsl:with-param>
364             </xsl:call-template>
365             </a>
366             <xsl:if test="marc:subfield[@code=9]">
367                 <a class='authlink'>
368                     <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
369                     <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
370                 </a>
371             </xsl:if>
372             <xsl:choose>
373             <xsl:when test="position()=last()"></xsl:when>
374             <xsl:otherwise> | </xsl:otherwise>
375             </xsl:choose>
376
377             </xsl:for-each>
378             </span>
379         </xsl:if>
380
381         <xsl:if test="marc:datafield[@tag=856]">
382         <span class="results_summary"><span class="label">Nettbasert ressurs: </span>
383         <xsl:for-each select="marc:datafield[@tag=856]">
384             <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
385         <xsl:choose>
386             <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
387                     <xsl:call-template name="subfieldSelect">
388                         <xsl:with-param name="codes">y3z</xsl:with-param>
389                     </xsl:call-template>
390             </xsl:when>
391         <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
392         Klikk her for tilgang
393         </xsl:when>
394         </xsl:choose>
395         </a>
396             <xsl:choose>
397             <xsl:when test="position()=last()"></xsl:when>
398             <xsl:otherwise> | </xsl:otherwise>
399             </xsl:choose>  
400         </xsl:for-each>
401         </span>
402         </xsl:if>
403         
404         <!-- NORMARC does not define indicators for 505
405         <xsl:if test="marc:datafield[@tag=505]">
406         <xsl:for-each select="marc:datafield[@tag=505]">
407         <span class="results_summary"><span class="label">
408         <xsl:choose>
409         <xsl:when test="@ind1=0">
410             Contents:
411         </xsl:when>
412         <xsl:when test="@ind1=1">
413             Incomplete contents:
414         </xsl:when>
415         <xsl:when test="@ind1=1">
416             Partial contents:
417         </xsl:when>
418         </xsl:choose>  
419         </span>
420         <xsl:choose>
421         <xsl:when test="@ind2=0">
422             <xsl:for-each select="marc:subfield[@code='t']">
423                 <xsl:value-of select="marc:subfield[@code=t]"/> <xsl:value-of select="marc:subfield[@code=r]"/>
424             </xsl:for-each> 
425         </xsl:when>
426         <xsl:otherwise>
427             <xsl:call-template name="subfieldSelect">
428                 <xsl:with-param name="codes">au</xsl:with-param>
429             </xsl:call-template>
430         </xsl:otherwise>
431         </xsl:choose>
432         </span>
433         </xsl:for-each>
434         </xsl:if>
435         -->
436         <xsl:if test="marc:datafield[@tag=505]">
437                 <xsl:call-template name="subfieldSelect">
438                 <xsl:with-param name="codes">a</xsl:with-param>
439             </xsl:call-template>
440                 </xsl:if>
441                 
442         <!-- 780 -->
443         <xsl:if test="marc:datafield[@tag=780]">
444         <xsl:for-each select="marc:datafield[@tag=780]">
445         <span class="results_summary"><span class="label">
446         <xsl:choose>
447                 <xsl:when test="@ind2=0">
448                     Fortsettelse av:
449                 </xsl:when>
450                 <xsl:when test="@ind2=1">
451                     Delvis fortsettelse av:
452                 </xsl:when>
453                 <xsl:when test="@ind2=2">
454                     Avløser:
455                 </xsl:when>
456                 <xsl:when test="@ind2=3">
457                     Avløser delvis:
458                 </xsl:when>
459                 <xsl:when test="@ind2=4">
460                     Sammenslåing av: ... ; og ...
461                 </xsl:when>
462                 <xsl:when test="@ind2=5">
463                     Har tatt opp:
464                 </xsl:when>
465                 <xsl:when test="@ind2=6">
466                     Har delvis tatt opp:
467                 </xsl:when>
468                 <xsl:when test="@ind2=7">
469                     Utskilt fra:
470                 </xsl:when>
471         </xsl:choose>
472         </span>
473                 <xsl:variable name="f780">
474                     <xsl:call-template name="subfieldSelect">
475                         <xsl:with-param name="codes">a_t</xsl:with-param>
476                     </xsl:call-template>
477                 </xsl:variable>
478              <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
479                 <xsl:value-of select="translate($f780, '()', '')"/>
480             </a>
481         </span>
482  
483         <xsl:choose>
484         <xsl:when test="@ind1=0">
485             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
486         </xsl:when>
487         </xsl:choose>
488
489         </xsl:for-each>
490         </xsl:if>
491
492         <!-- 785 -->
493         <xsl:if test="marc:datafield[@tag=785]">
494         <xsl:for-each select="marc:datafield[@tag=785]">
495         <span class="results_summary"><span class="label">
496         <xsl:choose>
497                 <xsl:when test="@ind2=0">
498                     Fortsettelse i:
499                 </xsl:when>
500                 <xsl:when test="@ind2=1">
501                     Fortsettes delvis i:
502                 </xsl:when>
503                 <xsl:when test="@ind2=2">
504                     Avløst av:
505                 </xsl:when>
506                 <xsl:when test="@ind2=3">
507                     Delvsi avløst av:
508                 </xsl:when>
509                 <xsl:when test="@ind2=4">
510                     Gått inn i:
511                 </xsl:when>
512                 <xsl:when test="@ind2=5">
513                     Delvis gått inn i:
514                 </xsl:when>
515                 <xsl:when test="@ind2=6">
516                     Fortsettes av: ...; og ...
517                 </xsl:when>
518                 <xsl:when test="@ind2=7">
519                         Slått sammen med: .., til: ...
520                 </xsl:when>
521         </xsl:choose>
522         </span>
523                    <xsl:variable name="f785">
524                     <xsl:call-template name="subfieldSelect">
525                         <xsl:with-param name="codes">a_t</xsl:with-param>
526                     </xsl:call-template>
527                 </xsl:variable>
528
529                 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
530                 <xsl:value-of select="translate($f785, '()', '')"/>
531             </a>
532
533         </span>
534         </xsl:for-each>
535         </xsl:if>
536
537     </xsl:template>
538
539     <xsl:template name="part">
540         <xsl:variable name="partNumber">
541             <xsl:call-template name="specialSubfieldSelect">
542                 <xsl:with-param name="axis">n</xsl:with-param>
543                 <xsl:with-param name="anyCodes">n</xsl:with-param>
544                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
545             </xsl:call-template>
546         </xsl:variable>
547         <xsl:variable name="partName">
548             <xsl:call-template name="specialSubfieldSelect">
549                 <xsl:with-param name="axis">p</xsl:with-param>
550                 <xsl:with-param name="anyCodes">p</xsl:with-param>
551                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
552             </xsl:call-template>
553         </xsl:variable>
554         <xsl:if test="string-length(normalize-space($partNumber))">
555                 <xsl:call-template name="chopPunctuation">
556                     <xsl:with-param name="chopString" select="$partNumber"/>
557                 </xsl:call-template>
558         </xsl:if>
559         <xsl:if test="string-length(normalize-space($partName))">
560                 <xsl:call-template name="chopPunctuation">
561                     <xsl:with-param name="chopString" select="$partName"/>
562                 </xsl:call-template>
563         </xsl:if>
564     </xsl:template>
565
566     <xsl:template name="specialSubfieldSelect">
567         <xsl:param name="anyCodes"/>
568         <xsl:param name="axis"/>
569         <xsl:param name="beforeCodes"/>
570         <xsl:param name="afterCodes"/>
571         <xsl:variable name="str">
572             <xsl:for-each select="marc:subfield">
573                 <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])">
574                     <xsl:value-of select="text()"/>
575                     <xsl:text> </xsl:text>
576                 </xsl:if>
577             </xsl:for-each>
578         </xsl:variable>
579         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
580     </xsl:template>
581 </xsl:stylesheet>