Bug 4506: Add volume > set link
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Sun, 26 Sep 2010 21:42:07 +0000 (23:42 +0200)
committerColin Campbell <colin.campbell@ptfs-europe.com>
Wed, 8 Dec 2010 12:45:10 +0000 (12:45 +0000)
A new label 'Set:' is added with a link to the set.
The link starts a search for control number from 773$w in index control number.
A syspref UseControlNumber will be added later, to provide a fallback to a search by 245$a, which is also the title of the set.

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 2007cb2..9218a12 100644 (file)
             </a>
         </span>
         </xsl:if>
+        
+        <!-- Set -->
+        <xsl:if test="$leader19='c'">
+        <span class="results_summary"><span class="label">Set: </span>
+            <a>
+            <xsl:choose>
+            <xsl:when test="$UseControlNumber = '1'">
+                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:value-of select="marc:datafield[@tag=773]/marc:subfield[@code='w']"/></xsl:attribute>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute>
+            </xsl:otherwise>
+            </xsl:choose>
+            <xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
+            </a>
+        </span>
+        </xsl:if>
 
         <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
         <xsl:if test="$display880">
index befa3e6..78a0a5c 100755 (executable)
             </a>
         </span>
         </xsl:if>
+        
+        <!-- Set -->
+        <xsl:if test="$leader19='c'">
+        <span class="results_summary"><span class="label">Set: </span>
+            <a>
+            <xsl:choose>
+            <xsl:when test="$UseControlNumber = '1'">
+                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:value-of select="marc:datafield[@tag=773]/marc:subfield[@code='w']"/></xsl:attribute>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Title:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute>
+            </xsl:otherwise>
+            </xsl:choose>
+            <xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
+            </a>
+        </span>
+        </xsl:if>
 
         <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
         <xsl:if test="$display880">