patch for Bug 8226 - 'OpacFooter' markup/css improvements
[koha.git] / koha-tmpl / opac-tmpl / prog / en / xslt / UNIMARCslim2OPACResults.xsl
index 1290e94..e7ff9da 100644 (file)
@@ -4,7 +4,7 @@
 
 <xsl:stylesheet version="1.0"
   xmlns:marc="http://www.loc.gov/MARC21/slim"
-  xmlns:items="http://www.koha.org/items"
+  xmlns:items="http://www.koha-community.org/items"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
 
   <xsl:variable name="isbn"
    select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/>
 
+  <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
+
   <xsl:if test="marc:datafield[@tag=200]">
     <xsl:for-each select="marc:datafield[@tag=200]">
-      <xsl:variable name="title" select="marc:subfield[@code='a']"/>
-      <xsl:variable name="ntitle"
-       select="translate($title, '&#x0098;&#x009C;','')"/>
-      <div>
         <xsl:call-template name="addClassRtl" />
-        <span class="results_summary">
-          <span class="label"/>
-          <a>
-            <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
-            <xsl:value-of select="$ntitle" />
-          </a>
-          <xsl:if test="marc:subfield[@code='e']">
-            <xsl:text> : </xsl:text>
-            <xsl:for-each select="marc:subfield[@code='e']">
+        <xsl:for-each select="marc:subfield">
+          <xsl:choose>
+            <xsl:when test="@code='a'">
+              <xsl:variable name="title" select="."/>
+              <xsl:variable name="ntitle"
+                select="translate($title, '&#x0088;&#x0089;&#x0098;&#x009C;','')"/>
+              <a>
+                <xsl:attribute name="href">
+                  <xsl:text>/cgi-bin/koha/opac-detail.pl?biblionumber=</xsl:text>
+                  <xsl:value-of select="$biblionumber"/>
+                </xsl:attribute>
+                <xsl:value-of select="$ntitle" />
+              </a>
+            </xsl:when>
+            <xsl:when test="@code='b'">
+              <xsl:text> [</xsl:text>
               <xsl:value-of select="."/>
-            </xsl:for-each>
-          </xsl:if>
-          <xsl:if test="marc:subfield[@code='b']">
-            <xsl:text> [</xsl:text>
-            <xsl:value-of select="marc:subfield[@code='b']"/>
-            <xsl:text>]</xsl:text>
-          </xsl:if>
-          <xsl:if test="marc:subfield[@code='f']">
-            <xsl:text> / </xsl:text>
-            <xsl:value-of select="marc:subfield[@code='f']"/>
-          </xsl:if>
-          <xsl:if test="marc:subfield[@code='g']">
-            <xsl:text> ; </xsl:text>
-            <xsl:value-of select="marc:subfield[@code='g']"/>
-          </xsl:if>
-        </span>
-      </div>
+              <xsl:text>]</xsl:text>
+            </xsl:when>
+            <xsl:when test="@code='d'">
+              <xsl:text> = </xsl:text>
+              <xsl:value-of select="."/>
+            </xsl:when>
+            <xsl:when test="@code='e'">
+              <xsl:text> : </xsl:text>
+              <xsl:value-of select="."/>
+            </xsl:when>
+            <xsl:when test="@code='f'">
+              <xsl:text> / </xsl:text>
+              <xsl:value-of select="."/>
+            </xsl:when>
+            <xsl:when test="@code='g'">
+              <xsl:text> ; </xsl:text>
+              <xsl:value-of select="."/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:text>, </xsl:text>
+              <xsl:value-of select="."/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:for-each>
     </xsl:for-each>
   </xsl:if>
 
-  <xsl:call-template name="tag_4xx" />
+  <xsl:call-template name="tag_title">
+    <xsl:with-param name="tag">454</xsl:with-param>
+    <xsl:with-param name="label">Translation of</xsl:with-param>
+  </xsl:call-template>
+
+  <xsl:call-template name="tag_title">
+    <xsl:with-param name="tag">461</xsl:with-param>
+    <xsl:with-param name="label">Set Level</xsl:with-param>
+  </xsl:call-template>
+
+  <xsl:call-template name="tag_title">
+    <xsl:with-param name="tag">464</xsl:with-param>
+    <xsl:with-param name="label">Piece-Analytic Level</xsl:with-param>
+  </xsl:call-template>
 
   <xsl:call-template name="tag_210" />
 
   <xsl:call-template name="tag_215" />
 
   <span class="results_summary">
-    <span class="label">DisponibilitĂ©: </span>
+    <span class="label">Availability: </span>
     <xsl:choose>
       <xsl:when test="marc:datafield[@tag=856]">
         <xsl:for-each select="marc:datafield[@tag=856]">
         </xsl:for-each>
       </xsl:when>
       <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">
-        Pas de copie disponible
+        No copies available
       </xsl:when>
       <xsl:when test="count(key('item-by-status', 'available'))>0">
         <span class="available">
-          <b><xsl:text>pour le prĂȘt: </xsl:text></b>
+          <b><xsl:text>Copies available for loan: </xsl:text></b>
           <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
           <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
             <xsl:value-of select="items:homebranch"/>
         <xsl:text>). </xsl:text>
       </span>
     </xsl:if>
-    <xsl:if test="count(key('item-by-status', 'Lost'))>0">
+    <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0">
       <span class="unavailable">
         <xsl:text>Lost (</xsl:text>
         <xsl:value-of select="count(key('item-by-status', 'Lost'))"/>