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

(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl (-17 / +29 lines)
Lines 8-14 Link Here
8
  xmlns:marc="http://www.loc.gov/MARC21/slim"
8
  xmlns:marc="http://www.loc.gov/MARC21/slim"
9
  xmlns:items="http://www.koha-community.org/items"
9
  xmlns:items="http://www.koha-community.org/items"
10
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11
  exclude-result-prefixes="marc items">
11
  xmlns:str="http://exslt.org/strings"
12
  exclude-result-prefixes="marc items str">
12
    <xsl:import href="MARC21slimUtils.xsl"/>
13
    <xsl:import href="MARC21slimUtils.xsl"/>
13
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14
    <xsl:template match="/">
15
    <xsl:template match="/">
Lines 189-195 Link Here
189
        <span class="results_summary series"><span class="label">Series: </span>
190
        <span class="results_summary series"><span class="label">Series: </span>
190
        <!-- 440 -->
191
        <!-- 440 -->
191
        <xsl:for-each select="marc:datafield[@tag=440]">
192
        <xsl:for-each select="marc:datafield[@tag=440]">
192
            <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
193
            <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>
193
            <xsl:call-template name="chopPunctuation">
194
            <xsl:call-template name="chopPunctuation">
194
                            <xsl:with-param name="chopString">
195
                            <xsl:with-param name="chopString">
195
                                <xsl:call-template name="subfieldSelect">
196
                                <xsl:call-template name="subfieldSelect">
Lines 204-210 Link Here
204
205
205
        <!-- 490 Series not traced, Ind1 = 0 -->
206
        <!-- 490 Series not traced, Ind1 = 0 -->
206
        <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
207
        <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
207
            <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
208
            <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>
208
                        <xsl:call-template name="chopPunctuation">
209
                        <xsl:call-template name="chopPunctuation">
209
                            <xsl:with-param name="chopString">
210
                            <xsl:with-param name="chopString">
210
                                <xsl:call-template name="subfieldSelect">
211
                                <xsl:call-template name="subfieldSelect">
Lines 221-227 Link Here
221
            <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
222
            <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
222
                <xsl:choose>
223
                <xsl:choose>
223
                    <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
224
                    <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
224
                        <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
225
                        <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>
225
                            <xsl:call-template name="chopPunctuation">
226
                            <xsl:call-template name="chopPunctuation">
226
                                <xsl:with-param name="chopString">
227
                                <xsl:with-param name="chopString">
227
                                    <xsl:call-template name="subfieldSelect">
228
                                    <xsl:call-template name="subfieldSelect">
Lines 232-238 Link Here
232
                        </a>
233
                        </a>
233
                    </xsl:when>
234
                    </xsl:when>
234
                    <xsl:otherwise>
235
                    <xsl:otherwise>
235
                        <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
236
                        <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>
236
                            <xsl:call-template name="chopPunctuation">
237
                            <xsl:call-template name="chopPunctuation">
237
                                <xsl:with-param name="chopString">
238
                                <xsl:with-param name="chopString">
238
                                    <xsl:call-template name="subfieldSelect">
239
                                    <xsl:call-template name="subfieldSelect">
Lines 262-268 Link Here
262
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
263
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
263
            </xsl:when>
264
            </xsl:when>
264
            <xsl:otherwise>
265
            <xsl:otherwise>
265
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Host-item:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
266
                <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>
266
            </xsl:otherwise>
267
            </xsl:otherwise>
267
            </xsl:choose>
268
            </xsl:choose>
268
            <xsl:text>Show analytics</xsl:text>
269
            <xsl:text>Show analytics</xsl:text>
Lines 279-285 Link Here
279
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute>
280
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute>
280
            </xsl:when>
281
            </xsl:when>
281
            <xsl:otherwise>
282
            <xsl:otherwise>
282
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
283
                <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>
283
            </xsl:otherwise>
284
            </xsl:otherwise>
284
            </xsl:choose>
285
            </xsl:choose>
285
            <xsl:text>Show volumes</xsl:text>
286
            <xsl:text>Show volumes</xsl:text>
Lines 297-303 Link Here
297
                <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>
298
                <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>
298
            </xsl:when>
299
            </xsl:when>
299
            <xsl:otherwise>
300
            <xsl:otherwise>
300
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute>
301
                <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>
301
            </xsl:otherwise>
302
            </xsl:otherwise>
302
            </xsl:choose>
303
            </xsl:choose>
303
            <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
304
            <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
Lines 337-343 Link Here
337
                        </xsl:if>
338
                        </xsl:if>
338
                        <xsl:text> </xsl:text>
339
                        <xsl:text> </xsl:text>
339
                        <xsl:if test="marc:subfield[@code='b']">
340
                        <xsl:if test="marc:subfield[@code='b']">
340
                        <a href="/cgi-bin/koha/catalogue/search.pl?q=Provider:{marc:subfield[@code='b']}">
341
                        <a>
342
                            <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>
341
                            <xsl:call-template name="subfieldSelect">
343
                            <xsl:call-template name="subfieldSelect">
342
                                <xsl:with-param name="codes">b</xsl:with-param>
344
                                <xsl:with-param name="codes">b</xsl:with-param>
343
                            </xsl:call-template>
345
                            </xsl:call-template>
Lines 694-706 Link Here
694
                        <xsl:with-param name="delimeter"> AND </xsl:with-param>
696
                        <xsl:with-param name="delimeter"> AND </xsl:with-param>
695
                        <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
697
                        <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
696
                        <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
698
                        <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
699
                        <xsl:with-param name="urlencode">1</xsl:with-param>
697
                    </xsl:call-template>
700
                    </xsl:call-template>
698
                </xsl:attribute>
701
                </xsl:attribute>
699
            </xsl:when>
702
            </xsl:when>
700
703
701
            <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
704
            <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
702
            <xsl:otherwise>
705
            <xsl:otherwise>
703
                <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="translate(marc:subfield[@code='a'],'()','')"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
706
                <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>
704
            </xsl:otherwise>
707
            </xsl:otherwise>
705
            </xsl:choose>
708
            </xsl:choose>
706
709
Lines 752-757 Link Here
752
                                    <xsl:with-param name="delimeter"> AND </xsl:with-param>
755
                                    <xsl:with-param name="delimeter"> AND </xsl:with-param>
753
                                    <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
756
                                    <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
754
                                    <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
757
                                    <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
758
                                    <xsl:with-param name="urlencode">1</xsl:with-param>
755
                                </xsl:call-template>
759
                                </xsl:call-template>
756
                                </xsl:attribute>
760
                                </xsl:attribute>
757
                            </xsl:when>
761
                            </xsl:when>
Lines 1000-1006 Link Here
1000
                    </a>
1004
                    </a>
1001
                </xsl:when>
1005
                </xsl:when>
1002
                <xsl:otherwise>
1006
                <xsl:otherwise>
1003
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
1007
                    <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>
1004
                        <xsl:value-of select="$f773"/>
1008
                        <xsl:value-of select="$f773"/>
1005
                    </a>
1009
                    </a>
1006
                    <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
1010
                    <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
Lines 1061-1067 Link Here
1061
                <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>
1065
                <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>
1062
            </xsl:when>
1066
            </xsl:when>
1063
            <xsl:otherwise>
1067
            <xsl:otherwise>
1064
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
1068
                <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>
1065
            </xsl:otherwise>
1069
            </xsl:otherwise>
1066
            </xsl:choose>
1070
            </xsl:choose>
1067
            <xsl:call-template name="subfieldSelect">
1071
            <xsl:call-template name="subfieldSelect">
Lines 1120-1126 Link Here
1120
                    </a>
1124
                    </a>
1121
                </xsl:when>
1125
                </xsl:when>
1122
                <xsl:otherwise>
1126
                <xsl:otherwise>
1123
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
1127
                    <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>
1124
                        <xsl:value-of select="translate($f780, '()', '')"/>
1128
                        <xsl:value-of select="translate($f780, '()', '')"/>
1125
                    </a>
1129
                    </a>
1126
                </xsl:otherwise>
1130
                </xsl:otherwise>
Lines 1182-1188 Link Here
1182
                    </a>
1186
                    </a>
1183
                </xsl:when>
1187
                </xsl:when>
1184
                <xsl:otherwise>
1188
                <xsl:otherwise>
1185
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
1189
                    <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>
1186
                        <xsl:value-of select="translate($f785, '()', '')"/>
1190
                        <xsl:value-of select="translate($f785, '()', '')"/>
1187
                    </a>
1191
                    </a>
1188
                </xsl:otherwise>
1192
                </xsl:otherwise>
Lines 1291-1300 Link Here
1291
        <a>
1295
        <a>
1292
        <xsl:choose>
1296
        <xsl:choose>
1293
            <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1297
            <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1294
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
1298
                <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>
1295
            </xsl:when>
1299
            </xsl:when>
1296
            <xsl:otherwise>
1300
            <xsl:otherwise>
1297
            <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
1301
            <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>
1298
            </xsl:otherwise>
1302
            </xsl:otherwise>
1299
        </xsl:choose>
1303
        </xsl:choose>
1300
        <xsl:choose>
1304
        <xsl:choose>
Lines 1519-1524 Link Here
1519
        <xsl:param name="subdivDelimiter"/>
1523
        <xsl:param name="subdivDelimiter"/>
1520
        <xsl:param name="prefix"/>
1524
        <xsl:param name="prefix"/>
1521
        <xsl:param name="suffix"/>
1525
        <xsl:param name="suffix"/>
1526
        <xsl:param name="urlencode"/>
1522
        <xsl:variable name="str">
1527
        <xsl:variable name="str">
1523
            <xsl:for-each select="marc:subfield">
1528
            <xsl:for-each select="marc:subfield">
1524
                <xsl:if test="contains($codes, @code)">
1529
                <xsl:if test="contains($codes, @code)">
Lines 1529-1535 Link Here
1529
                </xsl:if>
1534
                </xsl:if>
1530
            </xsl:for-each>
1535
            </xsl:for-each>
1531
        </xsl:variable>
1536
        </xsl:variable>
1532
        <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
1537
        <xsl:choose>
1538
            <xsl:when test="$urlencode=1">
1539
                <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/>
1540
            </xsl:when>
1541
            <xsl:otherwise>
1542
                <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
1543
            </xsl:otherwise>
1544
        </xsl:choose>
1533
    </xsl:template>
1545
    </xsl:template>
1534
1546
1535
</xsl:stylesheet>
1547
</xsl:stylesheet>
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl (-2 / +3 lines)
Lines 5-11 Link Here
5
  xmlns:marc="http://www.loc.gov/MARC21/slim"
5
  xmlns:marc="http://www.loc.gov/MARC21/slim"
6
  xmlns:items="http://www.koha-community.org/items"
6
  xmlns:items="http://www.koha-community.org/items"
7
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8
  exclude-result-prefixes="marc items">
8
  xmlns:str="http://exslt.org/strings"
9
  exclude-result-prefixes="marc items str">
9
    <xsl:import href="MARC21slimUtils.xsl"/>
10
    <xsl:import href="MARC21slimUtils.xsl"/>
10
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
11
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
11
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
12
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
Lines 355-361 Link Here
355
                        <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
356
                        <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
356
                    </xsl:when>
357
                    </xsl:when>
357
                    <xsl:otherwise>
358
                    <xsl:otherwise>
358
                        <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
359
                        <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>
359
                    </xsl:otherwise>
360
                    </xsl:otherwise>
360
                </xsl:choose>
361
                </xsl:choose>
361
                <xsl:call-template name="chopPunctuation">
362
                <xsl:call-template name="chopPunctuation">
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl (-4 / +17 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"
4
  xmlns:marc="http://www.loc.gov/MARC21/slim"
5
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6
  xmlns:str="http://exslt.org/strings"
7
  exclude-result-prefixes="marc">
4
	<xsl:template name="datafield">
8
	<xsl:template name="datafield">
5
		<xsl:param name="tag"/>
9
		<xsl:param name="tag"/>
6
		<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
10
		<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
Lines 27-32 Link Here
27
		<xsl:param name="subdivDelimiter"/>
31
		<xsl:param name="subdivDelimiter"/>
28
        <xsl:param name="prefix"/>
32
        <xsl:param name="prefix"/>
29
        <xsl:param name="suffix"/>
33
        <xsl:param name="suffix"/>
34
        <xsl:param name="urlencode"/>
30
		<xsl:variable name="str">
35
		<xsl:variable name="str">
31
			<xsl:for-each select="marc:subfield">
36
			<xsl:for-each select="marc:subfield">
32
				<xsl:if test="contains($codes, @code)">
37
				<xsl:if test="contains($codes, @code)">
Lines 37-43 Link Here
37
				</xsl:if>
42
				</xsl:if>
38
			</xsl:for-each>
43
			</xsl:for-each>
39
		</xsl:variable>
44
		</xsl:variable>
40
		<xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
45
        <xsl:choose>
46
            <xsl:when test="$urlencode=1">
47
                <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter))    )"/>
48
            </xsl:when>
49
            <xsl:otherwise>
50
                <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
51
            </xsl:otherwise>
52
        </xsl:choose>
41
	</xsl:template>
53
	</xsl:template>
42
54
43
    <xsl:template name="subfieldSelectSpan">
55
    <xsl:template name="subfieldSelectSpan">
Lines 197-203 Link Here
197
                        </xsl:when>
209
                        </xsl:when>
198
                        <xsl:when test="boolean($index)">
210
                        <xsl:when test="boolean($index)">
199
                            <a>
211
                            <a>
200
                                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of  select="$index"/>:<xsl:value-of  select="marc:subfield[@code='a']"/></xsl:attribute>
212
                                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="str:encode-uri($index, true())"/>:<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/></xsl:attribute>
201
                                <xsl:value-of select="$str"/>
213
                                <xsl:value-of select="$str"/>
202
                            </a>
214
                            </a>
203
                        </xsl:when>
215
                        </xsl:when>
Lines 271-277 Link Here
271
            <xsl:choose>
283
            <xsl:choose>
272
                <xsl:when test="$url='1'">
284
                <xsl:when test="$url='1'">
273
                    <xsl:if test="$field/marc:subfield[@code='b']">
285
                    <xsl:if test="$field/marc:subfield[@code='b']">
274
                         <a href="/cgi-bin/koha/catalogue/search.pl?q=Provider:{$field/marc:subfield[@code='b']}">
286
                         <a>
287
                         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Provider:<xsl:value-of select="str:encode-uri($field/marc:subfield[@code='b'], true())"/></xsl:attribute>
275
                         <xsl:call-template name="subfieldSelect">
288
                         <xsl:call-template name="subfieldSelect">
276
                             <xsl:with-param name="codes">b</xsl:with-param>
289
                             <xsl:with-param name="codes">b</xsl:with-param>
277
                         </xsl:call-template>
290
                         </xsl:call-template>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl (-15 / +25 lines)
Lines 7-13 Link Here
7
  xmlns:items="http://www.koha-community.org/items"
7
  xmlns:items="http://www.koha-community.org/items"
8
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9
  xmlns:str="http://exslt.org/strings"
9
  xmlns:str="http://exslt.org/strings"
10
  exclude-result-prefixes="marc items">
10
  exclude-result-prefixes="marc items str">
11
    <xsl:import href="MARC21slimUtils.xsl"/>
11
    <xsl:import href="MARC21slimUtils.xsl"/>
12
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
12
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
13
13
Lines 206-212 Link Here
206
        <span class="results_summary series"><span class="label">Series: </span>
206
        <span class="results_summary series"><span class="label">Series: </span>
207
        <!-- 440 -->
207
        <!-- 440 -->
208
        <xsl:for-each select="marc:datafield[@tag=440]">
208
        <xsl:for-each select="marc:datafield[@tag=440]">
209
            <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
209
            <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
210
            <xsl:call-template name="chopPunctuation">
210
            <xsl:call-template name="chopPunctuation">
211
                            <xsl:with-param name="chopString">
211
                            <xsl:with-param name="chopString">
212
                                <xsl:call-template name="subfieldSelect">
212
                                <xsl:call-template name="subfieldSelect">
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:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</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 238-244 Link Here
238
            <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
238
            <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
239
                <xsl:choose>
239
                <xsl:choose>
240
                    <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
240
                    <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
241
                        <a href="/cgi-bin/koha/opac-search.pl?q=rcn:{marc:subfield[@code='w']}">
241
                        <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute>
242
                            <xsl:call-template name="chopPunctuation">
242
                            <xsl:call-template name="chopPunctuation">
243
                                <xsl:with-param name="chopString">
243
                                <xsl:with-param name="chopString">
244
                                    <xsl:call-template name="subfieldSelect">
244
                                    <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:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</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">
Lines 275-284 Link Here
275
            <a>
