Bug 4276: Proposed fix for "Related Subjects" links in Opac.
authorGarry Collum <gcollum@gmail.com>
Sat, 20 Mar 2010 01:25:35 +0000 (21:25 -0400)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Fri, 14 May 2010 21:10:10 +0000 (23:10 +0200)
Adds fields other than 'a' to the links for subject headings in the Opac details page.

Also adds subfield b of a Corporate Author (710) to the appropriate link.  Otherwise you may have a link with "United States" instead of "United States. Public Works Adminstration"

Another patch needs to be sent for the Intranet.

koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl

index b237c64..ffd1836 100644 (file)
                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-            <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>      
+            <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=au&amp;q=<xsl:call-template name="chopPunctuation">
+                   <xsl:with-param name="chopString">
+                       <xsl:call-template name="subfieldSelect">
+                           <xsl:with-param name="codes">ab</xsl:with-param>
+                       </xsl:call-template>
+                    </xsl:with-param>
+               </xsl:call-template>
+           </xsl:attribute>      
             </xsl:otherwise>
         </xsl:choose>
         <xsl:call-template name="nameABCDN"/></a>
                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
+                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idc=su&amp;q=<xsl:call-template name="chopPunctuation">
+                       <xsl:with-param name="chopString">
+                           <xsl:call-template name="subfieldSelect">
+                               <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
+                           </xsl:call-template>
+                       </xsl:with-param>
+                    </xsl:call-template>
+                </xsl:attribute>
             </xsl:otherwise>
             </xsl:choose>
             <xsl:call-template name="chopPunctuation">