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

(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl (-2 / +22 lines)
Lines 215-221 Link Here
215
                        <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>
215
                        <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>
216
                    </xsl:when>
216
                    </xsl:when>
217
                    <xsl:otherwise>
217
                    <xsl:otherwise>
218
                        <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>
218
                        <xsl:variable name="title_query">
219
                            <xsl:call-template name="fix_query_term">
220
                                <xsl:with-param name="term"><xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='a']"/></xsl:with-param>
221
                            </xsl:call-template>
222
                        </xsl:variable>
223
                        <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Host-item:("<xsl:value-of select="$title_query"/>")</xsl:attribute>
219
                    </xsl:otherwise>
224
                    </xsl:otherwise>
220
                </xsl:choose>
225
                </xsl:choose>
221
                <xsl:text>Show analytics</xsl:text>
226
                <xsl:text>Show analytics</xsl:text>
Lines 1083-1090 Link Here
1083
                            </a>
1088
                            </a>
1084
                        </xsl:when>
1089
                        </xsl:when>
1085
                        <xsl:otherwise>
1090
                        <xsl:otherwise>
1091
                            <xsl:variable name="title_query">
1092
                                <xsl:call-template name="fix_query_term">
1093
                                    <xsl:with-param name="term"><xsl:value-of select="marc:subfield[@code='t']"/></xsl:with-param>
1094
                                </xsl:call-template>
1095
                            </xsl:variable>
1096
                            <xsl:variable name="author_query">
1097
                                <xsl:if test="marc:subfield[@code='a']">
1098
                                    <xsl:call-template name="fix_query_term">
1099
                                        <xsl:with-param name="term">
1100
                                            <xsl:value-of select="marc:subfield[@code='a']"/>
1101
                                        </xsl:with-param>
1102
                                    </xsl:call-template>
1103
                                </xsl:if>
1104
                            </xsl:variable>
1086
                            <a>
1105
                            <a>
1087
                                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='t'], '()', ''), true())"/><xsl:if test="marc:subfield[@code='a']">+AND+au:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='a'], '()', ''), true())"/></xsl:if></xsl:attribute>
1106
                            <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:("<xsl:value-of select="$title_query" />")<xsl:if test="$author_query">+AND+au:("<xsl:value-of select="$author_query"/>")</xsl:if>
1107
                            </xsl:attribute>
1088
                                <xsl:value-of select="$f773"/>
1108
                                <xsl:value-of select="$f773"/>
1089
                            </a>
1109
                            </a>
1090
                        </xsl:otherwise>
1110
                        </xsl:otherwise>
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl (+30 lines)
Lines 578-583 Link Here
578
        </xsl:if>
578
        </xsl:if>
579
    </xsl:template>
579
    </xsl:template>
580
580
581
    <xsl:template name="fix_query_term">
582
        <xsl:param name="term" />
583
        <xsl:variable name="fixed_term">
584
            <xsl:call-template name="escape_quotes">
585
                <xsl:with-param name="text">
586
                    <xsl:value-of select="$term"/>
587
                </xsl:with-param>
588
            </xsl:call-template>
589
        </xsl:variable>
590
        <xsl:value-of select="str:encode-uri(translate($fixed_term, '()', ''), true())"/>
591
    </xsl:template>
592
593
    <xsl:template name="escape_quotes">
594
        <xsl:param name="text"/>
595
        <xsl:choose>
596
            <xsl:when test="contains($text, '&quot;')">
597
                <xsl:variable name="before" select="substring-before($text,'&quot;')"/>
598
                <xsl:variable name="next" select="substring-after($text,'&quot;')"/>
599
                <xsl:value-of select="$before"/>
600
                <xsl:text>\&quot;</xsl:text>
601
                <xsl:call-template name="escape_quotes">
602
                    <xsl:with-param name="text" select="$next"/>
603
                </xsl:call-template>
604
            </xsl:when>
605
            <xsl:otherwise>
606
                <xsl:value-of select="$text"/>
607
            </xsl:otherwise>
608
        </xsl:choose>
609
    </xsl:template>
610
581
</xsl:stylesheet>
611
</xsl:stylesheet>
582
612
583
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
613
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl (-2 / +22 lines)
Lines 257-263 Link Here
257
                        <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>