275
            <a>
276
            <xsl:choose>
276
            <xsl:choose>
277
            <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
277
            <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
278
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
278
                <xsl:attribute name="href">/cgi-bin/koha/opac-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>
279
            </xsl:when>
279
            </xsl:when>
280
            <xsl:otherwise>
280
            <xsl:otherwise>
281
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
281
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
282
            </xsl:otherwise>
282
            </xsl:otherwise>
283
            </xsl:choose>
283
            </xsl:choose>
284
            <xsl:text>Show analytics</xsl:text>
284
            <xsl:text>Show analytics</xsl:text>
Lines 292-301 Link Here
292
            <a>
292
            <a>
293
            <xsl:choose>
293
            <xsl:choose>
294
            <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
294
            <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
295
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute>
295
                <xsl:attribute name="href">/cgi-bin/koha/opac-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>
296
            </xsl:when>
296
            </xsl:when>
297
            <xsl:otherwise>
297
            <xsl:otherwise>
298
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
298
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
299
            </xsl:otherwise>
299
            </xsl:otherwise>
300
            </xsl:choose>
300
            </xsl:choose>
301
            <xsl:text>Show volumes</xsl:text>
301
            <xsl:text>Show volumes</xsl:text>
Lines 313-319 Link Here
313
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
313
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
314
            </xsl:when>
314
            </xsl:when>
315
            <xsl:otherwise>
315
            <xsl:otherwise>
316
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute>
316
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', ''), true())"/></xsl:attribute>
317
            </xsl:otherwise>
317
            </xsl:otherwise>
318
            </xsl:choose>
318
            </xsl:choose>
319
            <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
319
            <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
Lines 356-362 Link Here
356
                     </xsl:if>
356
                     </xsl:if>
357
                     <xsl:text> </xsl:text>
357
                     <xsl:text> </xsl:text>
358
                     <xsl:if test="marc:subfield[@code='b']">
358
                     <xsl:if test="marc:subfield[@code='b']">
359
                     <span property="name"><a href="/cgi-bin/koha/opac-search.pl?q=Provider:{marc:subfield[@code='b']}">
359
                     <span property="name"><a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri(marc:subfield[@code='b'], true())"/></xsl:attribute>
360
                         <xsl:call-template name="subfieldSelect">
360
                         <xsl:call-template name="subfieldSelect">
361
                             <xsl:with-param name="codes">b</xsl:with-param>
361
                             <xsl:with-param name="codes">b</xsl:with-param>
362
                         </xsl:call-template>
362
                         </xsl:call-template>
Lines 733-744 Link Here
733
                        <xsl:with-param name="delimeter"> AND </xsl:with-param>
733
                        <xsl:with-param name="delimeter"> AND </xsl:with-param>
734
                        <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
734
                        <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
735
                        <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
735
                        <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
736
                        <xsl:with-param name="urlencode">1</xsl:with-param>
736
                    </xsl:call-template>
737
                    </xsl:call-template>
737
                </xsl:attribute>
738
                </xsl:attribute>
738
            </xsl:when>
739
            </xsl:when>
739
                <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
740
                <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
740
            <xsl:otherwise>
741
            <xsl:otherwise>
741
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="translate(marc:subfield[@code='a'],'()','')"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
742
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='a'],'()',''), true())"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
742
            </xsl:otherwise>
743
            </xsl:otherwise>
743
            </xsl:choose>
744
            </xsl:choose>
744
            <xsl:call-template name="chopPunctuation">
745
            <xsl:call-template name="chopPunctuation">
Lines 787-797 Link Here
787
                                        <xsl:with-param name="delimeter"> AND </xsl:with-param>
788
                                        <xsl:with-param name="delimeter"> AND </xsl:with-param>
788
                                        <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
789
                                        <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
789
                                        <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
790
                                        <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
791
                                        <xsl:with-param name="urlencode">1</xsl:with-param>
790
                                    </xsl:call-template>
792
                                    </xsl:call-template>
791
                                    </xsl:attribute>
