Last active
December 15, 2015 06:59
-
-
Save jsicot/5220449 to your computer and use it in GitHub Desktop.
UNIMARCslim2OPACResults.xsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE stylesheet [<!ENTITY nbsp " " >]> | |
<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ --> | |
<xsl:stylesheet version="1.0" xmlns:re = 'http://exslt.org/regular-expressions' xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:items="http://www.koha-community.org/items" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc items"> | |
<xsl:import href="UNIMARCslimUtils.xsl"/> | |
<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/> | |
<xsl:key name="item-by-status" match="items:item" use="items:status"/> | |
<xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/> | |
<xsl:template match="/"> | |
<xsl:apply-templates/> | |
</xsl:template> | |
<xsl:template match="marc:record"> | |
<xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/> | |
<!-- Variables --> | |
<xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/> | |
<xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/> | |
<xsl:variable name="typdoc" select="marc:datafield[@tag=099]/marc:subfield[@code='t']"/> | |
<xsl:variable name="statut" select="marc:datafield[@tag=995]/marc:subfield[@code='o']"/> | |
<xsl:variable name="leader" select="marc:leader"/> | |
<xsl:variable name="leader6" select="substring($leader,7,1)"/> | |
<xsl:variable name="leader7" select="substring($leader,7,2)"/> | |
<xsl:variable name="biblionumber" select="marc:controlfield[@tag=001]"/> | |
<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:variable name="unimarc100" select="marc:datafield[@tag=100]/marc:subfield[@code='a']"/> | |
<xsl:variable name="datepubli" select="substring($unimarc100,9,12)"/> | |
<xsl:variable name="editorinfos" select="marc:datafield[@tag=306]/marc:subfield[@code='a']"/> | |
<xsl:variable name="TMDBid" select="marc:datafield[@tag=19]/marc:subfield[@code='a']"/> | |
<xsl:variable name="liens856"> | |
<xsl:for-each select="marc:datafield[@tag=856]"> | |
<xsl:value-of select="marc:subfield[@code='u']"/> | |
</xsl:for-each> | |
</xsl:variable> | |
<!-- End Variables --> | |
<xsl:element name="div"> | |
<xsl:attribute name="class">resultInfo</xsl:attribute> | |
<xsl:if test="marc:datafield[@tag=010]/marc:subfield[@code='a']"> | |
<xsl:element name="span"> | |
<xsl:attribute name="class">ISBN</xsl:attribute> | |
<xsl:attribute name="style">display:none;</xsl:attribute> | |
<xsl:attribute name="id"><xsl:value-of select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/></xsl:attribute> | |
<xsl:text> </xsl:text> | |
</xsl:element> | |
</xsl:if> | |
<xsl:if test="marc:datafield[@tag=200]"> | |
<xsl:for-each select="marc:datafield[@tag=200]"> | |
<xsl:call-template name="addClassRtl"/> | |
<xsl:if test="marc:subfield"> | |
<xsl:for-each select="marc:subfield"> | |
<xsl:choose> | |
<xsl:when test="@code='a'"> | |
<xsl:if test="preceding-sibling::marc:subfield[@code='a']"> | |
<xsl:text> ; </xsl:text> | |
</xsl:if> | |
<xsl:element name="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> | |
<xsl:attribute name="title">Voir ce titre en détail</xsl:attribute> | |
<xsl:if test="$typdoc='Vidéo'"> | |
<xsl:attribute name="class">DVD</xsl:attribute> | |
<!-- <xsl:if test="$editorinfos"> | |
<xsl:element name="span"> | |
<xsl:attribute name="class">editorinfos</xsl:attribute> | |
<xsl:value-of select="$editorinfos"/> | |
</xsl:element> | |
</xsl:if> --> | |
<xsl:attribute name="gj-title1"> | |
<xsl:choose> | |
<xsl:when test="//marc:datafield[@tag=454]"> | |
<xsl:value-of select="//marc:datafield[@tag=454]" /> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="." /> | |
<xsl:if test="//marc:datafield[@tag=200]/marc:subfield[@code='h']"> | |
<xsl:text> </xsl:text> | |
<xsl:value-of select="//marc:datafield[@tag=200]/marc:subfield[@code='h']" /> | |
</xsl:if> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:attribute> | |
<xsl:attribute name="gj-title2"> | |
<xsl:value-of select="//marc:datafield[@tag=200]/marc:subfield[@code='d']" /> | |
</xsl:attribute> | |
<xsl:attribute name="gj-director-fn"> | |
<xsl:call-template name="director7xxFirstname" /> | |
</xsl:attribute> | |
<xsl:attribute name="gj-director-sn"> | |
<xsl:call-template name="director7xxSurname" /> | |
</xsl:attribute> | |
<xsl:if test="$TMDBid"> | |
<xsl:element name="span"> | |
<xsl:attribute name="class">TMDBid</xsl:attribute> | |
<xsl:value-of select="$TMDBid"/> | |
</xsl:element> | |
</xsl:if> | |
</xsl:if> | |
<xsl:variable name="title" select="."/> | |
<xsl:variable name="ntitle" select="translate($title, '','')"/> | |
<xsl:element name="span"> | |
<xsl:value-of select="$ntitle" disable-output-escaping="yes"/> | |
</xsl:element> | |
</xsl:element> | |
</xsl:when> | |
<!--<xsl:when test="@code='b'"> | |
<xsl:text> [</xsl:text> | |
<xsl:value-of select="."/> | |
<xsl:text>]</xsl:text> | |
</xsl:when>--> | |
<xsl:when test="@code='c'"> | |
<xsl:text>. </xsl:text> | |
<xsl:element name="span"> | |
<xsl:attribute name="class">title</xsl:attribute> | |
<xsl:value-of select="."/> | |
</xsl:element> | |
</xsl:when> | |
<xsl:when test="@code='d'"> | |
<xsl:choose> | |
<xsl:when test="not(starts-with(normalize-space(.),'='))"> | |
<xsl:element name="span"> | |
<xsl:attribute name="class">title</xsl:attribute> | |
<xsl:text> = </xsl:text> | |
</xsl:element> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:text> </xsl:text> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:element name="span"> | |
<xsl:attribute name="class">title</xsl:attribute> | |
<xsl:value-of select="." disable-output-escaping="yes"/> | |
</xsl:element> | |
</xsl:when> | |
<xsl:when test="@code='e'"> | |
<xsl:element name="span"> | |
<xsl:attribute name="class">title</xsl:attribute> | |
<xsl:text>: </xsl:text> | |
<xsl:value-of select="." disable-output-escaping="yes"/> | |
</xsl:element> | |
</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:when test="@code='h'"> | |
<xsl:element name="span"> | |
<xsl:attribute name="class">title</xsl:attribute> | |
<xsl:text>. </xsl:text> | |
<xsl:value-of select="." disable-output-escaping="yes"/> | |
</xsl:element> | |
</xsl:when> | |
<xsl:when test="@code='i'"> | |
<xsl:choose> | |
<xsl:when test="preceding-sibling::marc:subfield[position()=1][@code='h']"> | |
<xsl:text>, </xsl:text> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:text>. </xsl:text> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:element name="span"> | |
<xsl:attribute name="class">title</xsl:attribute> | |
<xsl:value-of select="." disable-output-escaping="yes"/> | |
</xsl:element> | |
</xsl:when> | |
</xsl:choose> | |
</xsl:for-each> | |
</xsl:if> | |
</xsl:for-each> | |
</xsl:if> | |
<!-- Auteurs #700, #701 --> | |
<xsl:if test="marc:datafield[@tag=700] or marc:datafield[@tag=701]"> | |
<div class="results_summary"> | |
<span class="label">Par </span> | |
<xsl:choose> | |
<xsl:when test="marc:datafield[@tag=700]"> | |
<a> | |
<xsl:choose> | |
<xsl:when test="marc:datafield[@tag=700]/marc:subfield[@code=9]"> | |
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=an,phr&q=<xsl:value-of select="marc:datafield[@tag=700]/marc:subfield[@code=9]"/></xsl:attribute> | |
<xsl:attribute name="class">author</xsl:attribute> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=au&q=<xsl:value-of select="marc:datafield[@tag=700]/marc:subfield[@code='a']"/><xsl:text>+</xsl:text><xsl:value-of select="marc:datafield[@tag=700]/marc:subfield[@code='b']"/></xsl:attribute> | |
<xsl:attribute name="class">author</xsl:attribute> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:if test="marc:datafield[@tag=700]/marc:subfield[@code='b']"> | |
<xsl:value-of select="marc:datafield[@tag=700]/marc:subfield[@code='b']"/> | |
</xsl:if> | |
<xsl:if test="marc:datafield[@tag=700]/marc:subfield[@code='a']"> | |
<xsl:text> </xsl:text> | |
<xsl:value-of select="marc:datafield[@tag=700]/marc:subfield[@code='a']"/> | |
</xsl:if> | |
</a> | |
</xsl:when> | |
<xsl:otherwise> | |
<a> | |
<xsl:choose> | |
<xsl:when test="marc:datafield[@tag=702]/marc:subfield[@code=9]"> | |
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=an,phr&q=<xsl:value-of select="marc:datafield[@tag=702]/marc:subfield[@code=9]"/></xsl:attribute> | |
<xsl:attribute name="class">author</xsl:attribute> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=au&q=<xsl:value-of select="marc:datafield[@tag=702]/marc:subfield[@code='a']"/><xsl:text> </xsl:text><xsl:value-of select="marc:datafield[@tag=702]/marc:subfield[@code='b']"/></xsl:attribute> | |
<xsl:attribute name="class">author</xsl:attribute> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:if test="marc:datafield[@tag=702]/marc:subfield[@code='b']"> | |
<xsl:value-of select="marc:datafield[@tag=702]/marc:subfield[@code='b']"/> | |
</xsl:if> | |
<xsl:if test="marc:datafield[@tag=702]/marc:subfield[@code='a']"> | |
<xsl:text> </xsl:text> | |
<xsl:value-of select="marc:datafield[@tag=702]/marc:subfield[@code='a']"/> | |
</xsl:if> | |
</a> | |
</xsl:otherwise> | |
</xsl:choose> | |
</div> | |
</xsl:if> | |
<!-- Fin Auteurs #700, #701 --> | |
<xsl:call-template name="tag_205"/> | |
<!-- Editeur #210 --> | |
<xsl:if test="marc:datafield[@tag=210]"> | |
<span class="results_summary"> | |
<xsl:choose> | |
<xsl:when test="$typdoc='Revue'"> | |
<xsl:if test="marc:datafield[@tag=210]/marc:subfield[@code='c']"> | |
<span class="label"><xsl:text>Éditeur : </xsl:text></span> | |
<xsl:element name="a"> | |
<xsl:attribute name="class">publisher</xsl:attribute> | |
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=pb&q=<xsl:value-of select="marc:datafield[@tag=210]/marc:subfield[@code='c']"/></xsl:attribute> | |
<xsl:value-of select="marc:datafield[@tag=210]/marc:subfield[@code='c']"/> | |
</xsl:element> | |
</xsl:if> | |
</xsl:when> | |
<xsl:when test="$typdoc!='Revue'"> | |
<xsl:for-each select="marc:datafield[@tag=210]"> | |
<xsl:if test="marc:subfield[@code='c']"> | |
<span class="label"><xsl:text>Publié par </xsl:text></span> | |
<xsl:element name="a"> | |
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=pb&q=<xsl:value-of select="marc:subfield[@code='c']"/></xsl:attribute> | |
<xsl:attribute name="class">publisher</xsl:attribute> | |
<xsl:value-of select="marc:subfield[@code='c']"/> | |
</xsl:element> | |
</xsl:if> | |
<xsl:if test="marc:subfield[@code='d']"> | |
<xsl:if test="marc:subfield[@code='a' or @code='c']"> <span class="label">en </span> </xsl:if> | |
<xsl:value-of select="marc:subfield[@code='d']"/> | |
</xsl:if> | |
</xsl:for-each> | |
</xsl:when> | |
</xsl:choose> | |
</span> | |
</xsl:if> | |
<!-- Fin Editeur #210 --> | |
<!-- Description #215 --> | |
<xsl:if test="$typdoc!='Revue'"> | |
<xsl:if test="marc:datafield[@tag=215]/marc:subfield[@code='a']"> | |
<xsl:for-each select="marc:datafield[@tag=215]"> | |
<span class="results_summary"> | |
<xsl:if test="marc:subfield[@code='a']"> | |
<xsl:value-of select="marc:subfield[@code='a']"/> | |
</xsl:if> | |
</span> | |
</xsl:for-each> | |
</xsl:if> | |
</xsl:if> | |
<!-- Fin Description #215 --> | |
<!-- Note de thèse #328 --> | |
<xsl:if test="marc:datafield[@tag=328]"> | |
<div class="xslt-block"> | |
<xsl:for-each select="marc:datafield[@tag=328]"> | |
<span class="results_summary"> | |
<xsl:call-template name="tagprint"> | |
<xsl:with-param name="codes">abcdetuz2</xsl:with-param> | |
</xsl:call-template> | |
</span> | |
</xsl:for-each> | |
</div> | |
</xsl:if> | |
<!-- End Note de thèse #328 --> | |
<!-- Icones Type de doc --> | |
<xsl:if test="marc:datafield[@tag=099]/marc:subfield[@code='t']"> | |
<span class="typdoc_img results_summary"> | |
<xsl:choose> | |
<xsl:when test="$typdoc='Revue'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/revue.png" alt="Revue" title="Revue"/>Revue</div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Livre'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/livre.png" alt="Livre" title="Livre"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Thèse'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/these.png" alt="Thèse – Mémoire" title="Thèse – Mémoire"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Bande dessinée'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/bd.png" alt="Bande dessinée" title="Bande dessinée"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Carte – Plan'"> | |
<div id="typdoc_results"> <img src="/opac-tmpl/rennes2/css/img/icons/rennes2/carte.png" alt="Carte – Plan" title="Carte – Plan"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Document multisupport'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/multisupports.png" alt="Document multisupport" title="Document multisupport"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Image – Photo'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/image.png" alt="Image – Photo" title="Image – Photo"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Audio'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/audio.png" alt="Audio" title="Audio"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Vidéo'"> | |
<xsl:text></xsl:text> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/video.png" alt="Vidéo" title="Vidéo" class="DVD" id=""/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Partition'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/partition.png" alt="Partition" title="Partition"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Manuscrit'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/manuscrit.png" alt="Manuscrit" title="Manuscrit"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
<xsl:when test="$typdoc='Test psychologique'"> | |
<div id="typdoc_results"><img src="/opac-tmpl/rennes2/css/img/icons/rennes2/tests.png" alt="Test psychologique" title="Test psychologique"/><xsl:value-of select="$typdoc"/></div> | |
</xsl:when> | |
</xsl:choose> | |
</span> | |
</xsl:if> | |
<!-- End Icones Type de doc --> | |
<!-- Disponibilité et Exemplaires --> | |
<span class="results_summary"> | |
<xsl:choose> | |
<!-- SI revue on affiche juste la cote provennant du sudoc --> | |
<xsl:when test="$typdoc='Revue'"> | |
<xsl:if test="marc:datafield[@tag=930]"> | |
<span class="results_summary"> | |
<span class="available"> | |
<span class="button button-available"><xsl:text>Disponible</xsl:text></span> | |
<xsl:for-each select="marc:datafield[@tag=930]"> | |
<xsl:variable name="RCRlib"> | |
<xsl:call-template name="RCR"> | |
<xsl:with-param name="code" select="substring-before(marc:subfield[@code='5'], ':')"/> | |
</xsl:call-template> | |
</xsl:variable> | |
<xsl:if test="$RCRlib!=''"> | |
<xsl:value-of select="$RCRlib"/> | |
<xsl:if test="marc:subfield[@code='e']"> | |
<xsl:text> - </xsl:text> | |
<xsl:value-of select="marc:subfield[@code='e']"/> | |
</xsl:if> | |
<xsl:if test="marc:subfield[@code='a']"> | |
<xsl:text>(cote </xsl:text> | |
<xsl:value-of select="marc:subfield[@code='a']"/> | |
<xsl:text>)</xsl:text> | |
</xsl:if> | |
<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> | |
</xsl:for-each> | |
</span> | |
</span> | |
</xsl:if> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:choose> | |
<!-- SI dispo en ligne --> | |
<xsl:when test="marc:datafield[@tag=856]"> | |
<xsl:if test="not(contains($liens856,'electre.com'))"> | |
<xsl:if test="$typdoc!='Revue'"> | |
<xsl:for-each select="marc:datafield[@tag=856]"> | |
<xsl:choose> | |
<xsl:when test="marc:subfield[@code='5']"> | |
<span class="results_summary actions"> | |
<a> | |
<xsl:attribute name="href"> | |
<xsl:value-of select="marc:subfield[@code='u']"/> | |
</xsl:attribute> | |
<xsl:attribute name="target"><xsl:text>_blank</xsl:text></xsl:attribute> | |
<xsl:choose> | |
<xsl:when test="marc:subfield[@code='z']"> | |
<xsl:attribute name="title"> | |
<xsl:value-of select="marc:subfield[@code='z']"/> | |
</xsl:attribute> | |
</xsl:when> | |
<xsl:otherwise><xsl:attribute name="title"><xsl:text>consulter en ligne</xsl:text></xsl:attribute></xsl:otherwise> | |
</xsl:choose> | |
<xsl:choose> | |
<xsl:when test="marc:subfield[@code='z']"> | |
<span class="button button-online"> | |
<xsl:value-of select="marc:subfield[@code='z']"/> | |
</span> | |
</xsl:when> | |
</xsl:choose> | |
</a> | |
</span> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:if test="not(contains($liens856,'scdbases'))"> | |
<span class="results_summary actions"> | |
<a> | |
<xsl:attribute name="href"> | |
<xsl:value-of select="marc:subfield[@code='u']"/> | |
</xsl:attribute> | |
<xsl:attribute name="target"><xsl:text>_blank</xsl:text></xsl:attribute> | |
<xsl:choose> | |
<xsl:when test="marc:subfield[@code='z']"> | |
<xsl:attribute name="title"> | |
<xsl:value-of select="marc:subfield[@code='z']"/> | |
</xsl:attribute> | |
</xsl:when> | |
<xsl:otherwise><xsl:attribute name="title"><xsl:text>consulter en ligne</xsl:text></xsl:attribute></xsl:otherwise> | |
</xsl:choose> | |
<xsl:choose> | |
<xsl:when test="marc:subfield[@code='z']"> | |
<span class="button button-online"> | |
<xsl:value-of select="marc:subfield[@code='z']"/> | |
</span> | |
</xsl:when> | |
<xsl:otherwise><span class="button button-online">Consulter en ligne</span></xsl:otherwise> | |
</xsl:choose> | |
</a> | |
</span> | |
</xsl:if> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:for-each> | |
</xsl:if> | |
</xsl:if> | |
</xsl:when> | |
<xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0"> | |
<xsl:if test="count(key('item-by-status', 'Checked out'))>0"> | |
<span class="button button-unavailable"> | |
<xsl:text>Emprunté</xsl:text> | |
</span> | |
</xsl:if> | |
<!-- Indisponible --> | |
<xsl:if test="count(key('item-by-status', 'unavailable'))>0"> | |
<span class="button button-unavailable"> | |
<xsl:text>Indisponible</xsl:text> | |
</span> | |
</xsl:if> | |
<!-- Retiré --> | |
<xsl:if test="count(key('item-by-status', 'Withdrawn'))>0"> | |
<span class="button button-unavailable"> | |
<xsl:text>Indisponible </xsl:text> | |
</span> | |
</xsl:if> | |
<!-- Perdu --> | |
<xsl:if test="count(key('item-by-status', 'Lost'))>0"> | |
<span class="button button-unavailable"> | |
<xsl:text>Perdu </xsl:text> | |
</span> | |
</xsl:if> | |
<!-- Endommagé --> | |
<xsl:if test="count(key('item-by-status', 'Damaged'))>0"> | |
<span class="button button-unavailable"> | |
<xsl:text>Endommagé </xsl:text> | |
<!--<xsl:value-of select="count(key('item-by-status', 'Damaged'))"/>--> | |
</span> | |
</xsl:if> | |
<!-- En Commande --> | |
<xsl:if test="count(key('item-by-status', 'On Orangemanr'))>0"> | |
<span class="button button-onsite"> | |
<xsl:text>En commande </xsl:text> | |
</span> | |
</xsl:if> | |
<!-- En transit --> | |
<xsl:if test="count(key('item-by-status', 'In transit'))>0"> | |
<span class="button button-onsite"> | |
<xsl:text>En transit </xsl:text> | |
</span> | |
</xsl:if> | |
<!-- Réservé --> | |
<xsl:if test="count(key('item-by-status', 'Waiting'))>0"> | |
<span class="button button-onsite"> | |
<xsl:text>Réservé </xsl:text> | |
</span> | |
</xsl:if> | |
</xsl:when> | |
<xsl:when test="count(key('item-by-status', 'available'))>0"> | |
<span class="available"> | |
<span class="button button-available"><xsl:text>Disponible</xsl:text></span> | |
<xsl:variable name="available_items" select="key('item-by-status', 'available')"/> | |
<xsl:choose> | |
<xsl:when test="$singleBranchMode=1"> | |
<xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]"> | |
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> (<xsl:value-of select="items:itemcallnumber"/>)</xsl:if> | |
<xsl:text> (</xsl:text> | |
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/> | |
<xsl:text>)</xsl:text> | |
<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:when> | |
<xsl:otherwise> | |
<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:if test="items:itemcallnumber != '' and items:itemcallnumber"> (<xsl:value-of select="items:itemcallnumber"/>) </xsl:if> | |
<xsl:text> [</xsl:text> | |
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/> | |
<xsl:text>]</xsl:text> | |
<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:otherwise> | |
</xsl:choose> | |
</span> | |
</xsl:when> | |
<xsl:when test="count(key('item-by-status', 'reference'))>0"> | |
<span class="onsite"> | |
<span class="button button-onsite"><xsl:text>Consultation sur place</xsl:text></span> | |
<xsl:variable name="reference_items" | |
select="key('item-by-status', 'reference')"/> | |
<xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]"> | |
<xsl:value-of select="items:homebranch"/> | |
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> (<xsl:value-of select="items:itemcallnumber"/>)</xsl:if> | |
<xsl:text> [</xsl:text> | |
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/> | |
<xsl:text>]</xsl:text> | |
<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:when> | |
</xsl:choose> | |
</xsl:otherwise> | |
</xsl:choose> | |
</span> | |
</xsl:element> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment