Adds availability info from circulations
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 5 May 2010 13:01:51 +0000 (15:01 +0200)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 5 May 2010 13:01:51 +0000 (15:01 +0200)
etc/opac.xsl

index 6fe5ecd..aa1eabe 100644 (file)
     <xsl:for-each select="/opacRecord/holdings/holding">
       <pz:metadata type="locallocation">
         <xsl:choose>
-         <xsl:when test="localLocation">
-           <xsl:value-of select="localLocation"/>
-         </xsl:when>
-         <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
-       </xsl:choose>
+          <xsl:when test="localLocation">
+            <xsl:value-of select="localLocation"/>
+          </xsl:when>
+          <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+        </xsl:choose>
       </pz:metadata>
       <pz:metadata type="callnumber">
         <xsl:choose>
-         <xsl:when test="callNumber">
-           <xsl:value-of select="callNumber"/>
-         </xsl:when>
-         <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
-       </xsl:choose>
+          <xsl:when test="callNumber">
+            <xsl:value-of select="callNumber"/>
+          </xsl:when>
+          <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+        </xsl:choose>
       </pz:metadata>
-      <pz:metadata type="available">
+      <pz:metadata type="publicnote">
         <xsl:choose>
-          <xsl:when test="string-length(available)">
-            <xsl:value-of select="available"/>
+          <xsl:when test="publicNote">
+            <xsl:value-of select="publicNote"/>
           </xsl:when>
           <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
         </xsl:choose>
       </pz:metadata>
-      <pz:metadata type="publicnote">
+      <pz:metadata type="available">
         <xsl:choose>
-         <xsl:when test="publicNote">
-           <xsl:value-of select="publicNote"/>
-         </xsl:when>
-         <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
-       </xsl:choose>
+          <xsl:when test="circulations/circulation/availableNow/@value = '1'">
+             Available
+          </xsl:when>
+          <xsl:when test="circulations/circulation/availableNow/@value = '0'">
+             <xsl:choose>
+               <xsl:when test="circulations/circulation/availabiltyDate">
+                 <xsl:value-of select="circulations/circulation/availabiltyDate"/>
+               </xsl:when>
+               <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+             </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+        </xsl:choose>
       </pz:metadata>
     </xsl:for-each>
   </xsl:template>