Merge remote-tracking branch 'origin/new/bug_5604'
[koha.git] / koha-tmpl / opac-tmpl / prog / en / xslt / UNIMARCslim2OPACDetail.xsl
index ed8a4e0..61054ea 100644 (file)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
+
 <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:template>
 
 <xsl:template match="marc:record">
+  <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/>
   <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:variable name="biblionumber" select="marc:datafield[@tag=090]/marc:subfield[@code='a']"/>
-  
+
 
   <xsl:if test="marc:datafield[@tag=200]">
     <xsl:for-each select="marc:datafield[@tag=200]">
     </xsl:for-each>
   </xsl:if>
 
-  <div id="views">
-    <span class="view">
-      <span id="Normalview">Normal View</span>
-    </span>
-    <span class="view">
-      <a id="MARCviewPop" href="/cgi-bin/koha/opac-showmarc.pl?id={marc:datafield[@tag=090]/marc:subfield[@code='a']}" title="MARC" rel="gb_page_center[600,500]">MARC View</a>
-    </span>
-    <span class="view">
-      <a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber={marc:datafield[@tag=090]/marc:subfield[@code='a']}" title="MARC">Expanded MARC View</a>
-    </span>
-    <span class="view">
-      <a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=090]/marc:subfield[@code='a']}">Card View (ISBD)</a>
-    </span>
-  </div>
-  
   <xsl:call-template name="tag_4xx" />
 
   <xsl:call-template name="tag_7xx">
     <xsl:with-param name="tag">700</xsl:with-param>
-    <xsl:with-param name="label">Auteur principal</xsl:with-param>
+    <xsl:with-param name="label">Main Author</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_7xx">
     <xsl:with-param name="tag">710</xsl:with-param>
-    <xsl:with-param name="label">Collectivité principale</xsl:with-param>
+    <xsl:with-param name="label">Corporate Author (Main)</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_7xx">
     <xsl:with-param name="tag">701</xsl:with-param>
-    <xsl:with-param name="label">Co-auteur</xsl:with-param>
+    <xsl:with-param name="label">Coauthor</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_7xx">
     <xsl:with-param name="tag">702</xsl:with-param>
-    <xsl:with-param name="label">Auteur</xsl:with-param>
+    <xsl:with-param name="label">Secondary Author</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_7xx">
     <xsl:with-param name="tag">711</xsl:with-param>
-    <xsl:with-param name="label">Collectivité co-auteur</xsl:with-param>
+    <xsl:with-param name="label">Corporate Author (Coauthor)</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_7xx">
     <xsl:with-param name="tag">712</xsl:with-param>
-    <xsl:with-param name="label">Collectivité secondaire</xsl:with-param>
+    <xsl:with-param name="label">Corporate Author (Secondary)</xsl:with-param>
   </xsl:call-template>
 
   <xsl:if test="marc:datafield[@tag=101]">
          <span class="results_summary">
-      <span class="label">Langue: </span>
+      <span class="label">Language: </span>
       <xsl:for-each select="marc:datafield[@tag=101]">
         <xsl:for-each select="marc:subfield">
           <xsl:choose>
-            <xsl:when test="@code='b'">de la trad. intermédiaire, </xsl:when>
-            <xsl:when test="@code='c'">de l'œuvre originale, </xsl:when>
-            <xsl:when test="@code='d'">du résumé, </xsl:when>
-            <xsl:when test="@code='e'">de la table des matières, </xsl:when>
-            <xsl:when test="@code='f'">de la page de titre, </xsl:when>
-            <xsl:when test="@code='g'">du titre propre, </xsl:when>
-            <xsl:when test="@code='h'">d'un livret, </xsl:when>
-            <xsl:when test="@code='i'">des textes d'accompagnement, </xsl:when>
-            <xsl:when test="@code='j'">des sous-titres, </xsl:when>
+            <xsl:when test="@code='b'">of intermediate text, </xsl:when>
+            <xsl:when test="@code='c'">of original work, </xsl:when>
+            <xsl:when test="@code='d'">of summary, </xsl:when>
+            <xsl:when test="@code='e'">of contents page, </xsl:when>
+            <xsl:when test="@code='f'">of title page, </xsl:when>
+            <xsl:when test="@code='g'">of title proper, </xsl:when>
+            <xsl:when test="@code='h'">of libretto, </xsl:when>
+            <xsl:when test="@code='i'">of accompanying material, </xsl:when>
+            <xsl:when test="@code='j'">of subtitles, </xsl:when>
           </xsl:choose>
           <xsl:value-of select="text()"/>
           <xsl:choose>
 
   <xsl:if test="marc:datafield[@tag=102]">
          <span class="results_summary">
-      <span class="label">Pays: </span>
+      <span class="label">Country: </span>
       <xsl:for-each select="marc:datafield[@tag=102]">
         <xsl:for-each select="marc:subfield">
           <xsl:value-of select="text()"/>
 
   <xsl:call-template name="tag_215" />
 
