View | Details | Raw Unified | Return to bug 16804
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl (-2 / +2 lines)
Lines 221-227 Link Here
221
221
222
        <!-- 490 Series not traced, Ind1 = 0 -->
222
        <!-- 490 Series not traced, Ind1 = 0 -->
223
        <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
223
        <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
224
            <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
224
                <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:call-template name="url-encode"><xsl:with-param name="str"><xsl:value-of select="marc:subfield[@code='a']"/></xsl:with-param></xsl:call-template>"</xsl:attribute>
225
                        <xsl:call-template name="chopPunctuation">
225
                        <xsl:call-template name="chopPunctuation">
226
                            <xsl:with-param name="chopString">
226
                            <xsl:with-param name="chopString">
227
                                <xsl:call-template name="subfieldSelect">
227
                                <xsl:call-template name="subfieldSelect">
Lines 249-255 Link Here
249
                        </a>
249
                        </a>
250
                    </xsl:when>
250
                    </xsl:when>
251
                    <xsl:otherwise>
251
                    <xsl:otherwise>
252
                        <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
252
                            <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:call-template name="url-encode"><xsl:with-param name="str"><xsl:value-of select="marc:subfield[@code='a']"/></xsl:with-param></xsl:call-template>"</xsl:attribute>
253
                            <xsl:call-template name="chopPunctuation">
253
                            <xsl:call-template name="chopPunctuation">
254
                                <xsl:with-param name="chopString">
254
                                <xsl:with-param name="chopString">
255
                                    <xsl:call-template name="subfieldSelect">
255
                                    <xsl:call-template name="subfieldSelect">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl (-1 / +56 lines)
Lines 1-6 Link Here
1
<?xml version='1.0'?>
1
<?xml version='1.0'?>
2
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
2
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
3
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
3
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
4
 <!-- url encoding -->
5
6
 <xsl:variable name="ascii">
7
 <xsl:text> !"#$%&amp;'()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~</xsl:text>
8
 </xsl:variable>
9
10
 <xsl:variable name="latin1">
11
 <xsl:text> ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ</xsl:text>
12
 </xsl:variable>
13
 <!-- Characters that usually don't need to be escaped -->
14
 <xsl:variable name="safe">
15
 <xsl:text>!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:text>
16
 </xsl:variable>
17
18
 <xsl:variable name="hex">0123456789ABCDEF</xsl:variable>
19
4
	<xsl:template name="datafield">
20
	<xsl:template name="datafield">
5
		<xsl:param name="tag"/>
21
		<xsl:param name="tag"/>
6
		<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
22
		<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
Lines 295-300 Link Here
295
311
296
        </span>
312
        </span>
297
    </xsl:template>
313
    </xsl:template>
314
315
    <xsl:template name="url-encode">
316
        <xsl:param name="str"/>
317
        <xsl:if test="$str">
318
            <xsl:variable name="first-char" select="substring($str,1,1)"/>
319
            <xsl:choose>
320
                    <xsl:when test="contains($safe,$first-char)">
321
                        <xsl:value-of select="$first-char"/>
322
                    </xsl:when>
323
                <xsl:otherwise>
324
                <xsl:variable name="codepoint">
325
                    <xsl:choose>
326
                        <xsl:when test="contains($ascii,$first-char)">
327
                            <xsl:value-of select="string-length(substring-before($ascii,$first-char)) + 32"/>
328
                        </xsl:when>
329
                        <xsl:when test="contains($latin1,$first-char)">
330
                            <xsl:value-of select="string-length(substring-before($latin1,$first-char)) + 160"/>
331
                            <!-- was 160 -->
332
                        </xsl:when>
333
                        <xsl:otherwise>
334
                            <xsl:message terminate="no">Warning: string contains a character that is out of range! Substituting "?".</xsl:message>
335
                            <xsl:text>63</xsl:text>
336
                        </xsl:otherwise>
337
                    </xsl:choose>
338
                </xsl:variable>
339
                <xsl:variable name="hex-digit1" select="substring($hex,floor($codepoint div 16) + 1,1)"/>
340
                <xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/>
341
                <xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/>
342
               </xsl:otherwise>
343
            </xsl:choose>
344
         <xsl:if test="string-length($str) &gt; 1">
345
                <xsl:call-template name="url-encode">
346
                    <xsl:with-param name="str" select="substring($str,2)"/>
347
                </xsl:call-template>
348
            </xsl:if>
349
        </xsl:if>
350
    </xsl:template>
351
352
353
298
</xsl:stylesheet>
354
</xsl:stylesheet>
299
355
300
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
356
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
301
- 

Return to bug 16804