Bug 2093: (follow-up) Add OPAC dashboard for logged-in users
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / xslt / NORMARCslim2OPACResults.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   xmlns:str="http://exslt.org/strings"
11   exclude-result-prefixes="marc items">
12     <xsl:import href="NORMARCslimUtils.xsl"/>
13     <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14     <xsl:key name="item-by-status" match="items:item" use="items:status"/>
15     <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
16
17     <xsl:template match="/">
18             <xsl:apply-templates/>
19     </xsl:template>
20     <xsl:template match="marc:record">
21
22     <!-- System preferences -->
23     <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/>
24     <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
25     <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
26     <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
27     <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/>
28     <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
29     <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
30     <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/>
31
32         <xsl:variable name="leader" select="marc:leader"/>
33         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
34         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
35         <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
36         <xsl:variable name="isbn" select="marc:datafield[@tag=020]/marc:subfield[@code='a']"/>
37         <xsl:variable name="controlField007" select="marc:controlfield[@tag=007]"/>
38         <xsl:variable name="controlField007-00" select="substring($controlField007,1,1)"/>
39         <xsl:variable name="controlField007-01" select="substring($controlField007,2,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         <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/>
62         <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
63         <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/>
64         <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
65         <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
66         <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
67         <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
68         <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
69         <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
70
71         <xsl:variable name="physicalDescription">
72
73         <!-- Why are these treated specially?
74
75             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a']">
76                 reformatted digital
77             </xsl:if>
78             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='b']">
79                 digitized microfilm
80             </xsl:if>
81             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='d']">
82                 digitized other analog
83             </xsl:if>
84
85             <xsl:variable name="check008-23">
86                 <xsl:if test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='CR' or $typeOf008='MX'">
87                     <xsl:value-of select="true()"></xsl:value-of>
88                 </xsl:if>
89             </xsl:variable>
90             <xsl:variable name="check008-29">
91                 <xsl:if test="$typeOf008='MP' or $typeOf008='VM'">
92                     <xsl:value-of select="true()"></xsl:value-of>
93                 </xsl:if>
94             </xsl:variable>
95
96             <xsl:choose>
97                 <xsl:when test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')">
98                     braille
99                 </xsl:when>
100                 <xsl:when test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='CR') and ($controlField008-23=' ' or $controlField008='r'))">
101                     print
102                 </xsl:when>
103                 <xsl:when test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')">
104                     electronic
105                 </xsl:when>
106                 <xsl:when test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')">
107                     microfiche
108                 </xsl:when>
109                 <xsl:when test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')">
110                     microfilm
111                 </xsl:when>
112             </xsl:choose>
113
114             -->
115
116             <!-- 019$b from BSMARC -->
117
118             <xsl:if test="$field019b">
119                                 <xsl:if test="$field019b='a'"> Kartografisk materiale</xsl:if>
120                                 <xsl:if test="contains($field019b,'ab')"> Atlas</xsl:if>
121                                 <xsl:if test="contains($field019b,'aj')"> Kart</xsl:if>
122                                 <xsl:if test="$field019b='b'"> Manuskripter</xsl:if>
123                                 <xsl:if test="$field019b='c'"> Musikktrykk</xsl:if>
124                                 <xsl:if test="$field019b='d'"> Lydopptak</xsl:if>
125                                 <xsl:if test="contains($field019b,'da')"> Grammofonplate</xsl:if>
126                                 <xsl:if test="contains($field019b,'db')"> Kassett</xsl:if>
127                                 <xsl:if test="contains($field019b,'dc')"> Kompaktplate</xsl:if>
128                                 <xsl:if test="contains($field019b,'dd')"> Avspiller med lydfil (eks. Digibøker)</xsl:if>
129                                 <xsl:if test="contains($field019b,'dg')"> Musikk</xsl:if>
130                                 <xsl:if test="contains($field019b,'dh')"> Språkkurs</xsl:if>
131                                 <xsl:if test="contains($field019b,'di')"> Lydbok</xsl:if>
132                                 <xsl:if test="contains($field019b,'dj')"> Annen tale/annet</xsl:if>
133                                 <xsl:if test="contains($field019b,'dk')"> Kombidokument</xsl:if>
134                                 <xsl:if test="$field019b='e'"> Film og video</xsl:if>
135                                 <xsl:if test="contains($field019b,'ec')"> Filmspole</xsl:if>
136                                 <xsl:if test="contains($field019b,'ed')"> Videokassett (VHS)</xsl:if>
137                                 <xsl:if test="contains($field019b,'ee')"> Videoplate (DVD)</xsl:if>
138                                 <xsl:if test="contains($field019b,'ef')"> Blu-ray-plate</xsl:if>
139                                 <xsl:if test="$field019b='f'"> Grafisk materiale</xsl:if>
140                                 <xsl:if test="contains($field019b,'fd')"> Dias</xsl:if>
141                                 <xsl:if test="contains($field019b,'ff')"> Fotografi</xsl:if>
142                                 <xsl:if test="contains($field019b,'fi')"> Kunstreproduksjon</xsl:if>
143                                 <xsl:if test="$field019b='g'"> Elektroniske ressurser</xsl:if>
144                                 <xsl:if test="contains($field019b,'gb')"> Diskett</xsl:if>
145                                 <xsl:if test="contains($field019b,'gd')"> Optiske lagringsmedia (CD-ROM)</xsl:if>
146                                 <xsl:if test="contains($field019b,'ge')"> Nettressurser</xsl:if>
147                                 <xsl:if test="$field019b='h'"> Tredimensjonale gjenstander</xsl:if>
148                                 <xsl:if test="$field019b='i'"> Mikroformer</xsl:if>
149                                 <xsl:if test="contains($field019b,'ib')"> Mikrofilmspole</xsl:if>
150                                 <xsl:if test="contains($field019b,'ic')"> Mikrofilmkort</xsl:if>
151                                 <xsl:if test="$field019b='j'"> Periodika</xsl:if>
152                                 <xsl:if test="$field019b='k'"> Artikler (i bøker eller periodika)</xsl:if>
153                                 <xsl:if test="$field019b='l'"> Fysiske bøker</xsl:if>
154             </xsl:if>
155
156             <!-- Check positions 00 and 01 of controlfield 007 -->
157
158             <xsl:if test="$controlField007-00='a'">
159                 <!-- Kartografisk materiale (unntatt globus) -->
160                                 <xsl:if test="$controlField007-01='a'">Anamorfisk kart</xsl:if>
161                                 <xsl:if test="$controlField007-01='b'">Atlas</xsl:if>
162                                 <xsl:if test="$controlField007-01='c'">Fantasikart</xsl:if>
163                                 <xsl:if test="$controlField007-01='d'">Flykart</xsl:if>
164                                 <xsl:if test="$controlField007-01='e'">Sjøkart</xsl:if>
165                                 <xsl:if test="$controlField007-01='f'">Navigasjonskart</xsl:if>
166                                 <xsl:if test="$controlField007-01='g'">Blokkdiagram</xsl:if>
167                                 <xsl:if test="$controlField007-01='h'">Stjernekart</xsl:if>
168                                 <xsl:if test="$controlField007-01='j'">Kart</xsl:if>
169                                 <xsl:if test="$controlField007-01='k'">Kartprofil</xsl:if>
170                                 <xsl:if test="$controlField007-01='l'">Fotokart</xsl:if>
171                                 <xsl:if test="$controlField007-01='m'">Fotomosaikk</xsl:if>
172                                 <xsl:if test="$controlField007-01='n'">Ortofoto</xsl:if>
173                                 <xsl:if test="$controlField007-01='o'">Tegnet kart</xsl:if>
174                                 <xsl:if test="$controlField007-01='p'">Trykt kart</xsl:if>
175                                 <xsl:if test="$controlField007-01='q'">Terrengmodell</xsl:if>
176                                 <xsl:if test="$controlField007-01='r'">Fjernanalysebilde</xsl:if>
177                                 <xsl:if test="$controlField007-01='s'">Kartseksjon</xsl:if>
178                                 <xsl:if test="$controlField007-01='t'">Plan</xsl:if>
179                                 <xsl:if test="$controlField007-01='y'">Perspektivkart</xsl:if>
180                                 <xsl:if test="$controlField007-01='z'">Annen karttype</xsl:if>
181             </xsl:if>
182
183             <xsl:if test="$controlField007-00='c'">
184                 <!-- Maskinlesbar fil -->
185                                 <xsl:if test="$controlField007-01='a'">Magnetisk-optisk plate</xsl:if>
186                                 <xsl:if test="$controlField007-01='b'">Lagringsbrikke</xsl:if>
187                                 <xsl:if test="$controlField007-01='c'">Optisk kassett</xsl:if>
188                                 <xsl:if test="$controlField007-01='d'">Diskett</xsl:if>
189                                 <xsl:if test="$controlField007-01='h'">Platelager (harddisk)</xsl:if>
190                                 <xsl:if test="$controlField007-01='k'">Magnetbåndkassett</xsl:if>
191                                 <xsl:if test="$controlField007-01='m'">Magnetbåndspole</xsl:if>
192                                 <xsl:if test="$controlField007-01='n'">Fjerntilgang (online)</xsl:if>
193                                 <xsl:if test="$controlField007-01='o'">Optisk plate</xsl:if>
194                                 <xsl:if test="$controlField007-01='z'">Annet lagringsmedium</xsl:if>
195             </xsl:if>
196
197             <xsl:if test="$controlField007-00='d'">
198                 <!-- Globus -->
199                                 <xsl:if test="$controlField007-01='a'">Stjerneglobus</xsl:if>
200                                 <xsl:if test="$controlField007-01='b'">Planet- eller måneglobus</xsl:if>
201                                 <xsl:if test="$controlField007-01='c'">Jordglobus</xsl:if>
202                                 <xsl:if test="$controlField007-01='z'">Annen globustype</xsl:if>
203             </xsl:if>
204
205             <xsl:if test="$controlField007-00='g'">
206                 <!-- Grafisk materiale som er tenkt projisert eller gjennomlyst -->
207                                 <xsl:if test="$controlField007-01='h'">Hologram</xsl:if>
208                                 <xsl:if test="$controlField007-01='o'">Billedbånd</xsl:if>
209                                 <xsl:if test="$controlField007-01='p'">Stereobilde</xsl:if>
210                                 <xsl:if test="$controlField007-01='r'">Røntgenbilde</xsl:if>
211                                 <xsl:if test="$controlField007-01='s'">Dia</xsl:if>
212                                 <xsl:if test="$controlField007-01='t'">Transparent</xsl:if>
213                                 <xsl:if test="$controlField007-01='z'">Annen materialtype</xsl:if>
214             </xsl:if>
215
216             <xsl:if test="$controlField007-00='h'">
217                 <!-- Mikroform -->
218                                 <xsl:if test="$controlField007-01='a'">Vinduskort</xsl:if>
219                                 <xsl:if test="$controlField007-01='c'">Mikrofilmkassett</xsl:if>
220                                 <xsl:if test="$controlField007-01='d'">Mikrofilmspole</xsl:if>
221                                 <xsl:if test="$controlField007-01='e'">Mikrofilmkort</xsl:if>
222                                 <xsl:if test="$controlField007-01='g'">Mikro-opak</xsl:if>
223                                 <xsl:if test="$controlField007-01='z'">Annen mikroformtype</xsl:if>
224             </xsl:if>
225
226             <xsl:if test="$controlField007-00='k'">
227                 <!-- Grafisk materiale som er ugjennomtrengelig for lys -->
228                                 <xsl:if test="$controlField007-01='c'">Collage</xsl:if> <!-- Originalt kunstverk -->
229                                 <xsl:if test="$controlField007-01='d'">Tegning</xsl:if> <!-- Originalt kunstverk -->
230                                 <xsl:if test="$controlField007-01='e'">Maleri</xsl:if> <!-- Originalt kunstverk -->
231                                 <xsl:if test="$controlField007-01='g'">Fotografi - negativ</xsl:if>
232                                 <xsl:if test="$controlField007-01='h'">Fotografi</xsl:if> <!-- Brukes også om ugjennomsiktige stereobilder. -->
233                                 <xsl:if test="$controlField007-01='i'">Bilde</xsl:if> <!-- Brukes når en mer spesifikk betegnelse er ukjent eller uønsket. -->
234                                 <xsl:if test="$controlField007-01='j'">Grafisk blad</xsl:if>
235                                 <xsl:if test="$controlField007-01='k'">Flipover</xsl:if>
236                                 <xsl:if test="$controlField007-01='l'">Teknisk tegning</xsl:if>
237                                 <xsl:if test="$controlField007-01='m'">Studieplansje</xsl:if>
238                                 <xsl:if test="$controlField007-01='n'">Plansje</xsl:if>
239                                 <xsl:if test="$controlField007-01='o'">Billedkort</xsl:if>
240                                 <xsl:if test="$controlField007-01='p'">Ordkort</xsl:if>
241                                 <xsl:if test="$controlField007-01='q'">Symbolkort</xsl:if>
242                                 <xsl:if test="$controlField007-01='r'">Kunstreproduksjon</xsl:if>
243                                 <xsl:if test="$controlField007-01='s'">Postkort</xsl:if>
244                                 <xsl:if test="$controlField007-01='t'">Plakat</xsl:if>
245                                 <xsl:if test="$controlField007-01='z'">Annen materialtype</xsl:if>
246             </xsl:if>
247
248             <xsl:if test="$controlField007-00='m'">
249                 <!-- Film -->
250                                 <xsl:if test="$controlField007-01='c'">Filmsløyfe</xsl:if>
251                                 <xsl:if test="$controlField007-01='f'">Filmkassett</xsl:if>
252                                 <xsl:if test="$controlField007-01='r'">Filmspole</xsl:if>
253                                 <xsl:if test="$controlField007-01='z'">Annen filmtype</xsl:if>
254             </xsl:if>
255
256             <xsl:if test="$controlField007-00='s'">
257                 <!-- Lydopptak -->
258                                 <xsl:if test="$controlField007-01='c'">Kompaktplate</xsl:if>
259                                 <xsl:if test="$controlField007-01='d'">Grammofonplate</xsl:if>
260                                 <xsl:if test="$controlField007-01='e'">Sylinder</xsl:if> <!-- Lydrull, voksrull, fonografsylinder -->
261                                 <xsl:if test="$controlField007-01='g'">Sløyfekassett</xsl:if>
262                                 <xsl:if test="$controlField007-01='i'">Filmlydspor</xsl:if>
263                                 <xsl:if test="$controlField007-01='q'">Rull (pianorull/orgelrull)</xsl:if>
264                                 <xsl:if test="$controlField007-01='s'">Lydkassett</xsl:if>
265                                 <xsl:if test="$controlField007-01='t'">Lydbånd</xsl:if>
266                                 <xsl:if test="$controlField007-01='w'">Wire</xsl:if>
267                                 <xsl:if test="$controlField007-01='z'">Annet lydmateriale</xsl:if>
268             </xsl:if>
269
270             <xsl:if test="$controlField007-00='u'">
271                 <!-- Tre-dimensjonal gjenstand -->
272                                 <xsl:if test="$controlField007-01='a'">Originalt kunstverk</xsl:if> <!-- F.eks. en skulptur. -->
273                                 <xsl:if test="$controlField007-01='c'">Kunstreproduksjon</xsl:if>
274                                 <xsl:if test="$controlField007-01='d'">Diorama</xsl:if>
275                                 <xsl:if test="$controlField007-01='e'">Øvelsesmodell</xsl:if>
276                                 <xsl:if test="$controlField007-01='g'">Spill</xsl:if>
277                                 <xsl:if test="$controlField007-01='p'">Mikroskopdia</xsl:if>
278                                 <xsl:if test="$controlField007-01='q'">Modell</xsl:if>
279                                 <xsl:if test="$controlField007-01='r'">Realia</xsl:if>
280                                 <xsl:if test="$controlField007-01='u'">Utstilling</xsl:if>
281                                 <xsl:if test="$controlField007-01='z'">Annen type gjenstand</xsl:if>
282             </xsl:if>
283
284             <xsl:if test="$controlField007-00='v'">
285                 <!-- Videoopptak -->
286                                 <xsl:if test="$controlField007-01='d'">Videoplate</xsl:if>
287                                 <xsl:if test="$controlField007-01='f'">Videokassett</xsl:if>
288                                 <xsl:if test="$controlField007-01='r'">Videospole</xsl:if>
289                                 <xsl:if test="$controlField007-01='z'">Annen type videoopptak</xsl:if>
290             </xsl:if>
291
292         </xsl:variable>
293
294                 <!-- Tittel og ansvarsopplysninger -->
295         <a>
296         <xsl:attribute name="href">
297             <xsl:call-template name="buildBiblioDefaultViewURL">
298                 <xsl:with-param name="BiblioDefaultView">
299                     <xsl:value-of select="$BiblioDefaultView"/>
300                 </xsl:with-param>
301             </xsl:call-template>
302             <xsl:value-of select="$biblionumber"/>
303         </xsl:attribute>
304         <xsl:attribute name="class">title</xsl:attribute>
305
306         <xsl:if test="marc:datafield[@tag=245]">
307         <xsl:for-each select="marc:datafield[@tag=245]">
308             <xsl:variable name="title">
309                      <xsl:call-template name="subfieldSelect">
310                         <xsl:with-param name="codes">a</xsl:with-param>
311                     </xsl:call-template>
312                     <xsl:if test="marc:subfield[@code='h']">
313                         <xsl:text> </xsl:text>
314                         (<xsl:call-template name="subfieldSelect">
315                             <xsl:with-param name="codes">h</xsl:with-param>
316                         </xsl:call-template>)
317                     </xsl:if>
318                     <xsl:if test="marc:subfield[@code='b']">
319                         <xsl:text> : </xsl:text>
320                         <xsl:call-template name="subfieldSelect">
321                             <xsl:with-param name="codes">b</xsl:with-param>
322                         </xsl:call-template>
323                     </xsl:if>
324                     <xsl:text> </xsl:text>
325                     <xsl:call-template name="subfieldSelect">
326                         <xsl:with-param name="codes">np</xsl:with-param>
327                      </xsl:call-template>
328             </xsl:variable>
329             <xsl:variable name="titleChop">
330                 <xsl:call-template name="chopPunctuation">
331                     <xsl:with-param name="chopString">
332                         <xsl:value-of select="$title"/>
333                     </xsl:with-param>
334                 </xsl:call-template>
335             </xsl:variable>
336             <xsl:value-of select="$titleChop"/>
337         </xsl:for-each>
338         </xsl:if>
339     </a>
340     <p>
341
342     <xsl:choose
343 >    <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]">
344
345     av
346         <xsl:for-each select="marc:datafield[(@tag=100 or @tag=700) and @ind1!='z']">
347             <xsl:choose>
348             <xsl:when test="position()=last()">
349                 <xsl:call-template name="nameABCDQ"/>.
350             </xsl:when>
351             <xsl:otherwise>
352                 <xsl:call-template name="nameABCDQ"/>;
353             </xsl:otherwise>
354             </xsl:choose>
355         </xsl:for-each>
356
357         <xsl:for-each select="marc:datafield[(@tag=110 or @tag=710) and @ind1!='z']">
358             <xsl:choose>
359             <xsl:when test="position()=last()">
360                 <xsl:call-template name="nameABCDN"/>.
361             </xsl:when>
362             <xsl:otherwise>
363                 <xsl:call-template name="nameABCDN"/>;
364             </xsl:otherwise>
365             </xsl:choose>
366         </xsl:for-each>
367
368         <xsl:for-each select="marc:datafield[(@tag=111 or @tag=711) and @ind1!='z']">
369             <xsl:choose>
370             <xsl:when test="position()=last()">
371                 <xsl:call-template name="nameACDEQ"/>.
372             </xsl:when>
373             <xsl:otherwise>
374                 <xsl:call-template name="nameACDEQ"/>;
375             </xsl:otherwise>
376             </xsl:choose>
377         </xsl:for-each>
378     </xsl:when>
379     </xsl:choose>
380     </p>
381
382     <xsl:if test="marc:datafield[@tag=250]">
383         <span class="results_summary">
384     <span class="label">Utgave: </span>
385             <xsl:for-each select="marc:datafield[@tag=250]">
386                     <xsl:call-template name="subfieldSelect">
387                         <xsl:with-param name="codes">ab</xsl:with-param>
388                     </xsl:call-template>
389             </xsl:for-each>
390         </span>
391     </xsl:if>
392
393         <!-- Analytics -->
394         <xsl:if test="$leader7='s' or $leader7='c'">
395         <span class="results_summary analytics"><span class="label">Analytics: </span>
396             <a>
397             <xsl:choose>
398             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
399                 <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>
400             </xsl:when>
401             <xsl:otherwise>
402                 <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>
403             </xsl:otherwise>
404             </xsl:choose>
405             <xsl:text>Show analytics</xsl:text>
406             </a>
407         </span>
408         </xsl:if>
409
410         <!-- 773 - Links from child to parent -->
411         <xsl:if test="marc:datafield[@tag=773]">
412         <xsl:for-each select="marc:datafield[@tag=773]">
413         <xsl:if test="@ind1=0">
414         <span class="results_summary in"><span class="label">
415         <xsl:choose>
416         <xsl:when test="@ind2=' '">
417             In:
418         </xsl:when>
419         <xsl:when test="@ind2=8">
420             <xsl:if test="marc:subfield[@code='i']">
421                 <xsl:value-of select="marc:subfield[@code='i']"/>
422             </xsl:if>
423         </xsl:when>
424         </xsl:choose>
425         </span>
426                 <xsl:variable name="f773">
427                     <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
428                         <xsl:with-param name="codes">a_t</xsl:with-param>
429                     </xsl:call-template></xsl:with-param></xsl:call-template>
430                 </xsl:variable>
431             <xsl:choose>
432                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
433                     <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>
434                         <xsl:value-of select="translate($f773, '()', '')"/>
435                     </a>
436                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
437                 </xsl:when>
438                 <xsl:when test="marc:subfield[@code='0']">
439                     <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
440                         <xsl:value-of select="$f773"/>
441                     </a>
442                 </xsl:when>
443                 <xsl:otherwise>
444                     <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
445                         <xsl:value-of select="$f773"/>
446                     </a>
447                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
448                 </xsl:otherwise>
449             </xsl:choose>
450         </span>
451         <xsl:if test="marc:subfield[@code='n']">
452             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
453         </xsl:if>
454         </xsl:if>
455         </xsl:for-each>
456         </xsl:if>
457
458 <xsl:if test="$DisplayOPACiconsXSLT!='0'">
459     <span class="results_summary">
460     <xsl:if test="$typeOf008!=''">
461         <span class="label">Materialtype: </span>
462         <xsl:choose>
463             <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/lib/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
464             <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/lib/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
465             <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/lib/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
466             <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/lib/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
467             <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>
468             <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/lib/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
469             <xsl:when test="$typeOf008='gra'"><img src="/opac-tmpl/lib/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
470             <xsl:when test="$typeOf008='kom'"><img src="/opac-tmpl/lib/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
471             <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>
472         </xsl:choose>
473     </xsl:if>
474     <xsl:if test="string-length(normalize-space($physicalDescription))">
475         <span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of>
476     </xsl:if>
477
478     <!-- test
479     <xsl:for-each select="marc:datafield[@tag=019]">
480     019b:
481     <xsl:call-template name="subfieldSelect">
482                 <xsl:with-param name="codes">b</xsl:with-param>
483                 </xsl:call-template>
484     </xsl:for-each>
485         -->
486
487         <xsl:if test="$controlField008-21 or $controlField008-22 or $controlField008-24 or $controlField008-26 or $controlField008-29 or $controlField008-34 or $controlField008-33 or $controlField008-30-31 or $controlField008-33">
488
489         <xsl:if test="$typeOf008='Per'">
490         <xsl:if test="$controlField008-21 and contains($controlField008-21,'amnpz')">
491         <span class="label">; Type periodikum: </span>
492         </xsl:if>
493             <xsl:choose>
494                 <xsl:when test="$controlField008-21='a'">Årbok</xsl:when>
495                                 <xsl:when test="$controlField008-21='m'">Monografiserie</xsl:when>
496                                 <xsl:when test="$controlField008-21='n'">Avis</xsl:when>
497                                 <xsl:when test="$controlField008-21='p'">Tidsskrift</xsl:when>
498                                 <xsl:when test="$controlField008-21='z'">Andre typer periodika</xsl:when>
499             </xsl:choose>
500         </xsl:if>
501
502         <xsl:if test="$typeOf008='Mon' or $typeOf008='Per'">
503         <xsl:if test="contains($controlField008-24,'abcdefhiklmnoqrstx')">
504         <span class="label">; Innhold: </span>
505         </xsl:if>
506             <xsl:choose>
507                 <xsl:when test="contains($controlField008-24,'a')"> Sammendrag(abstracts)/Referatorganer</xsl:when>
508                 <xsl:when test="contains($controlField008-24,'b')"> Bibliografier</xsl:when>
509                 <xsl:when test="contains($controlField008-24,'c')"> Kataloger</xsl:when>
510                 <xsl:when test="contains($controlField008-24,'d')"> Ordbøker</xsl:when>
511                 <xsl:when test="contains($controlField008-24,'e')"> Konversasjonsleksika</xsl:when>
512                 <xsl:when test="contains($controlField008-24,'f')"> Håndbøker</xsl:when>
513                 <xsl:when test="contains($controlField008-24,'h')"> Referanseverk</xsl:when>
514                 <xsl:when test="contains($controlField008-24,'i')"> Registre</xsl:when>
515                 <xsl:when test="contains($controlField008-24,'k')"> Diskografier</xsl:when>
516                 <xsl:when test="contains($controlField008-24,'l')"> Lover og forskrifter</xsl:when>
517                 <xsl:when test="contains($controlField008-24,'m')"> Hovedoppgaver/diplomoppgaver</xsl:when>
518                 <xsl:when test="contains($controlField008-24,'n')"> Oversiktsverker innenfor et emne</xsl:when>
519                 <xsl:when test="contains($controlField008-24,'o')"> Anmeldelser</xsl:when>
520                 <xsl:when test="contains($controlField008-24,'q')"> Filmografier</xsl:when>
521                 <xsl:when test="contains($controlField008-24,'r')"> Adressebøker</xsl:when>
522                 <xsl:when test="contains($controlField008-24,'s')"> Statistikker</xsl:when>
523                 <xsl:when test="contains($controlField008-24,'t')"> Tekniske rapporter</xsl:when>
524                 <xsl:when test="contains($controlField008-24,'x')"> Doktoravhandlinger/lisensiat-avhandlinger</xsl:when>
525                 <!--
526                 <xsl:when test="contains($controlField008-24,'z')"> Annet</xsl:when>
527                 -->
528             </xsl:choose>
529             <xsl:choose>
530                 <xsl:when test="$controlField008-29='1'">
531                     Konferansepublikasjon
532                 </xsl:when>
533             </xsl:choose>
534         </xsl:if>
535         <xsl:if test="$typeOf008='CF'">
536             <xsl:if test="$controlField008-26='a' or $controlField008-26='b' or $controlField008-26='c' or $controlField008-26='d' or $controlField008-26='e' or $controlField008-26='f' or $controlField008-26='g' or $controlField008-26='h' or $controlField008-26='i' or $controlField008-26='j'">
537             <span class="label">; Type maskinlesbar fil: </span>
538             </xsl:if>
539             <xsl:choose>
540                 <xsl:when test="$controlField008-26='a'">Numeriske data</xsl:when>
541                 <xsl:when test="$controlField008-26='b'">Programvare</xsl:when>
542                 <xsl:when test="$controlField008-26='c'">Grafiske data</xsl:when>
543                 <xsl:when test="$controlField008-26='d'">Tekst</xsl:when>
544                 <xsl:when test="$controlField008-26='e'">Bibliografiske data</xsl:when>
545                 <xsl:when test="$controlField008-26='f'">Font</xsl:when>
546                 <xsl:when test="$controlField008-26='g'">Spill</xsl:when>
547                 <xsl:when test="$controlField008-26='h'">Lyd</xsl:when>
548                 <xsl:when test="$controlField008-26='i'">Interaktivt multimedium</xsl:when>
549                 <xsl:when test="$controlField008-26='j'">Online tjeneste</xsl:when>
550                 <!-- Probably makes no sense to display these
551                 <xsl:when test="$controlField008-26='m'">En kombinasjon av to eller flere av de ovennevnte</xsl:when>
552                 <xsl:when test="$controlField008-26='u'">Ukjent</xsl:when>
553                 <xsl:when test="$controlField008-26='z'">Annen type data</xsl:when>
554                 -->
555             </xsl:choose>
556         </xsl:if>
557         <xsl:if test="$typeOf008='Mon'">
558             <xsl:if test="(substring($controlField008,25,1)='j') or (substring($controlField008,25,1)='1') or ($controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d')">
559             <span class="label">; Innhold: </span>
560             </xsl:if>
561             <xsl:if test="substring($controlField008,31,1)='1' or substring($controlField008,31,1)='a' or substring($controlField008,31,1)='b'">
562                 Festskrift
563             </xsl:if>
564             <xsl:if test="$controlField008-34='a' or $controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
565                 Biografi
566             </xsl:if>
567
568             <xsl:if test="$controlField008-33 and $controlField008-33!='^' and $controlField008-33!=' '">
569             <span class="label">; Litterær form: </span>
570             </xsl:if>
571             <xsl:choose>
572                 <xsl:when test="$controlField008-33='0'">Ikke skjønnlitteratur</xsl:when>
573                 <xsl:when test="$controlField008-33='l'">Lærebok, brevkurs</xsl:when>
574                 <xsl:when test="$controlField008-33='1'">Skjønnlitteratur</xsl:when>
575                 <xsl:when test="$controlField008-33='r'">Roman</xsl:when>
576                 <xsl:when test="$controlField008-33='n'">Novelle / fortelling</xsl:when>
577                 <xsl:when test="$controlField008-33='d'">Dikt</xsl:when>
578                 <xsl:when test="$controlField008-33='s'">Skuespill</xsl:when>
579                 <xsl:when test="$controlField008-33='t'">Tegneserie</xsl:when>
580                 <xsl:when test="$controlField008-33='a'">Antologi</xsl:when>
581                 <xsl:when test="$controlField008-33='p'">Pekebok</xsl:when>
582             </xsl:choose>
583         </xsl:if>
584         <xsl:if test="$typeOf008='Mus' and $controlField008-30-31 and $controlField008-30-31!='^^' and $controlField008-30-31!='  '">
585             <span class="label">; Litterær form: </span> <!-- Literary text for sound recordings -->
586             <xsl:if test="contains($controlField008-30-31,'a')">Selvbiografier</xsl:if>
587             <xsl:if test="contains($controlField008-30-31,'b')">Biografier</xsl:if>
588             <xsl:if test="contains($controlField008-30-31,'c')">Samtaler og diskusjoner</xsl:if>
589             <xsl:if test="contains($controlField008-30-31,'d')">Drama</xsl:if>
590             <xsl:if test="contains($controlField008-30-31,'e')">Essays</xsl:if>
591             <xsl:if test="contains($controlField008-30-31,'f')">Romaner</xsl:if>
592             <xsl:if test="contains($controlField008-30-31,'g')">Rapporter, referater</xsl:if>
593             <xsl:if test="contains($controlField008-30-31,'h')">Fortellinger, noveller</xsl:if>
594             <xsl:if test="contains($controlField008-30-31,'i')">Undervisning</xsl:if>
595             <xsl:if test="contains($controlField008-30-31,'j')">Språkundervisning</xsl:if>
596             <xsl:if test="contains($controlField008-30-31,'k')">Komedier</xsl:if>
597             <xsl:if test="contains($controlField008-30-31,'l')">Foredrag, taler</xsl:if>
598             <xsl:if test="contains($controlField008-30-31,'m')">Memoarer</xsl:if>
599             <xsl:if test="contains($controlField008-30-31,'o')">Eventyr</xsl:if>
600             <xsl:if test="contains($controlField008-30-31,'p')">Dikt</xsl:if>
601             <xsl:if test="contains($controlField008-30-31,'r')">Fremføring av alle typer ikke-musikalske produksjoner</xsl:if>
602             <xsl:if test="contains($controlField008-30-31,'s')">Lyder (f.eks. fuglelyder)</xsl:if>
603             <xsl:if test="contains($controlField008-30-31,'t')">Intervjuer</xsl:if>
604             <xsl:if test="contains($controlField008-30-31,'z')">Andre typer innhold</xsl:if>
605         </xsl:if>
606
607         <!--
608         <xsl:if test="$typeOf008='VM'">
609             <span class="label">; Type of visual material: </span>
610             <xsl:choose>
611                 <xsl:when test="$controlField008-33='a'">
612                     art original
613                 </xsl:when>
614                 <xsl:when test="$controlField008-33='b'">
615                     kit
616                 </xsl:when>
617                 <xsl:when test="$controlField008-33='c'">
618                     art reproduction
619                 </xsl:when>
620                 <xsl:when test="$controlField008-33='d'">
621                     diorama
622                 </xsl:when>
623                 <xsl:when test="$controlField008-33='f'">
624                     filmstrip
625                 </xsl:when>
626                 <xsl:when test="$controlField008-33='g'">
627                     legal article
628                 </xsl:when>
629                 <xsl:when test="$controlField008-33='i'">
630                     picture
631                 </xsl:when>
632                 <xsl:when test="$controlField008-33='k'">
633                     graphic
634                 </xsl:when>
635                 <xsl:when test="$controlField008-33='l'">
636                     technical drawing
637                 </xsl:when>
638                 <xsl:when test="$controlField008-33='m'">
639                     motion picture
640                 </xsl:when>
641                 <xsl:when test="$controlField008-33='n'">
642                     chart
643                 </xsl:when>
644                 <xsl:when test="$controlField008-33='o'">
645                     flash card
646                 </xsl:when>
647                 <xsl:when test="$controlField008-33='p'">
648                     microscope slide
649                 </xsl:when>
650                 <xsl:when test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2
651 ,1)='q']">
652                     model
653                 </xsl:when>
654                 <xsl:when test="$controlField008-33='r'">
655                     realia
656                 </xsl:when>
657                 <xsl:when test="$controlField008-33='s'">
658                     slide
659                 </xsl:when>
660                 <xsl:when test="$controlField008-33='t'">
661                     transparency
662                 </xsl:when>
663                 <xsl:when test="$controlField008-33='v'">
664                     videorecording
665                 </xsl:when>
666                 <xsl:when test="$controlField008-33='w'">
667                     toy
668                 </xsl:when>
669             </xsl:choose>
670         </xsl:if>
671         -->
672
673         </xsl:if>
674
675         <!--
676     <xsl:if test="($typeOf008='Mon' or $typeOf008='Per' or $typeOf008='Mus' or $typeOf008='FV' or $typeOf008='Fil') and ($controlField008-22='a' or $controlField008-22='b' or $controlField008-22='c' or $controlField008-22='d' or $controlField008-22='e' or $controlField008-22='g' or $controlField008-22='j' or $controlField008-22='f')">
677     -->
678     <xsl:if test="$typeOf008='Mon'">
679         <span class="label">; Målgruppe: </span>
680         <xsl:choose>
681                         <xsl:when test="$controlField008-22='a'">Voksne;</xsl:when>
682                         <xsl:when test="$controlField008-22='b'">Billedbøker for voksne;</xsl:when>
683                         <xsl:when test="$controlField008-22='j'">Barn og ungdom;</xsl:when>
684                         <xsl:when test="$controlField008-22='k'">Billedbøker;</xsl:when>
685                         <xsl:when test="$controlField008-22='l'">Barn i alderen til og med 5 år;</xsl:when>
686                         <xsl:when test="$controlField008-22='m'">Elever på 1. til 3. klassetrinn;</xsl:when>
687                         <xsl:when test="$controlField008-22='n'">Elever på 4. og 5. klassetrinn;</xsl:when>
688                         <xsl:when test="$controlField008-22='o'">Elever på 6. og 7. klassetrinn;</xsl:when>
689                         <xsl:when test="$controlField008-22='p'">Elever på ungdomstrinnet;</xsl:when>
690                         <xsl:when test="$controlField008-22='v'">Billedbøker for barn i alderen til og med 5 år;</xsl:when>
691                         <xsl:when test="$controlField008-22='w'">Billedbøker for elever på 1. til 3. klassetrinn;</xsl:when>
692                         <xsl:when test="$controlField008-22='x'">Billedbøker for elever på 4. og 5. klassetrinn;</xsl:when>
693                         <xsl:when test="$controlField008-22='y'">Billedbøker for elever på 6. og 7. klassetrinn;</xsl:when>
694                         <xsl:when test="$controlField008-22='z'">Billedbøker for elever på ungdomstrinnet;</xsl:when>
695                         <xsl:when test="$controlField008-22='f'">Spesialisert;</xsl:when>
696                         <xsl:when test="$controlField008-22='q'">Lettlest;</xsl:when>
697                         <xsl:when test="$controlField008-22='r'">For psykisk utviklingshemmede;</xsl:when>
698                         <xsl:when test="$controlField008-22='s'">Storskrift;</xsl:when>
699                         <xsl:when test="$controlField008-22='g'">Generell;</xsl:when>
700                         <xsl:when test="$controlField008-22='u'">Ukjent;</xsl:when>
701         </xsl:choose>
702     </xsl:if>
703     <xsl:if test="$typeOf008='Per'">
704         <span class="label">; Målgruppe: </span>
705         <xsl:choose>
706                         <xsl:when test="$controlField008-22='a'">Voksne;</xsl:when>
707                         <xsl:when test="$controlField008-22='b'">Tegneserier for voksne;</xsl:when>
708                         <xsl:when test="$controlField008-22='j'">Barn og ungdom;</xsl:when>
709                         <xsl:when test="$controlField008-22='k'">Tegneserier;</xsl:when>
710                         <xsl:when test="$controlField008-22='l'">Barn i alderen til og med 5 år;</xsl:when>
711                         <xsl:when test="$controlField008-22='m'">Elever på 1. til 3. klassetrinn;</xsl:when>
712                         <xsl:when test="$controlField008-22='n'">Elever på 4. og 5. klassetrinn;</xsl:when>
713                         <xsl:when test="$controlField008-22='o'">Elever på 6. og 7. klassetrinn;</xsl:when>
714                         <xsl:when test="$controlField008-22='p'">Elever på ungdomstrinnet;</xsl:when>
715                         <xsl:when test="$controlField008-22='v'">Tegneserier for barn i alderen til og med 5 år;</xsl:when>
716                         <xsl:when test="$controlField008-22='w'">Tegneserier for elever på 1. til 3. klassetrinn;</xsl:when>
717                         <xsl:when test="$controlField008-22='x'">Tegneserier for elever på 4. og 5. klassetrinn;</xsl:when>
718                         <xsl:when test="$controlField008-22='y'">Tegneserier for elever på 6. og 7. klassetrinn;</xsl:when>
719                         <xsl:when test="$controlField008-22='z'">Tegneserier for elever på ungdomstrinnet;</xsl:when>
720                         <xsl:when test="$controlField008-22='f'">Spesialisert;</xsl:when>
721                         <xsl:when test="$controlField008-22='q'">Lettlest;</xsl:when>
722                         <xsl:when test="$controlField008-22='r'">For psykisk utviklingshemmede;</xsl:when>
723                         <xsl:when test="$controlField008-22='s'">Storskrift;</xsl:when>
724                         <xsl:when test="$controlField008-22='g'">Generell;</xsl:when>
725                         <xsl:when test="$controlField008-22='u'">Ukjent;</xsl:when>
726         </xsl:choose>
727     </xsl:if>
728     <xsl:if test="$typeOf008='Fil' or $typeOf008='Mus'">
729         <span class="label">; Målgruppe: </span>
730         <xsl:choose>
731                         <xsl:when test="$controlField008-22='a'">Voksne;</xsl:when>
732                         <xsl:when test="$controlField008-22='j'">Barn og ungdom;</xsl:when>
733                         <xsl:when test="$controlField008-22='1'">Barn i alderen til og med 5 år;</xsl:when>
734                         <xsl:when test="$controlField008-22='m'">Elever på 1. til 3. klassetrinn;</xsl:when>
735                         <xsl:when test="$controlField008-22='n'">Elever på 4. og 5. klassetrinn;</xsl:when>
736                         <xsl:when test="$controlField008-22='o'">Elever på 6. og 7. klassetrinn;</xsl:when>
737                         <xsl:when test="$controlField008-22='p'">Elever på ungdomstrinnet;</xsl:when>
738                         <xsl:when test="$controlField008-22='f'">Spesialisert;</xsl:when>
739                         <xsl:when test="$controlField008-22='q'">Lettlest;</xsl:when>
740                         <xsl:when test="$controlField008-22='r'">For psykisk utviklingshemmede;</xsl:when>
741                         <xsl:when test="$controlField008-22='s'">Storskrift;</xsl:when>
742                         <xsl:when test="$controlField008-22='g'">Generell;</xsl:when>
743                         <xsl:when test="$controlField008-22='u'">Ukjent;</xsl:when>
744         </xsl:choose>
745     </xsl:if>
746     <xsl:if test="$typeOf008='FV'">
747         <span class="label">; Målgruppe: </span>
748         <xsl:choose>
749                         <xsl:when test="$controlField008-22='a'">Voksne;</xsl:when>
750                         <xsl:when test="$controlField008-22='1'">Voksne over 18 år;</xsl:when>
751                         <xsl:when test="$controlField008-22='2'">Voksne over 15 år;</xsl:when>
752                         <xsl:when test="$controlField008-22='j'">Barn og ungdom;</xsl:when>
753                         <xsl:when test="$controlField008-22='4'">Ungdom over 12 år;</xsl:when>
754                         <xsl:when test="$controlField008-22='5'">Barn over 7 år;</xsl:when>
755                         <xsl:when test="$controlField008-22='6'">Småbarn;</xsl:when>
756                         <xsl:when test="$controlField008-22='f'">Spesialisert;</xsl:when>
757                         <xsl:when test="$controlField008-22='g'">Generell;</xsl:when>
758                         <xsl:when test="$controlField008-22='u'">Ukjent;</xsl:when>
759         </xsl:choose>
760     </xsl:if>
761         </span>
762 </xsl:if>
763
764         <!-- Utgivelse, distribusjon osv -->
765     <xsl:if test="marc:datafield[@tag=260]">
766         <span class="results_summary">
767     <span class="label">Utgiver: </span>
768             <xsl:for-each select="marc:datafield[@tag=260]">
769                     <xsl:call-template name="subfieldSelect">
770                         <xsl:with-param name="codes">bcg</xsl:with-param>
771                     </xsl:call-template>
772             </xsl:for-each>
773         </span>
774     </xsl:if>
775
776     <!-- Parallelltittel (R) -->
777     <xsl:if test="marc:datafield[@tag=246]">
778         <span class="results_summary">
779     <span class="label">Parallelltittel: </span>
780             <xsl:for-each select="marc:datafield[@tag=246]">
781                     <xsl:call-template name="subfieldSelect">
782                         <xsl:with-param name="codes">ab</xsl:with-param>
783                     </xsl:call-template>
784             </xsl:for-each>
785         </span>
786
787     </xsl:if>
788
789 <!-- Links found in 856$u. This is copied verbatim from MARC21 detail view and should be identical to code in NORMARC detail view (except for $Show856uAsImage='Results'). -->
790         <xsl:if test="marc:datafield[@tag=856]">
791         <span class="results_summary online_resources"><span class="label">Online resources: </span>
792         <xsl:for-each select="marc:datafield[@tag=856]">
793             <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
794             <a property="url">
795             <xsl:choose>
796               <xsl:when test="$OPACTrackClicks='track'">
797             <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&amp;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
798               </xsl:when>
799               <xsl:when test="$OPACTrackClicks='anonymous'">
800             <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&amp;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
801               </xsl:when>
802               <xsl:otherwise>
803                 <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
804               </xsl:otherwise>
805             </xsl:choose>
806             <xsl:if test="$OPACURLOpenInNewWindow='1'">
807                 <xsl:attribute name="target">_blank</xsl:attribute>
808             </xsl:if>
809             <xsl:choose>
810             <xsl:when test="($Show856uAsImage='Results' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')">
811                 <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="style">height:100px</xsl:attribute></xsl:element><xsl:text></xsl:text>
812             </xsl:when>
813             <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
814                 <xsl:call-template name="subfieldSelect">
815                     <xsl:with-param name="codes">y3z</xsl:with-param>
816                 </xsl:call-template>
817             </xsl:when>
818             <xsl:when test="$URLLinkText!=''">
819                 <xsl:value-of select="$URLLinkText"/>
820             </xsl:when>
821             <xsl:otherwise>
822                 <xsl:text>Click here to access online</xsl:text>
823             </xsl:otherwise>
824             </xsl:choose>
825             </a>
826             <xsl:choose>
827             <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
828             <xsl:otherwise> | </xsl:otherwise>
829             </xsl:choose>
830         </xsl:for-each>
831         </span>
832         </xsl:if>
833 <!-- End of links found in 856$u -->
834
835 <span class="results_summary">
836                         <span class="label">Availability: </span>
837                         <xsl:choose>
838                              <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">No items available
839                                    </xsl:when>
840
841                    <xsl:when test="count(key('item-by-status', 'available'))>0">
842                    <span class="available">
843                        <b><xsl:text>Items available for loan: </xsl:text></b>
844                        <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
845                <xsl:choose>
846                <xsl:when test="$singleBranchMode=1">
847                <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
848                  <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
849                <xsl:text> (</xsl:text>
850                <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
851                 <xsl:text>)</xsl:text>
852                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
853             </xsl:for-each>
854             </xsl:when>
855                <xsl:otherwise>
856                        <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
857                            <xsl:value-of select="items:homebranch"/>
858                                                    <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
859
860                            <xsl:text> (</xsl:text>
861                            <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
862                            <xsl:text>)</xsl:text>
863 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
864                        </xsl:for-each>
865                </xsl:otherwise>
866                </xsl:choose>
867                    </span>
868                    </xsl:when>
869
870                                    </xsl:choose>
871
872                    <xsl:choose>
873                    <xsl:when test="count(key('item-by-status', 'reference'))>0">
874                    <span class="available">
875                        <b><xsl:text>Items available for reference: </xsl:text></b>
876                        <xsl:variable name="reference_items"
877                            select="key('item-by-status', 'reference')"/>
878                        <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
879                            <xsl:if test="$singleBranchMode=0">
880                                <xsl:value-of select="items:homebranch"/>
881                            </xsl:if>
882                                                    <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
883                            <xsl:text> (</xsl:text>
884                            <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
885                            <xsl:text>)</xsl:text>
886                    <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
887
888                        </xsl:for-each>
889                    </span>
890                    </xsl:when>
891                    </xsl:choose>
892
893                    <xsl:if test="count(key('item-by-status', 'Checked out'))>0">
894                    <span class="unavailable">
895                        <xsl:text>Checked out (</xsl:text>
896                        <xsl:value-of select="count(key('item-by-status', 'Checked out'))"/>
897
898                        <xsl:text>). </xsl:text>
899                                    </span>
900                    </xsl:if>
901                    <xsl:if test="count(key('item-by-status', 'Withdrawn'))>0">
902                    <span class="unavailable">
903                        <xsl:text>Withdrawn (</xsl:text>
904                        <xsl:value-of select="count(key('item-by-status', 'Withdrawn'))"/>
905                        <xsl:text>). </xsl:text>                   </span>
906
907                                    </xsl:if>
908                     <xsl:if test="count(key('item-by-status', 'Lost'))>0">
909                    <span class="unavailable">
910                        <xsl:text>Lost (</xsl:text>
911                        <xsl:value-of select="count(key('item-by-status', 'Lost'))"/>
912                        <xsl:text>). </xsl:text>                   </span>
913                                    </xsl:if>
914
915                     <xsl:if test="count(key('item-by-status', 'Damaged'))>0">
916                    <span class="unavailable">
917                        <xsl:text>Damaged (</xsl:text>
918                        <xsl:value-of select="count(key('item-by-status', 'Damaged'))"/>
919                        <xsl:text>). </xsl:text>                   </span>
920                    </xsl:if>
921                     <xsl:if test="count(key('item-by-status', 'On order'))>0">
922
923                    <span class="unavailable">
924                        <xsl:text>On order (</xsl:text>
925                        <xsl:value-of select="count(key('item-by-status', 'On order'))"/>
926                        <xsl:text>). </xsl:text>                   </span>
927                    </xsl:if>
928                     <xsl:if test="count(key('item-by-status', 'In transit'))>0">
929                    <span class="unavailable">
930
931                        <xsl:text>In transit (</xsl:text>
932                        <xsl:value-of select="count(key('item-by-status', 'In transit'))"/>
933                        <xsl:text>). </xsl:text>                   </span>
934                    </xsl:if>
935                     <xsl:if test="count(key('item-by-status', 'Waiting'))>0">
936                    <span class="unavailable">
937                        <xsl:text>On hold (</xsl:text>
938
939                        <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/>
940                        <xsl:text>). </xsl:text>                   </span>
941                    </xsl:if>
942                </span>
943
944     </xsl:template>
945
946     <xsl:template name="termsOfAddress">
947         <xsl:if test="marc:subfield[@code='b' or @code='c']">
948             <xsl:call-template name="chopPunctuation">
949                 <xsl:with-param name="chopString">
950                     <xsl:call-template name="subfieldSelect">
951                         <xsl:with-param name="codes">bc</xsl:with-param>
952                     </xsl:call-template>
953                 </xsl:with-param>
954             </xsl:call-template>
955         </xsl:if>
956     </xsl:template>
957
958     <xsl:template name="nameDate">
959         <xsl:for-each select="marc:subfield[@code='d']">
960             <xsl:call-template name="chopPunctuation">
961                 <xsl:with-param name="chopString" select="."/>
962             </xsl:call-template>
963         </xsl:for-each>
964     </xsl:template>
965
966     <xsl:template name="role">
967         <xsl:for-each select="marc:subfield[@code='e']">
968                     <xsl:value-of select="."/>
969         </xsl:for-each>
970         <xsl:for-each select="marc:subfield[@code='4']">
971                     <xsl:value-of select="."/>
972         </xsl:for-each>
973     </xsl:template>
974
975     <xsl:template name="specialSubfieldSelect">
976         <xsl:param name="anyCodes"/>
977         <xsl:param name="axis"/>
978         <xsl:param name="beforeCodes"/>
979         <xsl:param name="afterCodes"/>
980         <xsl:variable name="str">
981             <xsl:for-each select="marc:subfield">
982                 <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])">
983                     <xsl:value-of select="text()"/>
984                     <xsl:text> </xsl:text>
985                 </xsl:if>
986             </xsl:for-each>
987         </xsl:variable>
988         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
989     </xsl:template>
990
991     <xsl:template name="subtitle">
992         <xsl:if test="marc:subfield[@code='b']">
993                 <xsl:call-template name="chopPunctuation">
994                     <xsl:with-param name="chopString">
995                         <xsl:value-of select="marc:subfield[@code='b']"/>
996
997                         <!--<xsl:call-template name="subfieldSelect">
998                             <xsl:with-param name="codes">b</xsl:with-param>
999                         </xsl:call-template>-->
1000                     </xsl:with-param>
1001                 </xsl:call-template>
1002         </xsl:if>
1003     </xsl:template>
1004
1005     <xsl:template name="chopBrackets">
1006         <xsl:param name="chopString"></xsl:param>
1007         <xsl:variable name="string">
1008             <xsl:call-template name="chopPunctuation">
1009                 <xsl:with-param name="chopString" select="$chopString"></xsl:with-param>
1010             </xsl:call-template>
1011         </xsl:variable>
1012         <xsl:if test="substring($string, 1,1)='['">
1013             <xsl:value-of select="substring($string,2, string-length($string)-2)"></xsl:value-of>
1014         </xsl:if>
1015         <xsl:if test="substring($string, 1,1)!='['">
1016             <xsl:value-of select="$string"></xsl:value-of>
1017         </xsl:if>
1018     </xsl:template>
1019
1020 </xsl:stylesheet>