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

(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl (-5 / +5 lines)
Lines 521-539 Link Here
521
        </xsl:choose>
521
        </xsl:choose>
522
        </span>
522
        </span>
523
                <xsl:variable name="f773">
523
                <xsl:variable name="f773">
524
                    <xsl:call-template name="subfieldSelect">
524
                    <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
525
                        <xsl:with-param name="codes">at</xsl:with-param>
525
                        <xsl:with-param name="codes">at</xsl:with-param>
526
                    </xsl:call-template>
526
                    </xsl:call-template></xsl:with-param></xsl:call-template>
527
                </xsl:variable>
527
                </xsl:variable>
528
            <xsl:choose>
528
            <xsl:choose>
529
                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
529
                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
530
                    <a href="/cgi-bin/koha/catalogue/search.pl?q=Control-number:{marc:subfield[@code='w']}">
530
                    <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>
531
                        <xsl:value-of select="translate($f773, '()', '')"/>
531
                        <xsl:value-of select="translate($f773, '()', '')"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
532
                    </a>
532
                    </a>
533
                </xsl:when>
533
                </xsl:when>
534
                <xsl:otherwise>
534
                <xsl:otherwise>
535
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
535
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
536
                        <xsl:value-of select="$f773"/>
536
                        <xsl:value-of select="$f773"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
537
                    </a>
537
                    </a>
538
                </xsl:otherwise>
538
                </xsl:otherwise>
539
            </xsl:choose>
539
            </xsl:choose>
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl (+18 lines)
Lines 65-70 Link Here
65
<xsl:text> </xsl:text>
65
<xsl:text> </xsl:text>
66
	</xsl:template>
66
	</xsl:template>
67
67
68
	<!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w.
69
	     Parameter: control number string.
70
	     Assumes LOC convention: (OrgCode)recordNumber.
71
	     If OrgCode is not present, return full string.
72
	     Additionally, handle various brackets/parentheses. Chop leading and trailing spaces.
73
	-->
74
	<xsl:template name="extractControlNumber">
75
	    <xsl:param name="subfieldW"/>
76
	    <xsl:variable name="tranW" select="translate($subfieldW,']})&gt;','))))')"/>
77
	    <xsl:choose>
78
	      <xsl:when test="contains($tranW,')')">
79
	        <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()&lt;&gt;',''))"/>
80
	      </xsl:when>
81
	      <xsl:otherwise>
82
	        <xsl:value-of select="normalize-space($subfieldW)"/>
83
	      </xsl:otherwise>
84
	    </xsl:choose>
85
	</xsl:template>
68
86
69
    <!-- Function m880Select:  Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags
87
    <!-- Function m880Select:  Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags
70
        - should be called immediately before the corresonding latin tags are processed 
88
        - should be called immediately before the corresonding latin tags are processed 
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl (-5 / +5 lines)
Lines 601-619 Link Here
601
        </xsl:choose>
601
        </xsl:choose>
602
        </span>
602
        </span>
603
                <xsl:variable name="f773">
603
                <xsl:variable name="f773">
604
                    <xsl:call-template name="subfieldSelect">
604
                    <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
605
                        <xsl:with-param name="codes">at</xsl:with-param>
605
                        <xsl:with-param name="codes">at</xsl:with-param>
606
                    </xsl:call-template>
606
                    </xsl:call-template></xsl:with-param></xsl:call-template>
607
                </xsl:variable>
607
                </xsl:variable>
608
            <xsl:choose>
608
            <xsl:choose>
609
                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
609
                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
610
                    <a href="/cgi-bin/koha/opac-search.pl?q=Control-number:{marc:subfield[@code='w']}">
610
                    <a><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>
611
                        <xsl:value-of select="translate($f773, '()', '')"/>
611
                        <xsl:value-of select="translate($f773, '()', '')"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
612
                    </a>
612
                    </a>
613
                </xsl:when>
613
                </xsl:when>
614
                <xsl:otherwise>
614
                <xsl:otherwise>
615
                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
615
                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
616
                        <xsl:value-of select="$f773"/>
616
                        <xsl:value-of select="$f773"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
617
                    </a>
617
                    </a>
618
                </xsl:otherwise>
618
                </xsl:otherwise>
619
            </xsl:choose>
619
            </xsl:choose>
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl (-1 / +18 lines)
Lines 65-70 Link Here
65
<xsl:text> </xsl:text>
65
<xsl:text> </xsl:text>
66
	</xsl:template>
66
	</xsl:template>
67
67
68
	<!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w.
69
	     Parameter: control number string.
70
	     Assumes LOC convention: (OrgCode)recordNumber.
71
	     If OrgCode is not present, return full string.
72
	     Additionally, handle various brackets/parentheses. Chop leading and trailing spaces.
73
	-->
74
	<xsl:template name="extractControlNumber">
75
	    <xsl:param name="subfieldW"/>
76
	    <xsl:variable name="tranW" select="translate($subfieldW,']})&gt;','))))')"/>
77
	    <xsl:choose>
78
	      <xsl:when test="contains($tranW,')')">
79
	        <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()&lt;&gt;',''))"/>
80
	      </xsl:when>
81
	      <xsl:otherwise>
82
	        <xsl:value-of select="normalize-space($subfieldW)"/>
83
	      </xsl:otherwise>
84
	    </xsl:choose>
85
	</xsl:template>
68
86
69
    <!-- Function m880Select:  Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags
87
    <!-- Function m880Select:  Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags
70
        - should be called immediately before the corresonding latin tags are processed 
88
        - should be called immediately before the corresonding latin tags are processed 
71
- 

Return to bug 5622