Bug 12900: (consistency followup) add buildBiblioDefaultViewURL to MARC21 XSLT
authorTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 15 Sep 2014 13:02:10 +0000 (10:02 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 27 Oct 2014 13:52:48 +0000 (10:52 -0300)
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Works as described, tested in UNIMARC and MARC21.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl

index b62c41b..ee70d86 100644 (file)
            </xsl:call-template>
         </xsl:if>
 
-        <a><xsl:attribute name="href">
-            <xsl:choose>
-                <xsl:when test="$IntranetBiblioDefaultView='normal'">
-                    /cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/>
-                </xsl:when>
-                <xsl:when test="$IntranetBiblioDefaultView='isbd'">
-                    /cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=<xsl:value-of select="$biblionumber"/>
-                </xsl:when>
-                <xsl:when test="$IntranetBiblioDefaultView='labeled_marc'">
-                    /cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=<xsl:value-of select="$biblionumber"/>
-                </xsl:when>
-                <xsl:when test="$IntranetBiblioDefaultView='marc'">
-                    /cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<xsl:value-of select="$biblionumber"/>
-                </xsl:when>
-                <xsl:otherwise>
-                    /cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/>
-                </xsl:otherwise>
-            </xsl:choose>
-        </xsl:attribute><xsl:attribute name="class">title</xsl:attribute>
+    <a>
+        <xsl:attribute name="href">
+            <xsl:call-template name="buildBiblioDefaultViewURL">
+                <xsl:with-param name="IntranetBiblioDefaultView">
+                    <xsl:value-of select="$IntranetBiblioDefaultView"/>
+                </xsl:with-param>
+            </xsl:call-template>
+            <xsl:value-of select="$biblionumber"/>
+        </xsl:attribute>
+        <xsl:attribute name="class">title</xsl:attribute>
 
         <xsl:if test="marc:datafield[@tag=245]">
         <xsl:for-each select="marc:datafield[@tag=245]">
index c1b52f3..4e799de 100644 (file)
                </xsl:if>
        </xsl:template>
 
+    <xsl:template name="buildBiblioDefaultViewURL">
+        <xsl:param name="IntranetBiblioDefaultView"/>
+        <xsl:choose>
+            <xsl:when test="$IntranetBiblioDefaultView='normal'">
+                <xsl:text>/cgi-bin/koha/catalogue/detail.pl?biblionumber=</xsl:text>
+            </xsl:when>
+            <xsl:when test="$IntranetBiblioDefaultView='isbd'">
+                <xsl:text>/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=</xsl:text>
+            </xsl:when>
+            <xsl:when test="$IntranetBiblioDefaultView='labeled_marc'">
+                <xsl:text>/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=</xsl:text>
+            </xsl:when>
+            <xsl:when test="$IntranetBiblioDefaultView='marc'">
+                <xsl:text>/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:text>/cgi-bin/koha/catalogue/detail.pl?biblionumber=</xsl:text>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+
        <xsl:template name="chopPunctuation">
                <xsl:param name="chopString"/>
                <xsl:variable name="length" select="string-length($chopString)"/>