Bug 4506: Add rcn links to 780 and 785
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Mon, 27 Sep 2010 04:34:18 +0000 (06:34 +0200)
committerColin Campbell <colin.campbell@ptfs-europe.com>
Wed, 8 Dec 2010 12:45:10 +0000 (12:45 +0000)
Add links using control number in $w to preceeding and succeeding entry.

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl

index 77ed0a7..2647334 100644 (file)
                         <xsl:with-param name="codes">at</xsl:with-param>
                     </xsl:call-template>
                 </xsl:variable>
-             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
-                <xsl:value-of select="translate($f780, '()', '')"/>
-            </a>
+            <xsl:choose>
+                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
+                    <a href="/cgi-bin/koha/catalogue/search.pl?q=Control-number:{marc:subfield[@code='w']}">
+                        <xsl:value-of select="translate($f780, '()', '')"/>
+                    </a>
+                </xsl:when>
+                <xsl:otherwise>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
+                        <xsl:value-of select="translate($f780, '()', '')"/>
+                    </a>
+                </xsl:otherwise>
+            </xsl:choose>
         </span>
  
         <xsl:choose>
                     </xsl:call-template>
                 </xsl:variable>
 
-                <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
-                <xsl:value-of select="translate($f785, '()', '')"/>
-            </a>
+            <xsl:choose>
+                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
+                    <a href="/cgi-bin/koha/catalogue/search.pl?q=Control-number:{marc:subfield[@code='w']}">
+                        <xsl:value-of select="translate($f785, '()', '')"/>
+                    </a>
+                </xsl:when>
+                <xsl:otherwise>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
+                        <xsl:value-of select="translate($f785, '()', '')"/>
+                    </a>
+                </xsl:otherwise>
+            </xsl:choose>
 
         </span>
         </xsl:for-each>
index 6779877..d369be6 100755 (executable)
                         <xsl:with-param name="codes">at</xsl:with-param>
                     </xsl:call-template>
                 </xsl:variable>
-             <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
-                <xsl:value-of select="translate($f780, '()', '')"/>
-            </a>
+            <xsl:choose>
+                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
+                    <a href="/cgi-bin/koha/opac-search.pl?q=Control-number:{marc:subfield[@code='w']}">
+                        <xsl:value-of select="translate($f780, '()', '')"/>
+                    </a>
+                </xsl:when>
+                <xsl:otherwise>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
+                        <xsl:value-of select="translate($f780, '()', '')"/>
+                    </a>
+                </xsl:otherwise>
+            </xsl:choose>
         </span>
 
         <xsl:if test="marc:subfield[@code='n']">
                     </xsl:call-template>
                 </xsl:variable>
 
-                <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
-                <xsl:value-of select="translate($f785, '()', '')"/>
-            </a>
+            <xsl:choose>
+                <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
+                    <a href="/cgi-bin/koha/opac-search.pl?q=Control-number:{marc:subfield[@code='w']}">
+                        <xsl:value-of select="translate($f785, '()', '')"/>
+                    </a>
+                </xsl:when>
+                <xsl:otherwise>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
+                        <xsl:value-of select="translate($f785, '()', '')"/>
+                    </a>
+                </xsl:otherwise>
+            </xsl:choose>
 
         </span>