-  <abbr class="unapi-id" title="koha:biblionumber:{marc:datafield[@tag=090]/marc:subfield[@code='a']}"><!-- unAPI --></abbr>
-
   <xsl:if test="marc:datafield[@tag=010]/marc:subfield[@code='a']">
     <span class="results_summary"><span class="label">ISBN: </span>
     <xsl:for-each select="marc:datafield[@tag=010]">
 
   <xsl:call-template name="tag_title">
     <xsl:with-param name="tag">225</xsl:with-param>
-    <xsl:with-param name="label">Collection</xsl:with-param>
+    <xsl:with-param name="label">Series</xsl:with-param>
   </xsl:call-template>
 
   <xsl:if test="marc:datafield[@tag=676]">
 
   <xsl:if test="marc:datafield[@tag=327]">
     <span class="results_summary">
-      <span class="label">Note de contenu: </span>
+      <span class="label">Contents note: </span>
       <xsl:for-each select="marc:datafield[@tag=327]">
         <xsl:call-template name="chopPunctuation">
           <xsl:with-param name="chopString">
 
   <xsl:if test="marc:datafield[@tag=330]">
     <span class="results_summary">
-      <span class="label">Résumé: </span>
+      <span class="label">Abstract: </span>
       <xsl:for-each select="marc:datafield[@tag=330]">
         <xsl:value-of select="marc:subfield[@code='a']"/>
         <xsl:choose>
 
   <xsl:if test="marc:datafield[@tag=317]">
     <span class="results_summary">
-      <span class="label">Note sur la provenance: </span>
+      <span class="label">Provenance note: </span>
       <xsl:for-each select="marc:datafield[@tag=317]">
-          <xsl:value-of select="marc:subfield[@code='a']"/>      
+          <xsl:value-of select="marc:subfield[@code='a']"/>
       </xsl:for-each>
     </span>
   </xsl:if>
 
   <xsl:if test="marc:datafield[@tag=320]">
     <span class="results_summary">
-      <span class="label">Bibliographie: </span>
+      <span class="label">Bibliography: </span>
       <xsl:for-each select="marc:datafield[@tag=320]">
         <xsl:value-of select="marc:subfield[@code='a']"/>
         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
 
   <xsl:if test="marc:datafield[@tag=328]">
     <span class="results_summary">
-      <span class="label">Thèse: </span>
+      <span class="label">Thesis: </span>
       <xsl:for-each select="marc:datafield[@tag=328]">
         <xsl:value-of select="marc:subfield[@code='a']"/>
         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
 
   <xsl:if test="marc:datafield[@tag=333]">
     <span class="results_summary">
-      <span class="label">Public: </span>
+      <span class="label">Audience: </span>
       <xsl:for-each select="marc:datafield[@tag=333]">
         <xsl:value-of select="marc:subfield[@code='a']"/>
         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
     <span class="results_summary">
       <span class="label">SUDOC serial history: </span>
       <xsl:for-each select="marc:datafield[@tag=955]">
-        <xsl:value-of select="marc:subfield[@code='9']"/>: 
-        <xsl:value-of select="marc:subfield[@code='r']"/>
-        <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>
-    </span>
-  </xsl:if>
-
-  <xsl:if test="marc:datafield[@tag=955]">
-    <span class="results_summary">
-      <span class="label">SUDOC serial history: </span>
-      <xsl:for-each select="marc:datafield[@tag=955]">
-        <xsl:value-of select="marc:subfield[@code='9']"/>: 
+        <xsl:value-of select="marc:subfield[@code='9']"/>:
         <xsl:value-of select="marc:subfield[@code='r']"/>
         <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:call-template name="tag_subject">
     <xsl:with-param name="tag">600</xsl:with-param>
-    <xsl:with-param name="label">Sujet - Nom de personne</xsl:with-param>
+    <xsl:with-param name="label">Subject - Personal Name</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_subject">
     <xsl:with-param name="tag">601</xsl:with-param>
-    <xsl:with-param name="label">Sujet - Collectivité</xsl:with-param>
+    <xsl:with-param name="label">Subject - Corporate Author</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_subject">
     <xsl:with-param name="tag">602</xsl:with-param>
-    <xsl:with-param name="label">Sujet - Famille</xsl:with-param>
+    <xsl:with-param name="label">Subject - Family</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_subject">
     <xsl:with-param name="tag">604</xsl:with-param>
-    <xsl:with-param name="label">Sujet - Auteur/titre</xsl:with-param>
+    <xsl:with-param name="label">Subject - Author/Title</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_subject">
     <xsl:with-param name="tag">606</xsl:with-param>
-    <xsl:with-param name="label">Sujet - Nom commun</xsl:with-param>
+    <xsl:with-param name="label">Subject - Topical Name</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_subject">
     <xsl:with-param name="tag">607</xsl:with-param>
-    <xsl:with-param name="label">Sujet - Nom géographique</xsl:with-param>
+    <xsl:with-param name="label">Subject - Geographical Name</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_subject">
     <xsl:with-param name="tag">608</xsl:with-param>
-    <xsl:with-param name="label">Sujet - Forme</xsl:with-param>
+    <xsl:with-param name="label">Subject - Form</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_subject">
     <xsl:with-param name="tag">610</xsl:with-param>
