Bug 12901: (consistency followup) add buildBiblioDefaultViewURL to MARC21 XSLT
[srvgit] / koha-tmpl / opac-tmpl / bootstrap / en / xslt / MARC21slim2OPACResults.xsl
index ea6af38..4fd9cd6 100644 (file)
@@ -30,6 +30,7 @@
     <xsl:variable name="OPACItemLocation" select="marc:sysprefs/marc:syspref[@name='OPACItemLocation']"/>
     <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
     <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/>
+    <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/>
         <xsl:variable name="leader" select="marc:leader"/>
         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
            </xsl:call-template>
         </xsl:if>
 
-        <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/></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]">
       </xsl:call-template>
     </xsl:if>
 
-    <xsl:if test="marc:datafield[@tag=260]">
+    <!-- Publisher info and RDA related info from tags 260, 264 -->
+    <xsl:choose>
+        <xsl:when test="marc:datafield[@tag=260]">
         <span class="results_summary publisher"><span class="label">Publisher: </span>
             <xsl:for-each select="marc:datafield[@tag=260]">
                 <xsl:if test="marc:subfield[@code='a']">
                 </xsl:call-template>
                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
             </xsl:for-each>
+            <xsl:if test="marc:datafield[@tag=264]">
+                <xsl:text>; </xsl:text>
+                <xsl:call-template name="showRDAtag264"/>
+            </xsl:if>
+        </span>
+        </xsl:when>
+        <xsl:when test="marc:datafield[@tag=264]">
+            <span class="results_summary">
+                <xsl:call-template name="showRDAtag264"/>
+            </span>
+        </xsl:when>
+    </xsl:choose>
+
+    <!-- Dissertation note -->
+    <xsl:if test="marc:datafield[@tag=502]">
+        <span class="results_summary diss_note">
+            <span class="label">Dissertation note: </span>
+            <xsl:for-each select="marc:datafield[@tag=502]">
+                <xsl:call-template name="subfieldSelect">
+                    <xsl:with-param name="codes">abcdgo</xsl:with-param>
+                </xsl:call-template>
+            </xsl:for-each>
+            <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
         </span>
     </xsl:if>
 
                </span>
     <xsl:choose>
         <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)">
-            <span class="results_summary" id="location">
+            <span class="results_summary location">
                 <span class="label">Location(s): </span>
                 <xsl:choose>
                 <xsl:when test="count(key('item-by-status', 'available'))>0">
     </xsl:template>
 
     <xsl:template name="nameABCDN">
-        <xsl:for-each select="marc:subfield[@code='a']">
-                <xsl:call-template name="chopPunctuation">
-                    <xsl:with-param name="chopString" select="."/>
-                </xsl:call-template>
-        </xsl:for-each>
-        <xsl:for-each select="marc:subfield[@code='b']">
-                <xsl:value-of select="."/>
-        </xsl:for-each>
-        <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
-                <xsl:call-template name="subfieldSelect">
-                    <xsl:with-param name="codes">cdn</xsl:with-param>
-                </xsl:call-template>
-        </xsl:if>
+            <xsl:call-template name="chopPunctuation">
+                <xsl:with-param name="chopString">
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">abcdn</xsl:with-param>
+                    </xsl:call-template>
+                </xsl:with-param>
+                <xsl:with-param name="punctuation">
+                    <xsl:text>:,;/ </xsl:text>
+                </xsl:with-param>
+            </xsl:call-template>
     </xsl:template>
 
     <xsl:template name="nameACDEQ">