Bug 8513: OPAC detail page broken with XSLT

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Fridolyn SOMERS 2012-07-30 14:36:33 +02:00 committed by Paul Poulain
parent ee51b56625
commit 2359a7ed61
3 changed files with 63 additions and 47 deletions

View file

@ -140,29 +140,31 @@
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:choose>
<xsl:when test="boolean($bibno)">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$bibno"/></xsl:attribute>
<xsl:if test="string-length($str) &gt; 0">
<xsl:choose>
<xsl:when test="boolean($bibno)">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$bibno"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:when test="boolean($index)">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="$index"/>:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:when test="boolean($index)">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="$index"/>:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$str"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</span>
</xsl:if>
</xsl:for-each>

View file

@ -170,29 +170,31 @@
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:choose>
<xsl:when test="boolean($bibno)">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$bibno"/></xsl:attribute>
<xsl:if test="string-length($str) &gt; 0">
<xsl:choose>
<xsl:when test="boolean($bibno)">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$bibno"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:when test="boolean($index)">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="$index"/>:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:when test="boolean($index)">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="$index"/>:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
<xsl:value-of select="$str"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$str"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</span>
</xsl:if>
</xsl:for-each>

View file

@ -244,7 +244,18 @@
<xsl:text>/cgi-bin/koha/opac-search.pl?q=an:</xsl:text>
<xsl:value-of select="."/>
</xsl:attribute>
<xsl:value-of select="$display"/>
<xsl:choose>
<xsl:when test="string-length($display) &gt; 0">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="$display"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</a>
<xsl:variable name="ncommas"
select="string-length($ends) - string-length(translate($ends, ',', ''))" />
@ -254,7 +265,7 @@
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:when test="marc:subfield[@code=a]">
<a>
<xsl:attribute name="href">
<xsl:text>/cgi-bin/koha/opac-search.pl?q=su:</xsl:text>
@ -270,7 +281,8 @@
</xsl:with-param>
</xsl:call-template>
</a>
</xsl:otherwise>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:if test="not(position()=last())">
<xsl:text> | </xsl:text>