793
                                    </xsl:attribute>
792
                                </xsl:when>
794
                                </xsl:when>
793
                                <xsl:otherwise>
795
                                <xsl:otherwise>
794
                                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
796
                                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
795
                                </xsl:otherwise>
797
                                </xsl:otherwise>
796
                            </xsl:choose>
798
                            </xsl:choose>
797
                        <xsl:call-template name="subfieldSelect">
799
                        <xsl:call-template name="subfieldSelect">
Lines 836-842 Link Here
836
                        <xsl:text>/cgi-bin/koha/opac-search.pl?q=control-number:</xsl:text>
838
                        <xsl:text>/cgi-bin/koha/opac-search.pl?q=control-number:</xsl:text>
837
                        <xsl:call-template name="extractControlNumber">
839
                        <xsl:call-template name="extractControlNumber">
838
                            <xsl:with-param name="subfieldW">
840
                            <xsl:with-param name="subfieldW">
839
                                <xsl:value-of select="marc:subfield[@code='w']"/>
841
                                <xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/>
840
                            </xsl:with-param>
842
                            </xsl:with-param>
841
                        </xsl:call-template>
843
                        </xsl:call-template>
842
                    </xsl:attribute>
844
                    </xsl:attribute>
Lines 1660-1665 Link Here
1660
        <xsl:param name="subdivDelimiter"/>
1662
        <xsl:param name="subdivDelimiter"/>
1661
        <xsl:param name="prefix"/>
1663
        <xsl:param name="prefix"/>
1662
        <xsl:param name="suffix"/>
1664
        <xsl:param name="suffix"/>
1665
        <xsl:param name="urlencode"/>
1663
        <xsl:variable name="str">
1666
        <xsl:variable name="str">
1664
            <xsl:for-each select="marc:subfield">
1667
            <xsl:for-each select="marc:subfield">
1665
                <xsl:if test="contains($codes, @code)">
1668
                <xsl:if test="contains($codes, @code)">
Lines 1670-1675 Link Here
1670
                </xsl:if>
1673
                </xsl:if>
1671
            </xsl:for-each>
1674
            </xsl:for-each>
1672
        </xsl:variable>
1675
        </xsl:variable>
1673
        <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
1676
        <xsl:choose>
1677
            <xsl:when test="$urlencode=1">
1678
                <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/>
1679
            </xsl:when>
1680
            <xsl:otherwise>
1681
                <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
1682
            </xsl:otherwise>
1683
        </xsl:choose>
1674
    </xsl:template>
1684
    </xsl:template>
1675
</xsl:stylesheet>
1685
</xsl:stylesheet>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl (-3 / +3 lines)
Lines 194-200 Link Here
194
                            </xsl:when>
194
                            </xsl:when>
195
                            <xsl:when test="boolean($index)">
195
                            <xsl:when test="boolean($index)">
196
                                <a>
196
                                <a>
197
                                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of  select="$index"/>:<xsl:value-of  select="marc:subfield[@code='a']"/></xsl:attribute>
197
                                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="str:encode-uri($index, true())"/>:<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/></xsl:attribute>
198
                                    <xsl:value-of select="$str"/>
198
                                    <xsl:value-of select="$str"/>
199
                                </a>
199
                                </a>
200
                            </xsl:when>
200
                            </xsl:when>
Lines 269-275 Link Here
269
            <xsl:choose>
269
            <xsl:choose>
270
                <xsl:when test="$url='1'">
270
                <xsl:when test="$url='1'">
271
                    <xsl:if test="$field/marc:subfield[@code='b']">
271
                    <xsl:if test="$field/marc:subfield[@code='b']">
272
                         <a href="/cgi-bin/koha/opac-search.pl?q=Provider:{$field/marc:subfield[@code='b']}">
272
                         <a>
273
                         <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri($field/marc:subfield[@code='b'], true())"/>"</xsl:attribute>
273
                         <xsl:call-template name="subfieldSelect">
274
                         <xsl:call-template name="subfieldSelect">
274
                             <xsl:with-param name="codes">b</xsl:with-param>
275
                             <xsl:with-param name="codes">b</xsl:with-param>
275
                         </xsl:call-template>
276
                         </xsl:call-template>
276
- 

Return to bug 14716