Bug 19616: Add MARC21 505$g - Formatted Contents Note / Miscellaneous informatoin
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / xslt / MARC21slim2intranetDetail.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 <!-- Edited: Bug 1807 [ENH] XSLT enhancements sponsored by bywater solutions 2015/01/19 WS wsalesky@gmail.com  -->
7 <xsl:stylesheet version="1.0"
8   xmlns:marc="http://www.loc.gov/MARC21/slim"
9   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10   xmlns:str="http://exslt.org/strings"
11   exclude-result-prefixes="marc str">
12     <xsl:import href="MARC21slimUtils.xsl"/>
13     <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14     <xsl:template match="/">
15             <xsl:apply-templates/>
16     </xsl:template>
17
18     <xsl:template match="marc:record">
19
20         <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
21         <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
22         <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
23         <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
24         <xsl:variable name="OPACBaseURL" select="marc:sysprefs/marc:syspref[@name='OPACBaseURL']"/>
25         <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
26         <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
27         <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
28         <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
29         <xsl:variable name="DisplayIconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayIconsXSLT']"/>
30         <xsl:variable name="OpacSuppression" select="marc:sysprefs/marc:syspref[@name='OpacSuppression']"/>
31         <xsl:variable name="TracingQuotesLeft">
32            <xsl:choose>
33              <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
34              <xsl:otherwise>"</xsl:otherwise>
35            </xsl:choose>
36         </xsl:variable>
37         <xsl:variable name="TracingQuotesRight">
38           <xsl:choose>
39             <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
40             <xsl:otherwise>"</xsl:otherwise>
41           </xsl:choose>
42         </xsl:variable>
43
44         <xsl:variable name="leader" select="marc:leader"/>
45         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
46         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
47         <xsl:variable name="leader19" select="substring($leader,20,1)"/>
48         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
49         <xsl:variable name="materialTypeCode">
50             <xsl:choose>
51                 <xsl:when test="$leader19='a'">ST</xsl:when>
52                 <xsl:when test="$leader6='a'">
53                     <xsl:choose>
54                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
55                         <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
56                         <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
57                     </xsl:choose>
58                 </xsl:when>
59                 <xsl:when test="$leader6='t'">BK</xsl:when>
60                 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
61                 <xsl:when test="$leader6='m'">CF</xsl:when>
62                 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
63                 <xsl:when test="$leader6='g'">VM</xsl:when>
64                 <xsl:when test="$leader6='k'">PK</xsl:when>
65                 <xsl:when test="$leader6='r'">OB</xsl:when>
66                 <xsl:when test="$leader6='i'">MU</xsl:when>
67                 <xsl:when test="$leader6='j'">MU</xsl:when>
68                 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
69             </xsl:choose>
70         </xsl:variable>
71         <xsl:variable name="materialTypeLabel">
72             <xsl:choose>
73                 <xsl:when test="$leader19='a'">Set</xsl:when>
74                 <xsl:when test="$leader6='a'">
75                     <xsl:choose>
76                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Text</xsl:when>
77                         <xsl:when test="$leader7='i' or $leader7='s'">
78                             <xsl:choose>
79                                 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing resource</xsl:when>
80                                 <xsl:otherwise>Series</xsl:otherwise>
81                             </xsl:choose>
82                         </xsl:when>
83                         <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
84                     </xsl:choose>
85                 </xsl:when>
86                 <xsl:when test="$leader6='t'">Text</xsl:when>
87                 <xsl:when test="$leader6='o'">Kit</xsl:when>
88                 <xsl:when test="$leader6='p'">Mixed materials</xsl:when>
89                 <xsl:when test="$leader6='m'">Computer file</xsl:when>
90                 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
91                 <xsl:when test="$leader6='g'">Film</xsl:when>
92                 <xsl:when test="$leader6='k'">Picture</xsl:when>
93                 <xsl:when test="$leader6='r'">Object</xsl:when>
94                 <xsl:when test="$leader6='j'">Music</xsl:when>
95                 <xsl:when test="$leader6='i'">Sound</xsl:when>
96                 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
97             </xsl:choose>
98         </xsl:variable>
99
100         <!-- Indicate if record is suppressed in OPAC -->
101         <xsl:if test="$OpacSuppression = 1">
102             <xsl:if test="marc:datafield[@tag=942][marc:subfield[@code='n'] = '1']">
103                 <span class="results_summary suppressed_opac">Suppressed in OPAC</span>
104             </xsl:if>
105         </xsl:if>
106
107         <!-- Title Statement -->
108         <!-- Alternate Graphic Representation (MARC 880) -->
109         <xsl:if test="$display880">
110             <h1 class="title">
111                 <xsl:call-template name="m880Select">
112                     <xsl:with-param name="basetags">245</xsl:with-param>
113                     <xsl:with-param name="codes">abhfgknps</xsl:with-param>
114                 </xsl:call-template>
115             </h1>
116         </xsl:if>
117
118         <!--Bug 13381 -->
119         <xsl:if test="marc:datafield[@tag=245]">
120             <h1 class="title" property="name">
121                 <xsl:for-each select="marc:datafield[@tag=245]">
122                     <xsl:call-template name="subfieldSelect">
123                         <xsl:with-param name="codes">a</xsl:with-param>
124                     </xsl:call-template>
125                     <xsl:text> </xsl:text>
126                     <!-- 13381 add additional subfields-->
127                     <!-- bz 17625 adding subfields f and g -->
128                     <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
129                         <xsl:choose>
130                             <xsl:when test="@code='h'">
131                                 <!--  13381 Span class around subfield h so it can be suppressed via css -->
132                                 <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
133                             </xsl:when>
134                             <xsl:when test="@code='c'">
135                                 <!--  13381 Span class around subfield c so it can be suppressed via css -->
136                                 <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
137                             </xsl:when>
138                             <xsl:otherwise>
139                                 <xsl:apply-templates/>
140                                 <xsl:text> </xsl:text>
141                             </xsl:otherwise>
142                         </xsl:choose>
143                     </xsl:for-each>
144                 </xsl:for-each>
145             </h1>
146         </xsl:if>
147
148         <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
149         <xsl:if test="$display880">
150             <h5 class="author">
151                 <xsl:call-template name="m880Select">
152                     <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
153                     <xsl:with-param name="codes">abc</xsl:with-param>
154                     <xsl:with-param name="index">au</xsl:with-param>
155                     <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
156                     <!-- do not use label 'by ' here, it would be repeated for every occurrence of 100,110,111,700,710,711 -->
157                 </xsl:call-template>
158             </h5>
159         </xsl:if>
160
161         <!-- Author Statement -->
162         <xsl:call-template name="showAuthor">
163             <xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/>
164             <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
165         </xsl:call-template>
166
167         <!-- #13382 Suppress 700$i and 7xx/@ind2=2 -->
168         <xsl:call-template name="showAuthor">
169             <xsl:with-param name="authorfield" select="marc:datafield[(@tag=700 or @tag=710 or @tag=711) and not(@ind2=2) and not(marc:subfield[@code='i'])]"/>
170             <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
171         </xsl:call-template>
172
173     <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''">
174         <span class="results_summary type"><span class="label">Material type: </span>
175     <xsl:element name="img"><xsl:attribute name="class">materialtype mt_icon_<xsl:value-of select="$materialTypeCode"/></xsl:attribute><xsl:attribute name="src">/intranet-tmpl/prog/img/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
176         <xsl:text> </xsl:text>
177         <xsl:value-of select="$materialTypeLabel"/>
178         </span>
179     </xsl:if>
180
181     <xsl:call-template name="show-lang-041"/>
182
183         <!--Series: Alternate Graphic Representation (MARC 880) -->
184         <xsl:if test="$display880">
185             <xsl:call-template name="m880Select">
186                 <xsl:with-param name="basetags">440,490</xsl:with-param>
187                 <xsl:with-param name="codes">av</xsl:with-param>
188                 <xsl:with-param name="class">results_summary series</xsl:with-param>
189                 <xsl:with-param name="label">Series: </xsl:with-param>
190                 <xsl:with-param name="index">se</xsl:with-param>
191             </xsl:call-template>
192         </xsl:if>
193         
194         <!-- Series -->
195         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
196         <span class="results_summary series"><span class="label">Series: </span>
197         <!-- 440 -->
198         <xsl:for-each select="marc:datafield[@tag=440]">
199             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
200             <xsl:call-template name="chopPunctuation">
201                             <xsl:with-param name="chopString">
202                                 <xsl:call-template name="subfieldSelect">
203                                     <xsl:with-param name="codes">av</xsl:with-param>
204                                 </xsl:call-template>
205                             </xsl:with-param>
206                         </xsl:call-template>
207             </a>
208             <xsl:call-template name="part"/>
209             <xsl:choose>
210                 <xsl:when test="position()=last()">
211                     <xsl:if test="../marc:datafield[@tag=490][@ind1!=1]">
212                         <xsl:text>; </xsl:text>
213                     </xsl:if>
214                 </xsl:when>
215                 <xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise>
216             </xsl:choose>
217         </xsl:for-each>
218
219         <!-- 490 Series not traced, Ind1 = 0 -->
220         <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
221             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
222                         <xsl:call-template name="chopPunctuation">
223                             <xsl:with-param name="chopString">
224                                 <xsl:call-template name="subfieldSelect">
225                                     <xsl:with-param name="codes">av</xsl:with-param>
226                                 </xsl:call-template>
227                             </xsl:with-param>
228                         </xsl:call-template>
229             </a>
230                     <xsl:call-template name="part"/>
231         <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
232         </xsl:for-each>
233         <!-- 490 Series traced, Ind1 = 1 -->
234         <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
235             <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811]">
236                 <xsl:choose>
237                     <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
238                         <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute>
239                             <xsl:call-template name="chopPunctuation">
240                                 <xsl:with-param name="chopString">
241                                     <xsl:call-template name="subfieldSelect">
242                                         <xsl:with-param name="codes">a_t</xsl:with-param>
243                                     </xsl:call-template>
244                                 </xsl:with-param>
245                             </xsl:call-template>
246                         </a>
247                     </xsl:when>
248                     <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
249                         <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
250                             <xsl:call-template name="chopPunctuation">
251                                 <xsl:with-param name="chopString">
252                                     <xsl:call-template name="subfieldSelect">
253                                         <xsl:with-param name="codes">a_t</xsl:with-param>
254                                     </xsl:call-template>
255                                 </xsl:with-param>
256                             </xsl:call-template>
257                         </a>
258                     </xsl:when>
259                     <xsl:otherwise>
260                         <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())"/>"&amp;q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
261                             <xsl:call-template name="chopPunctuation">
262                                 <xsl:with-param name="chopString">
263                                     <xsl:call-template name="subfieldSelect">
264                                         <xsl:with-param name="codes">a_t</xsl:with-param>
265                                     </xsl:call-template>
266                                 </xsl:with-param>
267                             </xsl:call-template>
268                         </a>
269                         <xsl:call-template name="part"/>
270                     </xsl:otherwise>
271                 </xsl:choose>
272                 <xsl:text>: </xsl:text>
273                 <xsl:value-of  select="marc:subfield[@code='v']" />
274             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
275             </xsl:for-each>
276
277             <xsl:for-each select="marc:datafield[@tag=830]">
278                 <xsl:choose>
279                     <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
280                         <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
281                             <xsl:call-template name="chopPunctuation">
282                                 <xsl:with-param name="chopString">
283                                     <xsl:call-template name="subfieldSelect">
284                                         <xsl:with-param name="codes">a_t</xsl:with-param>
285                                     </xsl:call-template>
286                                 </xsl:with-param>
287                             </xsl:call-template>
288                         </a>
289                     </xsl:when>
290                     <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
291                         <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
292                             <xsl:call-template name="chopPunctuation">
293                                 <xsl:with-param name="chopString">
294                                     <xsl:call-template name="subfieldSelect">
295                                         <xsl:with-param name="codes">a_t</xsl:with-param>
296                                     </xsl:call-template>
297                                 </xsl:with-param>
298                             </xsl:call-template>
299                         </a>
300                     </xsl:when>
301                     <xsl:otherwise>
302                         <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
303                             <xsl:call-template name="chopPunctuation">
304                                 <xsl:with-param name="chopString">
305                                     <xsl:call-template name="subfieldSelect">
306                                         <xsl:with-param name="codes">a_t</xsl:with-param>
307                                     </xsl:call-template>
308                                 </xsl:with-param>
309                             </xsl:call-template>
310                         </a>
311                         <xsl:call-template name="part"/>
312                     </xsl:otherwise>
313                 </xsl:choose>
314                 <xsl:text>: </xsl:text>
315                 <xsl:value-of  select="marc:subfield[@code='v']" />
316             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
317             </xsl:for-each>
318         </xsl:if>
319
320         </span>
321         </xsl:if>
322
323         <!-- Analytics information -->
324         <xsl:variable name="leader7_class">
325             <xsl:choose>
326                 <!--xsl:when test="$leader7='a'">analytic_mcp</xsl:when-->
327                 <!--xsl:when test="$leader7='b'">analytic_scp</xsl:when-->
328                 <xsl:when test="$leader7='c'">analytic_collection</xsl:when>
329                 <xsl:when test="$leader7='d'">analytic_subunit</xsl:when>
330                 <xsl:when test="$leader7='i'">analytic_ires</xsl:when>
331                 <xsl:when test="$leader7='m'">analytic_monograph</xsl:when>
332                 <xsl:when test="$leader7='s'">analytic_serial</xsl:when>
333                 <xsl:otherwise>analytic_undefined</xsl:otherwise>
334             </xsl:choose>
335         </xsl:variable>
336
337         <xsl:variable name="show_analytics_link" select="marc:variables/marc:variable[@name='show_analytics_link']" />
338         <xsl:if test="$show_analytics_link='1'">
339             <xsl:element name="span">
340                 <xsl:attribute name="class">results_summary analytics <xsl:value-of select="$leader7_class"/></xsl:attribute>
341                 <span class="label">Analytics: </span>
342                 <a>
343                 <xsl:choose>
344                     <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
345                         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+AND+(bib-level:a+OR+bib-level:b)</xsl:attribute>
346                     </xsl:when>
347                     <xsl:otherwise>
348                         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
349                     </xsl:otherwise>
350                 </xsl:choose>
351                 <xsl:text>Show analytics</xsl:text>
352                 </a>
353             </xsl:element>
354         </xsl:if>
355
356         <!-- Volumes of sets and traced series -->
357         <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
358         <span class="results_summary volumes"><span class="label">Volumes: </span>
359             <a>
360             <xsl:choose>
361             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
362                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+NOT+(bib-level:a+OR+bib-level:b)</xsl:attribute>
363             </xsl:when>
364             <xsl:otherwise>
365                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
366             </xsl:otherwise>
367             </xsl:choose>
368             <xsl:text>Show volumes</xsl:text>
369             </a>
370         </span>
371         </xsl:if>
372
373         <!-- Set -->
374         <xsl:if test="$leader19='c'">
375         <span class="results_summary set"><span class="label">Set: </span>
376         <xsl:for-each select="marc:datafield[@tag=773]">
377             <a>
378             <xsl:choose>
379             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
380                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/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>
381             </xsl:when>
382             <xsl:otherwise>
383                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', ''), true())"/></xsl:attribute>
384             </xsl:otherwise>
385             </xsl:choose>
386             <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
387             </a>
388             <xsl:choose>
389                 <xsl:when test="position()=last()"></xsl:when>
390                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
391             </xsl:choose>
392         </xsl:for-each>
393         </span>
394         </xsl:if>
395
396         <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
397         <xsl:if test="$display880">
398             <xsl:call-template name="m880Select">
399                 <xsl:with-param name="basetags">260</xsl:with-param>
400                 <xsl:with-param name="codes">abcg</xsl:with-param>
401                 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
402                 <xsl:with-param name="label">Publisher: </xsl:with-param>
403             </xsl:call-template>
404         </xsl:if>
405
406         <!-- Publisher info and RDA related info from tags 260, 264 -->
407         <xsl:choose>
408             <xsl:when test="marc:datafield[@tag=264]">
409                 <xsl:call-template name="showRDAtag264">
410                    <xsl:with-param name="show_url">1</xsl:with-param>
411                 </xsl:call-template>
412             </xsl:when>
413             <xsl:when test="marc:datafield[@tag=260]">
414                 <span class="results_summary publisher"><span class="label">Publisher: </span>
415                     <xsl:for-each select="marc:datafield[@tag=260]">
416                         <xsl:if test="marc:subfield[@code='a']">
417                             <xsl:call-template name="subfieldSelect">
418                                 <xsl:with-param name="codes">a</xsl:with-param>
419                             </xsl:call-template>
420                         </xsl:if>
421                         <xsl:text> </xsl:text>
422                         <xsl:if test="marc:subfield[@code='b']">
423                         <a>
424                             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Provider:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='b'], true())"/>"</xsl:attribute>
425                             <xsl:call-template name="subfieldSelect">
426                                 <xsl:with-param name="codes">b</xsl:with-param>
427                             </xsl:call-template>
428                        </a>
429                        </xsl:if>
430                        <xsl:text> </xsl:text>
431                         <xsl:call-template name="chopPunctuation">
432                           <xsl:with-param name="chopString">
433                             <xsl:call-template name="subfieldSelect">
434                                 <xsl:with-param name="codes">cg</xsl:with-param>
435                             </xsl:call-template>
436                            </xsl:with-param>
437                        </xsl:call-template>
438                             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
439                     </xsl:for-each>
440                 </span>
441             </xsl:when>
442         </xsl:choose>
443
444         <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
445         <xsl:if test="$display880">
446             <xsl:call-template name="m880Select">
447                 <xsl:with-param name="basetags">250</xsl:with-param>
448                 <xsl:with-param name="codes">ab</xsl:with-param>
449                 <xsl:with-param name="class">results_summary edition</xsl:with-param>
450                 <xsl:with-param name="label">Edition: </xsl:with-param>
451             </xsl:call-template>
452         </xsl:if>
453         
454         <xsl:if test="marc:datafield[@tag=250]">
455         <span class="results_summary edition"><span class="label">Edition: </span>
456             <xsl:for-each select="marc:datafield[@tag=250]">
457                 <xsl:call-template name="chopPunctuation">
458                   <xsl:with-param name="chopString">
459                     <xsl:call-template name="subfieldSelect">
460                         <xsl:with-param name="codes">ab</xsl:with-param>
461                     </xsl:call-template>
462                    </xsl:with-param>
463                </xsl:call-template>
464                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
465             </xsl:for-each>
466         </span>
467         </xsl:if>
468
469         <!-- Description: Alternate Graphic Representation (MARC 880) -->
470         <xsl:if test="$display880">
471             <xsl:call-template name="m880Select">
472                 <xsl:with-param name="basetags">300</xsl:with-param>
473                 <xsl:with-param name="codes">abceg</xsl:with-param>
474                 <xsl:with-param name="class">results_summary description</xsl:with-param>
475                 <xsl:with-param name="label">Description: </xsl:with-param>
476             </xsl:call-template>
477         </xsl:if>
478         
479         <xsl:if test="marc:datafield[@tag=300]">
480         <span class="results_summary description"><span class="label">Description: </span>
481             <xsl:for-each select="marc:datafield[@tag=300]">
482                 <xsl:call-template name="chopPunctuation">
483                   <xsl:with-param name="chopString">
484                     <xsl:call-template name="subfieldSelect">
485                         <xsl:with-param name="codes">abcefg</xsl:with-param>
486                     </xsl:call-template>
487                    </xsl:with-param>
488                </xsl:call-template>
489                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
490             </xsl:for-each>
491         </span>
492        </xsl:if>
493
494         <!-- Content Type -->
495         <xsl:if test="marc:datafield[@tag=336] or marc:datafield[@tag=337] or marc:datafield[@tag=338]">
496             <span class="results_summary" id="content_type">
497                 <xsl:if test="marc:datafield[@tag=336]">
498                     <span class="label">Content type: </span>
499                     <xsl:for-each select="marc:datafield[@tag=336]">
500                         <xsl:call-template name="subfieldSelect">
501                             <xsl:with-param name="codes">a</xsl:with-param>
502                             <xsl:with-param name="delimeter">, </xsl:with-param>
503                         </xsl:call-template>
504                         <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
505                     </xsl:for-each>
506                 </xsl:if>
507                 <xsl:text> </xsl:text>
508                 <!-- Media Type -->
509                 <xsl:if test="marc:datafield[@tag=337]">
510                     <span class="label">Media type: </span>
511                     <xsl:for-each select="marc:datafield[@tag=337]">
512                         <xsl:call-template name="subfieldSelect">
513                             <xsl:with-param name="codes">a</xsl:with-param>
514                             <xsl:with-param name="delimeter">, </xsl:with-param>
515                         </xsl:call-template>
516                         <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
517                     </xsl:for-each>
518                 </xsl:if>
519                 <xsl:text> </xsl:text>
520                 <!-- Media Type -->
521                 <xsl:if test="marc:datafield[@tag=338]">
522                     <span class="label">Carrier type: </span>
523                     <xsl:for-each select="marc:datafield[@tag=338]">
524                         <xsl:call-template name="subfieldSelect">
525                             <xsl:with-param name="codes">a</xsl:with-param>
526                             <xsl:with-param name="delimeter">, </xsl:with-param>
527                         </xsl:call-template>
528                         <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
529                     </xsl:for-each>
530                 </xsl:if>
531             </span>
532         </xsl:if>
533
534         <!-- 385 - Audience -->
535         <xsl:if test="marc:datafield[@tag=385]">
536             <span class="results_summary audience">
537                 <span class="label">Audience: </span>
538                 <xsl:for-each select="marc:datafield[@tag=385]">
539                     <xsl:if test="marc:subfield[@code='m']">
540                         <xsl:call-template name="chopPunctuation">
541                             <xsl:with-param name="chopString">
542                                 <xsl:call-template name="subfieldSelect">
543                                     <xsl:with-param name="codes">m</xsl:with-param>
544                                 </xsl:call-template>
545                             </xsl:with-param>
546                         </xsl:call-template>
547                         <xsl:text>: </xsl:text>
548                     </xsl:if>
549                         <xsl:call-template name="chopPunctuation">
550                             <xsl:with-param name="chopString">
551                                 <xsl:call-template name="subfieldSelect">
552                                     <xsl:with-param name="codes">a</xsl:with-param>
553                                     <xsl:with-param name="delimeter">, </xsl:with-param>
554                                 </xsl:call-template>
555                             </xsl:with-param>
556                         </xsl:call-template>
557                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> | </xsl:text></xsl:otherwise></xsl:choose>
558                 </xsl:for-each>
559             </span>
560         </xsl:if>
561
562         <xsl:call-template name="showISBNISSN"/>
563
564         <xsl:if test="marc:datafield[@tag=013]">
565             <span class="results_summary patent_info">
566                 <span class="label">Patent information: </span>
567                 <xsl:for-each select="marc:datafield[@tag=013]">
568                     <xsl:call-template name="subfieldSelect">
569                         <xsl:with-param name="codes">acdef</xsl:with-param>
570                         <xsl:with-param name="delimeter">, </xsl:with-param>
571                     </xsl:call-template>
572                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
573                 </xsl:for-each>
574             </span>
575         </xsl:if>
576
577         <xsl:if test="marc:datafield[@tag=088]">
578             <span class="results_summary report_number">
579                 <span class="label">Report number: </span>
580                 <xsl:for-each select="marc:datafield[@tag=088]">
581                     <xsl:call-template name="subfieldSelect">
582                         <xsl:with-param name="codes">a</xsl:with-param>
583                     </xsl:call-template>
584                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
585                 </xsl:for-each>
586             </span>
587         </xsl:if>
588
589         <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
590         <xsl:if test="$display880">
591             <xsl:call-template name="m880Select">
592                 <xsl:with-param name="basetags">246</xsl:with-param>
593                 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
594                 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
595                 <xsl:with-param name="label">Other title: </xsl:with-param>
596             </xsl:call-template>
597         </xsl:if>
598
599         <xsl:if test="marc:datafield[@tag=246]">
600             <span class="results_summary other_title"><span class="label">Other title: </span>
601                 <xsl:for-each select="marc:datafield[@tag=246]">
602                     <xsl:if test="marc:subfield[@code='i']">
603                             <xsl:call-template name="subfieldSelect">
604                                     <xsl:with-param name="codes">i</xsl:with-param>
605                             </xsl:call-template>
606                     </xsl:if>
607                        <xsl:text> </xsl:text>
608                     <xsl:call-template name="chopPunctuation">
609                         <xsl:with-param name="chopString">
610                             <xsl:call-template name="subfieldSelect">
611                                 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
612                             </xsl:call-template>
613                         </xsl:with-param>
614                     </xsl:call-template>
615                     <xsl:if test="@ind1=1 and not(marc:subfield[@code='i'])">
616                         <xsl:choose>
617                             <xsl:when test="@ind2=0"> [Portion of title]</xsl:when>
618                             <xsl:when test="@ind2=1"> [Parallel title]</xsl:when>
619                             <xsl:when test="@ind2=2"> [Distinctive title]</xsl:when>
620                             <xsl:when test="@ind2=3"> [Other title]</xsl:when>
621                             <xsl:when test="@ind2=4"> [Cover title]</xsl:when>
622                             <xsl:when test="@ind2=5"> [Added title page title]</xsl:when>
623                             <xsl:when test="@ind2=6"> [Caption title]</xsl:when>
624                             <xsl:when test="@ind2=7"> [Running title]</xsl:when>
625                             <xsl:when test="@ind2=8"> [Spine title]</xsl:when>
626                         </xsl:choose>
627                     </xsl:if>
628                     <!-- #13386 added separator | -->
629                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise></xsl:choose>
630                 </xsl:for-each>
631             </span>
632         </xsl:if>
633
634         <xsl:if test="marc:datafield[@tag=242]">
635         <span class="results_summary translated_title"><span class="label">Title translated: </span>
636             <xsl:for-each select="marc:datafield[@tag=242]">
637                 <xsl:call-template name="chopPunctuation">
638                   <xsl:with-param name="chopString">
639                     <xsl:call-template name="subfieldSelect">
640                         <xsl:with-param name="codes">abchnp</xsl:with-param>
641                     </xsl:call-template>
642                    </xsl:with-param>
643                </xsl:call-template>
644                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
645             </xsl:for-each>
646         </span>
647        </xsl:if>
648
649         <!-- Uniform Title  Statement: Alternate Graphic Representation (MARC 880) -->
650         <xsl:if test="$display880">
651             <xsl:call-template name="m880Select">
652                 <xsl:with-param name="basetags">130,240</xsl:with-param>
653                 <xsl:with-param name="codes">adfklmor</xsl:with-param>
654                 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
655                 <xsl:with-param name="label">Uniform title: </xsl:with-param>
656             </xsl:call-template>
657         </xsl:if>
658
659         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
660             <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
661                 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
662                     <xsl:if test="marc:subfield[@code='i']">
663                             <xsl:call-template name="subfieldSelect">
664                                     <xsl:with-param name="codes">i</xsl:with-param>
665                             </xsl:call-template>
666                     </xsl:if>
667                     <xsl:text> </xsl:text>
668                     <xsl:for-each select="marc:subfield">
669                         <xsl:if test="contains('adfghklmnoprst',@code)">
670                             <xsl:value-of select="text()"/>
671                             <xsl:text> </xsl:text>
672                         </xsl:if>
673                     </xsl:for-each>
674                     <xsl:if test="position() != last()">
675                         <span class="separator"><xsl:text> | </xsl:text></span>
676                     </xsl:if>
677                 </xsl:for-each>
678             </span>
679         </xsl:if>
680
681         <!-- #13382 Added Related works 700$i -->
682         <xsl:if test="marc:datafield[@tag=700][marc:subfield[@code='i']] or marc:datafield[@tag=710][marc:subfield[@code='i']] or marc:datafield[@tag=711][marc:subfield[@code='i']]">
683             <span class="results_summary related_works"><span class="label">Related works: </span>
684                 <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='i']] | marc:datafield[@tag=710][marc:subfield[@code='i']] | marc:datafield[@tag=711][marc:subfield[@code='i']]">
685                     <xsl:variable name="str">
686                         <xsl:call-template name="subfieldSelect">
687                             <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
688                         </xsl:call-template>
689                     </xsl:variable>
690                     <xsl:call-template name="chopPunctuation">
691                         <xsl:with-param name="chopString">
692                             <xsl:value-of select="$str"/>
693                         </xsl:with-param>
694                     </xsl:call-template>
695                     <!-- add relator code too between brackets-->
696                     <xsl:if test="marc:subfield[@code='4' or @code='e']">
697                         <span class="relatorcode">
698                             <xsl:text> [</xsl:text>
699                             <xsl:choose>
700                                 <xsl:when test="marc:subfield[@code='e']">
701                                     <xsl:for-each select="marc:subfield[@code='e']">
702                                         <xsl:value-of select="."/>
703                                         <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
704                                     </xsl:for-each>
705                                 </xsl:when>
706                                 <xsl:otherwise>
707                                     <xsl:for-each select="marc:subfield[@code='4']">
708                                         <xsl:value-of select="."/>
709                                         <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
710                                     </xsl:for-each>
711                                 </xsl:otherwise>
712                             </xsl:choose>
713                             <xsl:text>]</xsl:text>
714                         </span>
715                     </xsl:if>
716                     <xsl:choose>
717                         <xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
718                     </xsl:choose>
719                 </xsl:for-each>
720             </span>
721         </xsl:if>
722
723         <!-- #13382 Added Contained Works 7xx@ind2=2 -->
724         <xsl:if test="marc:datafield[@tag=700][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=710][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=711][@ind2=2 and not(marc:subfield[@code='i'])]">
725             <span class="results_summary contained_works"><span class="label">Contained works: </span>
726                 <xsl:for-each select="marc:datafield[@tag=700][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=710][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=711][@ind2=2][not(marc:subfield[@code='i'])]">
727                     <xsl:variable name="str">
728                         <xsl:call-template name="subfieldSelect">
729                             <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
730                         </xsl:call-template>
731                     </xsl:variable>
732                     <xsl:call-template name="chopPunctuation">
733                         <xsl:with-param name="chopString">
734                             <xsl:value-of select="$str"/>
735                         </xsl:with-param>
736                     </xsl:call-template>
737                     <!-- add relator code too between brackets-->
738                     <xsl:if test="marc:subfield[@code='4' or @code='e']">
739                         <span class="relatorcode">
740                             <xsl:text> [</xsl:text>
741                             <xsl:choose>
742                                 <xsl:when test="marc:subfield[@code='e']">
743                                     <xsl:for-each select="marc:subfield[@code='e']">
744                                         <xsl:value-of select="."/>
745                                         <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
746                                     </xsl:for-each>
747                                 </xsl:when>
748                                 <xsl:otherwise>
749                                     <xsl:for-each select="marc:subfield[@code='4']">
750                                         <xsl:value-of select="."/>
751                                         <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
752                                     </xsl:for-each>
753                                 </xsl:otherwise>
754                             </xsl:choose>
755                             <xsl:text>]</xsl:text>
756                         </span>
757                     </xsl:if>
758                     <xsl:choose>
759                         <xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
760                     </xsl:choose>
761                 </xsl:for-each>
762             </span>
763         </xsl:if>
764
765
766         <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6' and not(@tag=655)]">
767             <span class="results_summary subjects"><span class="label">Subject(s): </span>
768             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6'][not(@tag=655)]">
769             <a>
770             <xsl:choose>
771             <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
772             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
773                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
774             </xsl:when>
775             <xsl:when test="$TraceSubjectSubdivisions='1'">
776                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelectSubject">
777                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
778                         <xsl:with-param name="delimeter"> AND </xsl:with-param>
779                         <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
780                         <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
781                         <xsl:with-param name="urlencode">1</xsl:with-param>
782                     </xsl:call-template>
783                 </xsl:attribute>
784             </xsl:when>
785
786             <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
787             <xsl:otherwise>
788                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='a'],'()',''), true())"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
789             </xsl:otherwise>
790             </xsl:choose>
791
792             <xsl:call-template name="chopPunctuation">
793                 <xsl:with-param name="chopString">
794                     <xsl:call-template name="subfieldSelect">
795                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
796                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
797                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
798                     </xsl:call-template>
799                 </xsl:with-param>
800             </xsl:call-template>
801             </a>
802
803             <xsl:if test="marc:subfield[@code=9]">
804                 <xsl:text> </xsl:text>
805                 <a class='authlink'>
806                     <xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
807                     <xsl:element name="img">
808                         <xsl:attribute name="src">/intranet-tmpl/prog/img/filefind.png</xsl:attribute>
809                         <xsl:attribute name="alt"></xsl:attribute>
810                         <xsl:attribute name="height">15</xsl:attribute>
811                         <xsl:attribute name="width">15</xsl:attribute>
812                     </xsl:element>
813                 </a>
814             </xsl:if>
815
816             <xsl:choose>
817             <xsl:when test="position()=last()"></xsl:when>
818             <xsl:otherwise> | </xsl:otherwise>
819             </xsl:choose>
820
821             </xsl:for-each>
822             </span>
823         </xsl:if>
824
825         <!-- Genre/Form -->
826         <xsl:if test="marc:datafield[@tag=655]">
827             <span class="results_summary genre"><span class="label">Genre/Form: </span>
828                 <xsl:for-each select="marc:datafield[@tag=655]">
829                     <a>
830                         <xsl:choose>
831                             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
832                                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
833                             </xsl:when>
834                             <xsl:when test="$TraceSubjectSubdivisions='1'">
835                                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
836                                     <xsl:with-param name="codes">avxyz</xsl:with-param>
837                                     <xsl:with-param name="delimeter"> AND </xsl:with-param>
838                                     <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
839                                     <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
840                                     <xsl:with-param name="urlencode">1</xsl:with-param>
841                                 </xsl:call-template>
842                                 </xsl:attribute>
843                             </xsl:when>
844                             <xsl:otherwise>
845                                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/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>
846                             </xsl:otherwise>
847                         </xsl:choose>
848                     <xsl:call-template name="subfieldSelect">
849                         <xsl:with-param name="codes">avxyz</xsl:with-param>
850                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
851                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
852                     </xsl:call-template>
853                     </a>
854
855                     <xsl:if test="marc:subfield[@code=9]">
856                         <xsl:text> </xsl:text>
857                         <a class='authlink'>
858                             <xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
859                             <xsl:element name="img">
860                                 <xsl:attribute name="src">/intranet-tmpl/prog/img/filefind.png</xsl:attribute>
861                                 <xsl:attribute name="alt"></xsl:attribute>
862                                 <xsl:attribute name="height">15</xsl:attribute>
863                                 <xsl:attribute name="width">15</xsl:attribute>
864                             </xsl:element>
865                         </a>
866                     </xsl:if>
867                     <xsl:if test="position()!=last()"><span class="separator"> | </span></xsl:if>
868                 </xsl:for-each>
869             </span>
870         </xsl:if>
871
872 <!-- MARC21 776 Additional Physical Form Entry -->
873     <xsl:if test="marc:datafield[@tag=776]">
874         <span class="results_summary add_physical_form">
875             <span class="label">Additional physical formats: </span>
876             <xsl:for-each select="marc:datafield[@tag=776]">
877                 <xsl:variable name="linktext">
878                     <xsl:choose>
879                     <xsl:when test="marc:subfield[@code='t']">
880                         <xsl:value-of select="marc:subfield[@code='t']"/>
881                     </xsl:when>
882                     <xsl:when test="marc:subfield[@code='a']">
883                         <xsl:value-of select="marc:subfield[@code='a']"/>
884                     </xsl:when>
885                     <xsl:otherwise>
886                         <xsl:text>No title</xsl:text>
887                     </xsl:otherwise>
888                     </xsl:choose>
889                 </xsl:variable>
890                 <xsl:if test="@ind2=8 and marc:subfield[@code='i']">
891                     <xsl:call-template name="subfieldSelect">
892                         <xsl:with-param name="codes">i</xsl:with-param>
893                     </xsl:call-template>
894                     <xsl:text>: </xsl:text>
895                 </xsl:if>
896                 <xsl:choose>
897                 <xsl:when test="marc:subfield[@code='w']">
898                     <a>
899                     <xsl:attribute name="href">
900                         <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=control-number:</xsl:text>
901                         <xsl:call-template name="extractControlNumber">
902                             <xsl:with-param name="subfieldW">
903                                 <xsl:value-of select="marc:subfield[@code='w']"/>
904                             </xsl:with-param>
905                         </xsl:call-template>
906                     </xsl:attribute>
907                     <xsl:value-of select="$linktext"/>
908                     </a>
909                 </xsl:when>
910                 <xsl:otherwise>
911                     <xsl:value-of select="$linktext"/>
912                 </xsl:otherwise>
913                 </xsl:choose>
914                 <xsl:if test="position() != last()">
915                     <xsl:text>; </xsl:text>
916                 </xsl:if>
917             </xsl:for-each>
918         </span>
919     </xsl:if>
920
921 <!-- DDC classification -->
922     <xsl:if test="marc:datafield[@tag=082]">
923         <span class="results_summary ddc">
924             <span class="label">DDC classification: </span>
925             <xsl:for-each select="marc:datafield[@tag=082]">
926                 <xsl:call-template name="subfieldSelect">
927                     <xsl:with-param name="codes">a</xsl:with-param>
928                     <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
929                 </xsl:call-template>
930                 <xsl:choose>
931                     <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
932                     <xsl:otherwise> | </xsl:otherwise>
933                 </xsl:choose>
934             </xsl:for-each>
935         </span>
936     </xsl:if>
937
938 <!-- LOC classification -->
939     <xsl:if test="marc:datafield[@tag=050]">
940         <span class="results_summary loc">
941             <span class="label">LOC classification: </span>
942             <xsl:for-each select="marc:datafield[@tag=050]">
943                 <xsl:call-template name="subfieldSelect">
944                     <xsl:with-param name="codes">ab</xsl:with-param>
945                     <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
946                 </xsl:call-template>
947             </xsl:for-each>
948         </span>
949     </xsl:if>
950
951 <!-- NLM classification -->
952     <xsl:if test="marc:datafield[@tag=060]">
953         <span class="results_summary nlm">
954             <span class="label">NLM classification: </span>
955             <xsl:for-each select="marc:datafield[@tag=060]">
956                 <xsl:call-template name="subfieldSelect">
957                     <xsl:with-param name="codes">a</xsl:with-param>
958                     <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
959                 </xsl:call-template>
960                 <xsl:if test="not(position()=last())"><xsl:text> | </xsl:text></xsl:if>
961             </xsl:for-each>
962         </span>
963     </xsl:if>
964
965 <!-- Other classification -->
966     <xsl:if test="marc:datafield[@tag=084]">
967        <span class="results_summary oc">
968            <span class="label">Other classification: </span>
969           <xsl:for-each select="marc:datafield[@tag=084]">
970                 <xsl:call-template name="subfieldSelect">
971                    <xsl:with-param name="codes">a</xsl:with-param>
972                    <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
973                 </xsl:call-template>
974                 <xsl:choose>
975                    <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
976                    <xsl:otherwise> | </xsl:otherwise>
977                 </xsl:choose>
978           </xsl:for-each>
979        </span>
980     </xsl:if>
981
982     <xsl:if test="marc:datafield[@tag=856]">
983         <span class="results_summary online_resources"><span class="label">Online resources: </span>
984         <xsl:for-each select="marc:datafield[@tag=856]">
985             <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
986             <a>
987                 <xsl:attribute name="href">
988                     <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))">
989                         <xsl:choose>
990                             <xsl:when test="@ind1=7">
991                                 <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text>
992                             </xsl:when>
993                             <xsl:when test="@ind1=1">
994                                 <xsl:text>ftp://</xsl:text>
995                             </xsl:when>
996                             <xsl:otherwise>
997                                 <xsl:text>http://</xsl:text>
998                             </xsl:otherwise>
999                         </xsl:choose>
1000                     </xsl:if>
1001                     <xsl:value-of select="marc:subfield[@code='u']"/>
1002                 </xsl:attribute>
1003                 <xsl:choose>
1004                     <xsl:when test="($Show856uAsImage='Details' 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')">
1005                         <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="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text>
1006                     </xsl:when>
1007                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
1008                         <xsl:call-template name="subfieldSelect">
1009                             <xsl:with-param name="codes">y3z</xsl:with-param>
1010                         </xsl:call-template>
1011                     </xsl:when>
1012                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
1013                         <xsl:choose>
1014                             <xsl:when test="$URLLinkText!=''">
1015                                 <xsl:value-of select="$URLLinkText"/>
1016                             </xsl:when>
1017                             <xsl:otherwise>
1018                                 <xsl:text>Click here to access online</xsl:text>
1019                             </xsl:otherwise>
1020                         </xsl:choose>
1021                     </xsl:when>
1022                 </xsl:choose>
1023             </a>
1024             <xsl:choose>
1025                 <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
1026                 <xsl:otherwise> | </xsl:otherwise>
1027             </xsl:choose>
1028
1029         </xsl:for-each>
1030         </span>
1031     </xsl:if>
1032
1033         <xsl:if test="marc:datafield[@tag=505]">
1034             <div class="results_summary contents">
1035             <xsl:choose>
1036             <xsl:when test="marc:datafield[@tag=505]/@ind1=0">
1037                 <span class="label">Contents:</span>
1038             </xsl:when>
1039             <xsl:when test="marc:datafield[@tag=505]/@ind1=1">
1040                 <span class="label">Incomplete contents:</span>
1041             </xsl:when>
1042             <xsl:when test="marc:datafield[@tag=505]/@ind1=2">
1043                 <span class="label">Partial contents:</span>
1044             </xsl:when>
1045             </xsl:choose>
1046                 <xsl:for-each select="marc:datafield[@tag=505]">
1047                     <div class='contentblock'>
1048                         <xsl:choose>
1049                         <xsl:when test="@ind2=0">
1050                             <xsl:call-template name="subfieldSelectSpan">
1051                                 <xsl:with-param name="codes">trug</xsl:with-param>
1052                             </xsl:call-template>
1053                         </xsl:when>
1054                         <xsl:otherwise>
1055                             <xsl:call-template name="subfieldSelectSpan">
1056                                 <xsl:with-param name="codes">atrug</xsl:with-param>
1057                             </xsl:call-template>
1058                         </xsl:otherwise>
1059                         </xsl:choose>
1060                     </div>
1061                 </xsl:for-each>
1062             </div>
1063         </xsl:if>
1064
1065         <!-- 586 -->
1066         <xsl:if test="marc:datafield[@tag=586]">
1067             <span class="results_summary awardsnote">
1068                 <xsl:if test="marc:datafield[@tag=586]/@ind1=' '">
1069                     <span class="label">Awards: </span>
1070                 </xsl:if>
1071                 <xsl:for-each select="marc:datafield[@tag=586]">
1072                     <xsl:value-of select="marc:subfield[@code='a']"/>
1073                     <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
1074                 </xsl:for-each>
1075             </span>
1076         </xsl:if>
1077
1078         <!-- 508 -->
1079         <xsl:if test="marc:datafield[@tag=508]">
1080             <span class="results_summary prod_credits">
1081                 <span class="label">Production credits: </span>
1082                 <xsl:for-each select="marc:datafield[@tag=508]">
1083                     <xsl:call-template name="subfieldSelectSpan">
1084                         <xsl:with-param name="codes">a</xsl:with-param>
1085                     </xsl:call-template>
1086                     <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
1087                 </xsl:for-each>
1088             </span>
1089         </xsl:if>
1090
1091          <!-- 583 -->
1092          <xsl:if test="marc:datafield[@tag=583]">
1093             <span class="results_summary actionnote">
1094                 <span class="label">Action note: </span>
1095                 <xsl:for-each select="marc:datafield[@tag=583]">
1096                     <xsl:choose>
1097                         <xsl:when test="marc:subfield[@code='z']">
1098                             <xsl:value-of select="marc:subfield[@code='z']"/><xsl:text> </xsl:text>
1099                         </xsl:when>
1100                         <xsl:otherwise>
1101                             <xsl:call-template name="subfieldSelect">
1102                                 <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param>
1103                             </xsl:call-template>
1104                         </xsl:otherwise>
1105                     </xsl:choose>
1106                     <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
1107                 </xsl:for-each>
1108             </span>
1109          </xsl:if>
1110
1111         <!-- 773 -->
1112         <xsl:if test="marc:datafield[@tag=773]">
1113             <xsl:for-each select="marc:datafield[@tag=773]">
1114                 <xsl:if test="@ind1 !=1">
1115                     <span class="results_summary in"><span class="label">
1116                     <xsl:choose>
1117                         <xsl:when test="@ind2=' '">
1118                             In:
1119                         </xsl:when>
1120                         <xsl:when test="@ind2=8">
1121                             <xsl:if test="marc:subfield[@code='i']">
1122                                 <xsl:value-of select="marc:subfield[@code='i']"/>
1123                             </xsl:if>
1124                         </xsl:when>
1125                     </xsl:choose>
1126                     </span>
1127                     <xsl:variable name="f773">
1128                         <xsl:call-template name="chopPunctuation">
1129                             <xsl:with-param name="chopString">
1130                                 <xsl:call-template name="subfieldSelect">
1131                                     <xsl:with-param name="codes">a_t</xsl:with-param>
1132                                 </xsl:call-template>
1133                             </xsl:with-param>
1134                         </xsl:call-template>
1135                     </xsl:variable>
1136                     <xsl:choose>
1137                         <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1138                             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/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>
1139                             <xsl:value-of select="translate($f773, '()', '')"/>
1140                             </a>
1141                         </xsl:when>
1142                         <xsl:when test="marc:subfield[@code='0']">
1143                             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute>
1144                             <xsl:value-of select="$f773"/>
1145                             </a>
1146                         </xsl:when>
1147                         <xsl:otherwise>
1148                             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f773, '()', ''), true())"/></xsl:attribute>
1149                             <xsl:value-of select="$f773"/>
1150                             </a>
1151                         </xsl:otherwise>
1152                     </xsl:choose>
1153                     <xsl:if test="marc:subfield[@code='g']">
1154                         <xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/>
1155                     </xsl:if>
1156                     </span>
1157
1158                     <xsl:if test="marc:subfield[@code='n']">
1159                         <span class="results_summary in_note"><xsl:value-of select="marc:subfield[@code='n']"/></span>
1160                     </xsl:if>
1161
1162                 </xsl:if>
1163             </xsl:for-each>
1164         </xsl:if>
1165
1166         <xsl:if test="marc:datafield[@tag=502]">
1167             <span class="results_summary diss_note">
1168                 <span class="label">Dissertation note: </span>
1169                 <xsl:for-each select="marc:datafield[@tag=502]">
1170                     <xsl:call-template name="subfieldSelect">
1171                         <xsl:with-param name="codes">abcdgo</xsl:with-param>
1172                     </xsl:call-template>
1173                 </xsl:for-each>
1174                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
1175             </span>
1176         </xsl:if>
1177
1178         <!-- 866 textual holdings -->
1179         <xsl:if test="marc:datafield[@tag=866]">
1180             <span class="results_summary holdings_note basic_bibliographic_unit"><span class="label">Holdings: </span>
1181                 <xsl:for-each select="marc:datafield[@tag=866]">
1182                     <span class="holdings_note_data">
1183                         <xsl:call-template name="subfieldSelect">
1184                             <xsl:with-param name="codes">axz</xsl:with-param>
1185                         </xsl:call-template>
1186                         <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
1187                     </span>
1188                 </xsl:for-each>
1189             </span>
1190         </xsl:if>
1191
1192         <!-- 867 textual holdings -->
1193         <xsl:if test="marc:datafield[@tag=867]">
1194             <span class="results_summary holdings_note supplementary_material"><span class="label">Supplements: </span>
1195                 <xsl:for-each select="marc:datafield[@tag=867]">
1196                     <span class="holdings_note_data">
1197                         <xsl:call-template name="subfieldSelect">
1198                             <xsl:with-param name="codes">axz</xsl:with-param>
1199                         </xsl:call-template>
1200                         <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
1201                     </span>
1202                 </xsl:for-each>
1203             </span>
1204         </xsl:if>
1205
1206         <!-- 868 textual holdings -->
1207         <xsl:if test="marc:datafield[@tag=868]">
1208             <span class="results_summary holdings_note indexes"><span class="label">Indexes: </span>
1209                 <xsl:for-each select="marc:datafield[@tag=868]">
1210                     <span class="holdings_note_data">
1211                         <xsl:call-template name="subfieldSelect">
1212                             <xsl:with-param name="codes">axz</xsl:with-param>
1213                         </xsl:call-template>
1214                         <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text><br /></xsl:otherwise></xsl:choose>
1215                     </span>
1216                 </xsl:for-each>
1217             </span>
1218         </xsl:if>
1219
1220
1221         <!--  775 Other Edition  -->
1222         <xsl:if test="marc:datafield[@tag=775]">
1223         <span class="results_summary other_editions"><span class="label">Other editions: </span>
1224         <xsl:for-each select="marc:datafield[@tag=775]">
1225             <xsl:variable name="f775">
1226                 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
1227                 <xsl:with-param name="codes">a_t</xsl:with-param>
1228                 </xsl:call-template></xsl:with-param></xsl:call-template>
1229             </xsl:variable>
1230             <xsl:if test="marc:subfield[@code='i']">
1231                 <xsl:call-template name="subfieldSelect">
1232                     <xsl:with-param name="codes">i</xsl:with-param>
1233                 </xsl:call-template>
1234                 <xsl:text>: </xsl:text>
1235             </xsl:if>
1236             <a>
1237             <xsl:choose>
1238             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1239                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/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>
1240             </xsl:when>
1241             <xsl:otherwise>
1242                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f775, '()', ''), true())"/></xsl:attribute>
1243             </xsl:otherwise>
1244             </xsl:choose>
1245             <xsl:call-template name="subfieldSelect">
1246                 <xsl:with-param name="codes">a_t</xsl:with-param>
1247             </xsl:call-template>
1248             </a>
1249             <xsl:choose>
1250                 <xsl:when test="position()=last()"></xsl:when>
1251                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
1252             </xsl:choose>
1253         </xsl:for-each>
1254         </span>
1255         </xsl:if>
1256
1257         <!-- 780 -->
1258         <xsl:if test="marc:datafield[@tag=780]">
1259             <xsl:for-each select="marc:datafield[@tag=780]">
1260                 <xsl:if test="@ind1=0">
1261                     <span class="results_summary preceeding_entry">
1262                         <xsl:choose>
1263                             <xsl:when test="@ind2=0">
1264                                <span class="label">Continues:</span>
1265                             </xsl:when>
1266                             <xsl:when test="@ind2=1">
1267                                <span class="label">Continues in part:</span>
1268                             </xsl:when>
1269                             <xsl:when test="@ind2=2">
1270                                <span class="label">Supersedes:</span>
1271                             </xsl:when>
1272                             <xsl:when test="@ind2=3">
1273                                <span class="label">Supersedes in part:</span>
1274                             </xsl:when>
1275                             <xsl:when test="@ind2=4">
1276                                <span class="label">Formed by the union: ... and: ...</span>
1277                             </xsl:when>
1278                             <xsl:when test="@ind2=5">
1279                                <span class="label">Absorbed:</span>
1280                             </xsl:when>
1281                             <xsl:when test="@ind2=6">
1282                                <span class="label">Absorbed in part:</span>
1283                             </xsl:when>
1284                             <xsl:when test="@ind2=7">
1285                                <span class="label">Separated from:</span>
1286                             </xsl:when>
1287                         </xsl:choose>
1288                         <xsl:text> </xsl:text>
1289
1290                         <xsl:if test="marc:subfield[@code='i']">
1291                             <span class="780_rel_info">
1292                                 <xsl:value-of select="marc:subfield[@code='i']"/>
1293                                 <xsl:text> </xsl:text>
1294                             </span>
1295                         </xsl:if>
1296
1297                         <xsl:variable name="f780">
1298                             <xsl:call-template name="subfieldSelect">
1299                                 <xsl:with-param name="codes">a_t</xsl:with-param>
1300                             </xsl:call-template>
1301                         </xsl:variable>
1302                         <xsl:choose>
1303                             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1304                                 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/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>
1305                                     <xsl:value-of select="$f780"/>
1306                                 </a>
1307                             </xsl:when>
1308                             <xsl:otherwise>
1309                                 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f780, '()', ''), true())"/></xsl:attribute>
1310                                     <xsl:value-of select="$f780"/>
1311                                 </a>
1312                             </xsl:otherwise>
1313                         </xsl:choose>
1314                     </span>
1315
1316                     <xsl:if test="marc:subfield[@code='n']">
1317                         <span class="results_summary preceeding_entry_note"><xsl:value-of select="marc:subfield[@code='n']"/></span>
1318                     </xsl:if>
1319
1320                 </xsl:if>
1321             </xsl:for-each>
1322         </xsl:if>
1323
1324         <!-- 785 -->
1325         <xsl:if test="marc:datafield[@tag=785]">
1326             <xsl:for-each select="marc:datafield[@tag=785]">
1327                 <xsl:if test="@ind1=0">
1328                     <span class="results_summary succeeding_entry">
1329                         <xsl:choose>
1330                             <xsl:when test="@ind2=0">
1331                                 <span class="label">Continued by:</span>
1332                             </xsl:when>
1333                             <xsl:when test="@ind2=1">
1334                                 <span class="label">Continued in part by:</span>
1335                             </xsl:when>
1336                             <xsl:when test="@ind2=2">
1337                                 <span class="label">Superseded by:</span>
1338                             </xsl:when>
1339                             <xsl:when test="@ind2=3">
1340                                 <span class="label">Superseded in part by:</span>
1341                             </xsl:when>
1342                             <xsl:when test="@ind2=4">
1343                                 <span class="label">Absorbed by:</span>
1344                             </xsl:when>
1345                             <xsl:when test="@ind2=5">
1346                                 <span class="label">Absorbed in part by:</span>
1347                             </xsl:when>
1348                             <xsl:when test="@ind2=6">
1349                                 <span class="label">Split into .. and ...:</span>
1350                             </xsl:when>
1351                             <xsl:when test="@ind2=7">
1352                                 <span class="label">Merged with ... to form ...</span>
1353                             </xsl:when>
1354                             <xsl:when test="@ind2=8">
1355                                 <span class="label">Changed back to:</span>
1356                             </xsl:when>
1357                         </xsl:choose>
1358                         <xsl:text> </xsl:text>
1359
1360                         <xsl:if test="marc:subfield[@code='i']">
1361                             <span class="785_rel_info">
1362                                 <xsl:value-of select="marc:subfield[@code='i']"/>
1363                                 <xsl:text> </xsl:text>
1364                             </span>
1365                         </xsl:if>
1366
1367                         <xsl:variable name="f785">
1368                             <xsl:call-template name="subfieldSelect">
1369                                 <xsl:with-param name="codes">a_t</xsl:with-param>
1370                             </xsl:call-template>
1371                         </xsl:variable>
1372
1373                         <xsl:choose>
1374                             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1375                                 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/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>
1376                                     <xsl:value-of select="$f785"/>
1377                                 </a>
1378                             </xsl:when>
1379                             <xsl:otherwise>
1380                                 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f785, '()', ''), true())"/></xsl:attribute>
1381                                     <xsl:value-of select="$f785"/>
1382                                 </a>
1383                             </xsl:otherwise>
1384                         </xsl:choose>
1385
1386                     </span>
1387                 </xsl:if>
1388             </xsl:for-each>
1389         </xsl:if>
1390
1391         <xsl:if test="$OPACBaseURL!=''">
1392         <span class="results_summary opac_view"><span class="label">OPAC view: </span>
1393             <a><xsl:attribute name="href"><xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:datafield[@tag=999]/marc:subfield[@code='c'], true())"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>Open in new window</a>.
1394         </span>
1395         </xsl:if>
1396
1397     </xsl:template>
1398
1399     <xsl:template name="nameABCQ">
1400             <xsl:call-template name="chopPunctuation">
1401                 <xsl:with-param name="chopString">
1402                     <xsl:call-template name="subfieldSelect">
1403                         <xsl:with-param name="codes">abcq</xsl:with-param>
1404                     </xsl:call-template>
1405                 </xsl:with-param>
1406                 <xsl:with-param name="punctuation">
1407                     <xsl:text>:,;/ </xsl:text>
1408                 </xsl:with-param>
1409             </xsl:call-template>
1410     </xsl:template>
1411
1412     <xsl:template name="nameABCDN">
1413             <xsl:call-template name="chopPunctuation">
1414                 <xsl:with-param name="chopString">
1415                     <xsl:call-template name="subfieldSelect">
1416                         <xsl:with-param name="codes">abcdn</xsl:with-param>
1417                     </xsl:call-template>
1418                 </xsl:with-param>
1419                 <xsl:with-param name="punctuation">
1420                     <xsl:text>:,;/ </xsl:text>
1421                 </xsl:with-param>
1422             </xsl:call-template>
1423     </xsl:template>
1424
1425     <xsl:template name="nameACDEQ">
1426             <xsl:call-template name="subfieldSelect">
1427                 <xsl:with-param name="codes">acdeq</xsl:with-param>
1428             </xsl:call-template>
1429     </xsl:template>
1430
1431     <xsl:template name="part">
1432         <xsl:variable name="partNumber">
1433             <xsl:call-template name="specialSubfieldSelect">
1434                 <xsl:with-param name="axis">n</xsl:with-param>
1435                 <xsl:with-param name="anyCodes">n</xsl:with-param>
1436                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1437             </xsl:call-template>
1438         </xsl:variable>
1439         <xsl:variable name="partName">
1440             <xsl:call-template name="specialSubfieldSelect">
1441                 <xsl:with-param name="axis">p</xsl:with-param>
1442                 <xsl:with-param name="anyCodes">p</xsl:with-param>
1443                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1444             </xsl:call-template>
1445         </xsl:variable>
1446         <xsl:if test="string-length(normalize-space($partNumber))">
1447                 <xsl:call-template name="chopPunctuation">
1448                     <xsl:with-param name="chopString" select="$partNumber"/>
1449                 </xsl:call-template>
1450         </xsl:if>
1451         <xsl:if test="string-length(normalize-space($partName))">
1452                 <xsl:call-template name="chopPunctuation">
1453                     <xsl:with-param name="chopString" select="$partName"/>
1454                 </xsl:call-template>
1455         </xsl:if>
1456     </xsl:template>
1457
1458     <xsl:template name="specialSubfieldSelect">
1459         <xsl:param name="anyCodes"/>
1460         <xsl:param name="axis"/>
1461         <xsl:param name="beforeCodes"/>
1462         <xsl:param name="afterCodes"/>
1463         <xsl:variable name="str">
1464             <xsl:for-each select="marc:subfield">
1465                 <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])">
1466                     <xsl:value-of select="text()"/>
1467                     <xsl:text> </xsl:text>
1468                 </xsl:if>
1469             </xsl:for-each>
1470         </xsl:variable>
1471         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1472     </xsl:template>
1473
1474     <xsl:template name="showAuthor">
1475         <xsl:param name="authorfield"/>
1476     <xsl:param name="UseAuthoritiesForTracings"/>
1477         <xsl:if test="count($authorfield)&gt;0">
1478         <h5 class="author">
1479         <xsl:for-each select="$authorfield">
1480         <xsl:choose>
1481           <xsl:when test="position()&gt;1"/>
1482           <!-- #13383 -->
1483           <xsl:when test="@tag&lt;700"><span class="byAuthor">By: </span></xsl:when>
1484           <!--#13382 Changed Additional author to contributor -->
1485           <xsl:otherwise>Contributor(s): </xsl:otherwise>
1486         </xsl:choose>
1487         <a>
1488         <xsl:choose>
1489             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1490                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
1491             </xsl:when>
1492             <xsl:otherwise>
1493             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
1494             </xsl:otherwise>
1495         </xsl:choose>
1496         <xsl:choose>
1497             <xsl:when test="@tag=100 or @tag=110 or @tag=111">
1498                 <!-- #13383 -->
1499                 <xsl:call-template name="chopPunctuation">
1500                     <xsl:with-param name="chopString">
1501                         <xsl:call-template name="subfieldSelect">
1502                             <xsl:with-param name="codes">
1503                                 <xsl:choose>
1504                                     <!-- #13383 include subfield e for field 111, Display only name portion in 1XX -->
1505                                     <xsl:when test="@tag=111">aeq</xsl:when>
1506                                     <xsl:when test="@tag=110">ab</xsl:when>
1507                                     <xsl:otherwise>abcjq</xsl:otherwise>
1508                                 </xsl:choose>
1509                             </xsl:with-param>
1510                         </xsl:call-template>
1511                     </xsl:with-param>
1512                     <xsl:with-param name="punctuation">
1513                         <xsl:text>:,;/ </xsl:text>
1514                     </xsl:with-param>
1515                 </xsl:call-template>
1516                     <!-- Display only name and title portion in 110 field -->
1517                     <xsl:if test="@tag=110 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
1518                     <span class="titleportion">
1519                     <xsl:choose>
1520                         <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1521                         <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1522                     </xsl:choose>
1523                     <xsl:call-template name="chopPunctuation">
1524                         <xsl:with-param name="chopString">
1525                         <xsl:call-template name="subfieldSelect">
1526                             <xsl:with-param name="codes">cdnt</xsl:with-param>
1527                         </xsl:call-template>
1528                         </xsl:with-param>
1529                     </xsl:call-template>
1530                     </span>
1531                     </xsl:if>
1532                     <!-- Display only name and title portion in 111 field -->
1533             <xsl:if test="@tag=111 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
1534                     <span class="titleportion">
1535                     <xsl:choose>
1536                         <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1537                         <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1538                     </xsl:choose>
1539
1540                     <xsl:call-template name="chopPunctuation">
1541                         <xsl:with-param name="chopString">
1542                         <xsl:call-template name="subfieldSelect">
1543                             <xsl:with-param name="codes">cdgnt</xsl:with-param>
1544                         </xsl:call-template>
1545                         </xsl:with-param>
1546                     </xsl:call-template>
1547                     </span>
1548             </xsl:if>
1549             <!-- Display only dates in 100 field -->
1550             <xsl:if test="@tag=100 and marc:subfield[@code='d']">
1551                 <span class="authordates">
1552                 <xsl:text>, </xsl:text>
1553                 <xsl:call-template name="chopPunctuation">
1554                     <xsl:with-param name="chopString">
1555                         <xsl:call-template name="subfieldSelect">
1556                            <xsl:with-param name="codes">d</xsl:with-param>
1557                         </xsl:call-template>
1558                         </xsl:with-param>
1559                     </xsl:call-template>
1560                     </span>
1561             </xsl:if>
1562
1563             </xsl:when>
1564             <!-- #13382 excludes 700$i and ind2=2, displayed as Related Works -->
1565             <!--#13382 Added all relevant subfields 4, e, and d are handled separately -->
1566             <xsl:when test="@tag=700 or @tag=710 or @tag=711">
1567                     <!-- Includes major changes for 7XX fields; display name portion in 710 and 711 fields -->
1568                     <xsl:if test="@tag=710 or @tag=711">
1569                     <xsl:call-template name="chopPunctuation">
1570                         <xsl:with-param name="chopString">
1571                             <xsl:call-template name="subfieldSelect">
1572                             <xsl:with-param name="codes">
1573                             <xsl:choose>
1574                                 <xsl:when test="@tag=711">aeq</xsl:when>
1575                                 <xsl:otherwise>ab</xsl:otherwise>
1576                             </xsl:choose>
1577                             </xsl:with-param>
1578                             </xsl:call-template>
1579                         </xsl:with-param>
1580                         <xsl:with-param name="punctuation">
1581                             <xsl:text>:,;/ </xsl:text>
1582                         </xsl:with-param>
1583                     </xsl:call-template>
1584                     <!-- Display only name and title portion in 711 field -->
1585                     <xsl:if test="@tag=711 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
1586                     <span class="titleportion">
1587                     <xsl:choose>
1588                         <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1589                         <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1590                     </xsl:choose>
1591
1592                     <xsl:call-template name="chopPunctuation">
1593                         <xsl:with-param name="chopString">
1594                         <xsl:call-template name="subfieldSelect">
1595                             <xsl:with-param name="codes">cdgnt</xsl:with-param>
1596                         </xsl:call-template>
1597                         </xsl:with-param>
1598                     </xsl:call-template>
1599                     </span>
1600                     </xsl:if>
1601                     <!-- Display only name and title portion in 710 field -->
1602                     <xsl:if test="@tag=710 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
1603                     <span class="titleportion">
1604                     <xsl:choose>
1605                         <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1606                         <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1607                     </xsl:choose>
1608                     <xsl:call-template name="chopPunctuation">
1609                         <xsl:with-param name="chopString">
1610                         <xsl:call-template name="subfieldSelect">
1611                             <xsl:with-param name="codes">cdnt</xsl:with-param>
1612                         </xsl:call-template>
1613                         </xsl:with-param>
1614                     </xsl:call-template>
1615                     </span>
1616                     </xsl:if>
1617
1618                     </xsl:if>
1619                         <!-- Display only name portion in 700 field -->
1620                         <xsl:if test="@tag=700">
1621                            <xsl:call-template name="chopPunctuation">
1622                                <xsl:with-param name="chopString">
1623                                <xsl:call-template name="subfieldSelect">
1624                                   <xsl:with-param name="codes">abcq</xsl:with-param>
1625                                </xsl:call-template>
1626                                </xsl:with-param>
1627                         </xsl:call-template>
1628                         </xsl:if>
1629                         <!-- Display class "authordates" in 700 field -->
1630                         <xsl:if test="@tag=700 and marc:subfield[@code='d']">
1631                         <span class="authordates">
1632                         <xsl:text>, </xsl:text>
1633                         <xsl:call-template name="chopPunctuation">
1634                             <xsl:with-param name="chopString">
1635                             <xsl:call-template name="subfieldSelect">
1636                                <xsl:with-param name="codes">d</xsl:with-param>
1637                             </xsl:call-template>
1638                             </xsl:with-param>
1639                         </xsl:call-template>
1640                         </span>
1641                         </xsl:if>
1642                         <!-- Display class "titleportion" in 700 field -->
1643                         <xsl:variable name="titleportionfields" select="boolean(marc:subfield[@code='t' or @code='j' or @code='k' or @code='u'])"/>
1644                         <xsl:if test="@tag=700 and $titleportionfields">
1645                         <span class="titleportion">
1646                         <xsl:text>. </xsl:text>
1647                         <xsl:call-template name="chopPunctuation">
1648                             <xsl:with-param name="chopString">
1649                             <xsl:call-template name="subfieldSelect">
1650                                 <xsl:with-param name="codes">fghjklmnoprstux</xsl:with-param>
1651                             </xsl:call-template>
1652                             </xsl:with-param>
1653                         </xsl:call-template>
1654                         </span>
1655                         </xsl:if>
1656
1657         </xsl:when>
1658         </xsl:choose>
1659
1660     <!-- add relator code too between brackets-->
1661     <!-- #13383 include relator code j for field 111 -->
1662             <xsl:if test="(@tag!=111 and @tag!=711 and marc:subfield[@code='4' or @code='e']) or ((@tag=111 or @tag=711) and marc:subfield[@code='4' or @code='j'])">
1663                 <span class="relatorcode">
1664                     <xsl:text> [</xsl:text>
1665                     <xsl:choose>
1666                         <xsl:when test="@tag=111 or @tag=711">
1667                             <xsl:choose>
1668                                 <!-- Prefer j over 4 for fields 111 and 711-->
1669                                 <xsl:when test="marc:subfield[@code='j']">
1670                                     <xsl:for-each select="marc:subfield[@code='j']">
1671                                         <xsl:value-of select="."/>
1672                                         <xsl:if test="position() != last()">, </xsl:if>
1673                                     </xsl:for-each>
1674                                 </xsl:when>
1675                                 <xsl:otherwise>
1676                                     <xsl:for-each select="marc:subfield[@code=4]">
1677                                         <xsl:value-of select="."/>
1678                                         <xsl:if test="position() != last()">, </xsl:if>
1679                                     </xsl:for-each>
1680                                 </xsl:otherwise>
1681                             </xsl:choose>
1682                         </xsl:when>
1683                         <!-- Prefer e over 4 for fields 111 and 711-->
1684                         <xsl:when test="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]">
1685                             <xsl:for-each select="marc:subfield[@code='e']">
1686                                 <xsl:value-of select="."/>
1687                                 <xsl:if test="position() != last()">, </xsl:if>
1688                             </xsl:for-each>
1689                         </xsl:when>
1690                         <xsl:otherwise>
1691                             <xsl:for-each select="marc:subfield[@code=4]">
1692                                 <xsl:value-of select="."/>
1693                                 <xsl:if test="position() != last()">, </xsl:if>
1694                             </xsl:for-each>
1695                         </xsl:otherwise>
1696                     </xsl:choose>
1697                     <xsl:text>]</xsl:text>
1698                 </span>
1699             </xsl:if>
1700         </a>
1701         <xsl:choose>
1702             <xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
1703         </xsl:choose>
1704         </xsl:for-each>
1705         </h5>
1706
1707         </xsl:if>
1708     </xsl:template>
1709
1710     <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
1711     <xsl:template name="subfieldSelectSubject">
1712         <xsl:param name="codes"/>
1713         <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
1714         <xsl:param name="subdivCodes"/>
1715         <xsl:param name="subdivDelimiter"/>
1716         <xsl:param name="prefix"/>
1717         <xsl:param name="suffix"/>
1718         <xsl:param name="urlencode"/>
1719         <xsl:variable name="str">
1720             <xsl:for-each select="marc:subfield">
1721                 <xsl:if test="contains($codes, @code)">
1722                     <xsl:if test="contains($subdivCodes, @code)">
1723                         <xsl:value-of select="$subdivDelimiter"/>
1724                     </xsl:if>
1725                     <xsl:value-of select="$prefix"/><xsl:value-of select="translate(text(),'()','')"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/>
1726                 </xsl:if>
1727             </xsl:for-each>
1728         </xsl:variable>
1729         <xsl:choose>
1730             <xsl:when test="$urlencode=1">
1731                 <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/>
1732             </xsl:when>
1733             <xsl:otherwise>
1734                 <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
1735             </xsl:otherwise>
1736         </xsl:choose>
1737     </xsl:template>
1738
1739 </xsl:stylesheet>