257
                        <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>
258
                    </xsl:when>
258
                    </xsl:when>
259
                    <xsl:otherwise>
259
                    <xsl:otherwise>
260
                        <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>
260
                        <xsl:variable name="title_query">
261
                            <xsl:call-template name="fix_query_term">
262
                                <xsl:with-param name="term"><xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='a']"/></xsl:with-param>
263
                            </xsl:call-template>
264
                        </xsl:variable>
265
                        <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:("<xsl:value-of select="$title_query"/>")</xsl:attribute>
261
                    </xsl:otherwise>
266
                    </xsl:otherwise>
262
                </xsl:choose>
267
                </xsl:choose>
263
                <xsl:text>Show analytics</xsl:text>
268
                <xsl:text>Show analytics</xsl:text>
Lines 1230-1237 Link Here
1230
                            </a>
1235
                            </a>
1231
                        </xsl:when>
1236
                        </xsl:when>
1232
                        <xsl:otherwise>
1237
                        <xsl:otherwise>
1238
                            <xsl:variable name="title_query">
1239
                                <xsl:call-template name="fix_query_term">
1240
                                    <xsl:with-param name="term"><xsl:value-of select="marc:subfield[@code='t']"/></xsl:with-param>
1241
                                </xsl:call-template>
1242
                            </xsl:variable>
1243
                            <xsl:variable name="author_query">
1244
                                <xsl:if test="marc:subfield[@code='a']">
1245
                                    <xsl:call-template name="fix_query_term">
1246
                                        <xsl:with-param name="term">
1247
                                            <xsl:value-of select="marc:subfield[@code='a']"/>
1248
                                        </xsl:with-param>
1249
                                    </xsl:call-template>
1250
                                </xsl:if>
1251
                            </xsl:variable>
1233
                            <a>
1252
                            <a>
1234
                                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='t'], '()', ''), true())"/><xsl:if test="marc:subfield[@code='a']">+AND+au:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='a'], '()', ''), true())"/></xsl:if></xsl:attribute>
1253
                            <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:("<xsl:value-of select="$title_query" />")<xsl:if test="$author_query">+AND+au:("<xsl:value-of select="$author_query"/>")</xsl:if>
1254
                            </xsl:attribute>
1235
                                <xsl:value-of select="$f773"/>
1255
                                <xsl:value-of select="$f773"/>
1236
                            </a>
1256
                            </a>
1237
                        </xsl:otherwise>
1257
                        </xsl:otherwise>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl (-1 / +30 lines)
Lines 542-547 Link Here
542
        </xsl:if>
542
        </xsl:if>
543
    </xsl:template>
543
    </xsl:template>
544
544
545
    <xsl:template name="fix_query_term">
546
        <xsl:param name="term" />
547
        <xsl:variable name="fixed_term">
548
            <xsl:call-template name="escape_quotes">
549
                <xsl:with-param name="text">
550
                    <xsl:value-of select="$term"/>
551
                </xsl:with-param>
552
            </xsl:call-template>
553
        </xsl:variable>
554
        <xsl:value-of select="str:encode-uri(translate($fixed_term, '()', ''), true())"/>
555
    </xsl:template>
556
557
    <xsl:template name="escape_quotes">
558
        <xsl:param name="text"/>
559
        <xsl:choose>
560
            <xsl:when test="contains($text, '&quot;')">
561
                <xsl:variable name="before" select="substring-before($text,'&quot;')"/>
562
                <xsl:variable name="next" select="substring-after($text,'&quot;')"/>
563
                <xsl:value-of select="$before"/>
564
                <xsl:text>\&quot;</xsl:text>
565
                <xsl:call-template name="escape_quotes">
566
                    <xsl:with-param name="text" select="$next"/>
567
                </xsl:call-template>
568
            </xsl:when>
569
            <xsl:otherwise>
570
                <xsl:value-of select="$text"/>
571
            </xsl:otherwise>
572
        </xsl:choose>
573
    </xsl:template>
574
545
</xsl:stylesheet>
575
</xsl:stylesheet>
546
576
547
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
577
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
548
- 

Return to bug 31106