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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl (-1 / +1 lines)
Lines 218-224 Link Here
218
218
219
        <!-- 490 Series not traced, Ind1 = 0 -->
219
        <!-- 490 Series not traced, Ind1 = 0 -->
220
        <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
220
        <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
221
            <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
221
            <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" select="marc:subfield[@code='a']"/></xsl:call-template>"</xsl:attribute>
222
                        <xsl:call-template name="chopPunctuation">
222
                        <xsl:call-template name="chopPunctuation">
223
                            <xsl:with-param name="chopString">
223
                            <xsl:with-param name="chopString">
224
                                <xsl:call-template name="subfieldSelect">
224
                                <xsl:call-template name="subfieldSelect">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl (-1 / +43 lines)
Lines 271-276 Link Here
271
        <xsl:value-of select="$field/marc:subfield[@code='c']"/>
271
        <xsl:value-of select="$field/marc:subfield[@code='c']"/>
272
    </xsl:template>
272
    </xsl:template>
273
273
274
    <xsl:variable name="ascii"> !"#$%&amp;'()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~</xsl:variable>
275
    <xsl:variable name="latin1">&#160;&#161;&#162;&#163;&#164;&#165;&#166;&#167;&#168;&#169;&#170;&#171;&#172;&#173;&#174;&#175;&#176;&#177;&#178;&#179;&#180;&#181;&#182;&#183;&#184;&#185;&#186;&#187;&#188;&#189;&#190;&#191;&#192;&#193;&#194;&#195;&#196;&#197;&#198;&#199;&#200;&#201;&#202;&#203;&#204;&#205;&#206;&#207;&#208;&#209;&#210;&#211;&#212;&#213;&#214;&#215;&#216;&#217;&#218;&#219;&#220;&#221;&#222;&#223;&#224;&#225;&#226;&#227;&#228;&#229;&#230;&#231;&#232;&#233;&#234;&#235;&#236;&#237;&#238;&#239;&#240;&#241;&#242;&#243;&#244;&#245;&#246;&#247;&#248;&#249;&#250;&#251;&#252;&#253;&#254;&#255;</xsl:variable>
276
277
    <!-- Characters that usually don't need to be escaped -->
278
    <xsl:variable name="safe">!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:variable>
279
280
    <xsl:variable name="hex" >0123456789ABCDEF</xsl:variable>
281
    <xsl:template name="url-encode">
282
      <xsl:param name="str"/>   
283
      <xsl:if test="$str">
284
        <xsl:variable name="first-char" select="substring($str,1,1)"/>
285
        <xsl:choose>
286
          <xsl:when test="contains($safe,$first-char)">
287
            <xsl:value-of select="$first-char"/>
288
          </xsl:when>
289
          <xsl:otherwise>
290
            <xsl:variable name="codepoint">
291
              <xsl:choose>
292
                <xsl:when test="contains($ascii,$first-char)">
293
                  <xsl:value-of select="string-length(substring-before($ascii,$first-char)) + 32"/>
294
                </xsl:when>
295
                <xsl:when test="contains($latin1,$first-char)">
296
                  <xsl:value-of select="string-length(substring-before($latin1,$first-char)) + 160"/>
297
                </xsl:when>
298
                <xsl:otherwise>
299
                  <xsl:message terminate="no">Warning: string contains a character that is out of range! Substituting "?".</xsl:message>
300
                  <xsl:text>63</xsl:text>
301
                </xsl:otherwise>
302
              </xsl:choose>
303
            </xsl:variable>
304
          <xsl:variable name="hex-digit1" select="substring($hex,floor($codepoint div 16) + 1,1)"/>
305
          <xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/>
306
          <xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/>
307
          </xsl:otherwise>
308
        </xsl:choose>
309
        <xsl:if test="string-length($str) &gt; 1">
310
          <xsl:call-template name="url-encode">
311
            <xsl:with-param name="str" select="substring($str,2)"/>
312
          </xsl:call-template>
313
        </xsl:if>
314
      </xsl:if>
315
    </xsl:template>
316
274
</xsl:stylesheet>
317
</xsl:stylesheet>
275
318
276
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
319
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
277
- 

Return to bug 14716