Bug 12901: (consistency followup) add buildBiblioDefaultViewURL to MARC21 XSLT
authorTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 15 Sep 2014 13:44:16 +0000 (10:44 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 30 Oct 2014 03:26:25 +0000 (00:26 -0300)
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

http://bugs.koha-community.org/show_bug.cgi?id=9828

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl

index e5405b8..4fd9cd6 100644 (file)
            </xsl:call-template>
         </xsl:if>
 
-        <a><xsl:attribute name="href">
-            <xsl:choose>
-                <xsl:when test="$BiblioDefaultView='normal'">
-                    /cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/>
-                </xsl:when>
-                <xsl:when test="$BiblioDefaultView='isbd'">
-                    /cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<xsl:value-of select="$biblionumber"/>
-                </xsl:when>
-                <xsl:when test="$BiblioDefaultView='marc'">
-                    /cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<xsl:value-of select="$biblionumber"/>
-                </xsl:when>
-                <xsl:otherwise>
-                    /cgi-bin/koha/opac-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="BiblioDefaultView">
+                    <xsl:value-of select="$BiblioDefaultView"/>
+                </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 4780b7b..273b42d 100644 (file)
                </xsl:if>
        </xsl:template>
 
+    <xsl:template name="buildBiblioDefaultViewURL">
+      <xsl:param name="BiblioDefaultView"/>
+      <xsl:choose>
+          <xsl:when test="$BiblioDefaultView='normal'">
+              <xsl:text>/cgi-bin/koha/catalogue/detail.pl?biblionumber=</xsl:text>
+          </xsl:when>
+          <xsl:when test="$BiblioDefaultView='isbd'">
+              <xsl:text>/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=</xsl:text>
+          </xsl:when>
+          <xsl:when test="$BiblioDefaultView='labeled_marc'">
+              <xsl:text>/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=</xsl:text>
+          </xsl:when>
+          <xsl:when test="$BiblioDefaultView='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)"/>