-    <xsl:with-param name="label">Sujet</xsl:with-param>
+    <xsl:with-param name="label">Subject</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_subject">
     <xsl:with-param name="tag">615</xsl:with-param>
-    <xsl:with-param name="label">Catégorie sujet</xsl:with-param>
+    <xsl:with-param name="label">Subject Category</xsl:with-param>
   </xsl:call-template>
 
   <xsl:call-template name="tag_subject">
     <xsl:with-param name="tag">616</xsl:with-param>
-    <xsl:with-param name="label">Marque déposée</xsl:with-param>
+    <xsl:with-param name="label">Trademark</xsl:with-param>
   </xsl:call-template>
 
   <xsl:if test="marc:datafield[@tag=856]">
     <span class="results_summary">
       <span class="label">Online Resources: </span>
       <xsl:for-each select="marc:datafield[@tag=856]">
+        <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
         <a>
           <xsl:attribute name="href">
             <xsl:value-of select="marc:subfield[@code='u']"/>
           </xsl:attribute>
           <xsl:choose>
+            <xsl:when test="($Show856uAsImage='Details' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')">
+              <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text>
+            </xsl:when>
             <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
               <xsl:call-template name="subfieldSelect">
                 <xsl:with-param name="codes">y3z</xsl:with-param>
         <xsl:choose>
           <xsl:when test="position()=last()"></xsl:when>
           <xsl:otherwise> | </xsl:otherwise>
-        </xsl:choose>      
+        </xsl:choose>
       </xsl:for-each>
     </span>
   </xsl:if>
         <!-- 780 -->
         <xsl:if test="marc:datafield[@tag=780]">
         <xsl:for-each select="marc:datafield[@tag=780]">
-        <span class="results_summary"><span class="label">
+        <span class="results_summary">
         <xsl:choose>
         <xsl:when test="@ind2=0">
-            Continues:
+            <span class="label">Continues:</span>
         </xsl:when>
         <xsl:when test="@ind2=1">
-            Continues in part:
+            <span class="label">Continues in part:</span>
         </xsl:when>
         <xsl:when test="@ind2=2">
-            Supersedes:
+            <span class="label">Supersedes:</span>
         </xsl:when>
         <xsl:when test="@ind2=3">
-            Supersedes in part:
+            <span class="label">Supersedes in part:</span>
         </xsl:when>
         <xsl:when test="@ind2=4">
-            Formed by the union: ... and: ...
+            <span class="label">Formed by the union: ... and: ...</span>
         </xsl:when>
         <xsl:when test="@ind2=5">
-            Absorbed:
+            <span class="label">Absorbed:</span>
         </xsl:when>
         <xsl:when test="@ind2=6">
-            Absorbed in part:
+            <span class="label">Absorbed in part:</span>
         </xsl:when>
         <xsl:when test="@ind2=7">
-            Separated from:
+            <span class="label">Separated from:</span>
         </xsl:when>
         </xsl:choose>
-        </span>
                 <xsl:variable name="f780">
                     <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">at</xsl:with-param>
+                        <xsl:with-param name="codes">a_t</xsl:with-param>
                     </xsl:call-template>
                 </xsl:variable>
              <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
                 <xsl:value-of select="translate($f780, '()', '')"/>
             </a>
         </span>
+
         <xsl:choose>
         <xsl:when test="@ind1=0">
             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
         <!-- 785 -->
         <xsl:if test="marc:datafield[@tag=785]">
         <xsl:for-each select="marc:datafield[@tag=785]">
-        <span class="results_summary"><span class="label">
+        <span class="results_summary">
         <xsl:choose>
         <xsl:when test="@ind2=0">
-            Continued by:
+            <span class="label">Continued by:</span>
         </xsl:when>
         <xsl:when test="@ind2=1">
-            Continued in part by:
+            <span class="label">Continued in part by:</span>
         </xsl:when>
         <xsl:when test="@ind2=2">
-            Superseded by:
+            <span class="label">Superseded by:</span>
         </xsl:when>
         <xsl:when test="@ind2=3">
-            Superseded in part by:
+            <span class="label">Superseded in part by:</span>
         </xsl:when>
         <xsl:when test="@ind2=4">
-            Absorbed by:
+            <span class="label">Absorbed by:</span>
         </xsl:when>
         <xsl:when test="@ind2=5">
-            Absorbed in part by:
+            <span class="label">Absorbed in part by:</span>
         </xsl:when>
         <xsl:when test="@ind2=6">
-            Split into .. and ...:
+            <span class="label">Split into .. and ...:</span>
         </xsl:when>
         <xsl:when test="@ind2=7">
-            Merged with ... to form ...
+            <span class="label">Merged with ... to form ...</span>
         </xsl:when>
         <xsl:when test="@ind2=8">
-            Changed back to:
+            <span class="label">Changed back to:</span>
         </xsl:when>
 
         </xsl:choose>
-        </span>
                    <xsl:variable name="f785">
                     <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">at</xsl:with-param>
+                        <xsl:with-param name="codes">a_t</xsl:with-param>
                     </xsl:call-template>
                 </xsl:variable>