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 565-583 Link Here
565
        </xsl:choose>
565
        </xsl:choose>
566
        </span>
566
        </span>
567
                <xsl:variable name="f773">
567
                <xsl:variable name="f773">
568
                    <xsl:call-template name="subfieldSelect">
568
                    <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
569
                        <xsl:with-param name="codes">at</xsl:with-param>
569
                        <xsl:with-param name="codes">at</xsl:with-param>
570
                    </xsl:call-template>
570
                    </xsl:call-template></xsl:with-param></xsl:call-template>
571
                </xsl:variable>
571
                </xsl:variable>
572
            <xsl:choose>
572
            <xsl:choose>
573
                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
573
                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
574
                    <a href="/cgi-bin/koha/catalogue/search.pl?q=Control-number:{marc:subfield[@code='w']}">
574
                    <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>
575
                        <xsl:value-of select="translate($f773, '()', '')"/>
575
                        <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>
576
                    </a>
576
                    </a>
577
                </xsl:when>
577
                </xsl:when>
578
                <xsl:otherwise>
578
                <xsl:otherwise>
579
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
579
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
580
                        <xsl:value-of select="$f773"/>
580
                        <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>
581
                    </a>
581
                    </a>
582
                </xsl:otherwise>
582
                </xsl:otherwise>
583
            </xsl:choose>
583
            </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 605-623 Link Here
605
        </xsl:choose>
605
        </xsl:choose>
606
        </span>
606
        </span>
607
                <xsl:variable name="f773">
607
                <xsl:variable name="f773">
608
                    <xsl:call-template name="subfieldSelect">
608
                    <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
609
                        <xsl:with-param name="codes">at</xsl:with-param>
609
                        <xsl:with-param name="codes">at</xsl:with-param>
610
                    </xsl:call-template>
610
                    </xsl:call-template></xsl:with-param></xsl:call-template>
611
                </xsl:variable>
611
                </xsl:variable>
612
            <xsl:choose>
612
            <xsl:choose>
613
                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
613
                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
614
                    <a href="/cgi-bin/koha/opac-search.pl?q=Control-number:{marc:subfield[@code='w']}">
614
                    <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>
615
                        <xsl:value-of select="translate($f773, '()', '')"/>
615
                        <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>
616
                    </a>
616
                    </a>
617
                </xsl:when>
617
                </xsl:when>
618
                <xsl:otherwise>
618
                <xsl:otherwise>
619
                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
619
                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
620
                        <xsl:value-of select="$f773"/>
620
                        <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>
621
                    </a>
621
                    </a>
622
                </xsl:otherwise>
622
                </xsl:otherwise>
623
            </xsl:choose>
623
            </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