--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY nbsp " ">
+<!ENTITY egrave "è">
+<!ENTITY euro "€">
+<!ENTITY agrave "à">
+<!ENTITY eacute "é">
+]>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://www.xemelios.org/namespaces#manifeste"
+ xmlns:n="http://www.xemelios.org/namespaces#manifeste"
+ xmlns:added="http://projets.admisource.gouv.fr/xemelios/namespaces#added"
+ xmlns:fn="http://projets.admisource.gouv.fr/xemelios/namespaces#functions"
+ xmlns:conf="http://projets.admisource.gouv.fr/xemelios/namespaces#config"
+ version="2.0">
+ <!-- Paramètres de sortie -->
+ <xsl:character-map name="accents">
+ <xsl:output-character character="à" string="&#224;"/>
+ <xsl:output-character character="é" string="&#233;"/>
+ <xsl:output-character character="è" string="&#232;"/>
+ <xsl:output-character character="ê" string="&#234;"/>
+ <xsl:output-character character="ë" string="&#235;"/>
+ <xsl:output-character character="î" string="&#238;"/>
+ <xsl:output-character character="ï" string="&#239;"/>
+ <xsl:output-character character="ô" string="&#244;"/>
+ <xsl:output-character character="ù" string="&#249;"/>
+ <xsl:output-character character="°" string="&#176;"/>
+ </xsl:character-map>
+
+ <xsl:output method="xhtml" indent="yes" use-character-maps="accents" encoding="ISO-8859-1"/>
+
+ <xsl:decimal-format name="decformat" decimal-separator="," grouping-separator=" " digit="#" pattern-separator=";" NaN="NaN" minus-sign="-"/>
+
+ <!-- Paramètres Web -->
+ <xsl:param name="is.web">-1</xsl:param>
+ <xsl:param name="context.path"/>
+
+ <!-- la configuration des documents -->
+ <xsl:param name="config" select="document(.)"/>
+
+ <!-- Paramètres d'entrée -->
+ <xsl:param name="show.formulaire"/>
+ <xsl:param name="browser-destination"/>
+
+ <!-- Paramètres d'entrée de la liste de résultat -->
+ <xsl:param name="numCompte">0</xsl:param>
+
+ <!-- Paramètres d'erreur -->
+ <xsl:param name="error.message">nomessage</xsl:param>
+
+ <!-- Variables -->
+ <xsl:variable name="page-format" select="paysage"/>
+ <!--xsl:param name="separator.timestamp.empty" select="' '"/>
+ <xsl:param name="separator.timestamp.T" select="'T'"/-->
+
+ <!-- pour eviter les sorties parasites de tags non matches -->
+ <xsl:template match="*"/>
+
+ <xsl:template match="/n:manifeste">
+ <html>
+ <head>
+ <title>Manifeste d'archives</title>
+ <style type="text/css" media="all">
+ body {font-family: verdana, sans-serif; font-size: 12px; }
+
+ h1 { font-size: 20px; color: #003535; font-weight: bold; }
+ h2 { font-size: 16px; color: #004545; text-align: left;}
+ h3 { background-color: #DDDDDD; font-size: 14px; color: #005555; text-align: left; margin-bottom: 3px;}
+
+ th { background-color: #999999; }
+
+ .resultatimport b { padding-left: 25px; }
+ .libelle { font-weight: bold; }
+
+ tr#colorised1 td {background-color: #FFFFC5; } /* fonce */
+ tr#colorised2 td {background-color: #FFFFE0; } /* clair */
+ tr#niCol1 td {background-color: #F68989; } /* fonce */
+ tr#niCol2 td {background-color: #F8B9B9 } /* clair */
+ .warn { right: 0px; color: red; font-weight: bold; }
+ td.good { right: 0px; color: green; font-weight: bold; }
+ </style>
+ </head>
+ <body width="100%">
+ <center><h1>Archive</h1></center>
+ <xsl:call-template name="informations.archive"><xsl:with-param name="manifeste" select="."/></xsl:call-template>
+ <xsl:variable name="nbVolumes" select="count(n:volumes/n:volume)"/>
+ <h4>Cette archive comporte <xsl:value-of select="$nbVolumes"/> volume<xsl:if test="$nbVolumes gt 1">s</xsl:if>.</h4>
+ <xsl:call-template name="information.archive.import"><xsl:with-param name="import" select="n:resultatimport"/></xsl:call-template>
+ <h2>Historique</h2>
+ <table>
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Utilisateur</th>
+ <th>Action efféctuée</th>
+ <th>Version d'archive</th>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="/n:manifeste/n:evenements/n:evenement">
+ <xsl:call-template name="evenement">
+ <xsl:with-param name="evt" select="."/>
+ <xsl:with-param name="pos" select="position()"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </tbody>
+ </table>
+
+ <h2>Documents présents dans l'archive</h2>
+ <table>
+ <thead>
+ <tr>
+ <th>Document</th>
+ <th>Type</th>
+ <th>Poste comptable</th>
+ <th>Collectivité Budget</th>
+ <th>Importé</th>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="n:documents/n:document">
+ <xsl:variable name="document" select="."/>
+ <xsl:variable name="nom.doc">
+ <xsl:choose>
+ <xsl:when test="contains(@path,'/')"><xsl:value-of select="tokenize(./@path,'/')[count(tokenize($document/@path,'/'))]"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="@path"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="docId" select="fn:getDocIdFromType(@type)"/>
+ <!--tr><td colspan="4">docId=<xsl:value-of select="$docId"/></td></tr-->
+ <tr>
+ <xsl:choose>
+ <xsl:when test="@imported='Oui'">
+ <xsl:choose>
+ <xsl:when test="(position() mod 2) = 0">
+ <xsl:attribute name="id">colorised1</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="id">colorised2</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="(position() mod 2) = 0">
+ <xsl:attribute name="id">niCol1</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="id">niCol2</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td>
+ <a href="#{fn:getAnchor(@path)}"><xsl:value-of select="$nom.doc"/></a>
+ </td>
+ <td>
+ <xsl:choose>
+ <xsl:when test="'yes'=$config//conf:document[@id=$docId]/@browsable and exists(@buIdCol) and exists(@buCode) and not(@imported='no')">
+ <a href="xemelios:/query?docId={$docId}&etatId={$config//conf:document[@id=$docId]/@browsable-etat}&collectivite={@buIdCol}&budget={@buCode}&sp1={/n:manifeste/@exercice}"><xsl:value-of select="$config//conf:document[@id=$docId]/@libelle"/></a>
+ </xsl:when>
+ <xsl:otherwise><xsl:choose>
+ <xsl:when test="string-length($docId) eq 0">Pièce justificative</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$config//conf:document[@id=$docId]/@libelle"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ <td><xsl:value-of select="@buCodic"/></td>
+ <td><xsl:if test="exists(@buLibelle)"><xsl:value-of select="@buLibelle"/></xsl:if></td>
+ <td><xsl:value-of select="@imported"/></td>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ <xsl:for-each select="n:documents/n:document">
+ <xsl:call-template name="informations.document"><xsl:with-param name="document" select="."/></xsl:call-template>
+ <!--xsl:call-template name="informations.document.import">
+ <xsl:with-param name="import" select="n:resultatimport"/>
+ <xsl:with-param name="document" select="."/>
+ </xsl:call-template-->
+ </xsl:for-each>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="evenement">
+ <xsl:param name="evt"/>
+ <xsl:param name="pos"/>
+ <tr>
+ <xsl:choose>
+ <xsl:when test="(pos mod 2) eq 0"><xsl:attribute name="id">colorised1</xsl:attribute></xsl:when>
+ <xsl:otherwise><xsl:attribute name="id">colorised2</xsl:attribute></xsl:otherwise>
+ </xsl:choose>
+ <td><xsl:value-of select="format-dateTime($evt/@date, '[D01]/[M01]/[Y] [H01]:[m01]:[s01]')"/></td>
+ <td><xsl:value-of select="$evt/@user"/></td>
+ <td><xsl:value-of select="$evt/@section"/></td>
+ <td align="right"><xsl:value-of select="$evt/@version-archive"/></td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template name="informations.archive">
+ <xsl:param name="manifeste"/>
+ <!-- FA383 -->
+ <h2>Informations générales</h2>
+ <table width="95%">
+ <tbody>
+ <tr>
+ <td class="libelle">Exercice</td>
+ <td><xsl:value-of select="$manifeste/@exercice"/></td>
+ <td class="libelle">Poste comptable</td>
+ <td><xsl:value-of select="$manifeste/@cgCodic"/></td>
+ </tr>
+ <tr>
+ <!--td><xsl:value-of select="$manifeste/@cgIdCol"/></td>
+ <td><xsl:value-of select="$manifeste/@cgCodeCol"/></td-->
+ <td class="libelle">Budget Collectivité</td>
+ <td colspan="3"><xsl:value-of select="$manifeste/@cgLibelle"/></td>
+ </tr>
+ <xsl:choose>
+ <xsl:when test="exists($manifeste/@dateValidation)">
+ <tr>
+ <td class="libelle good">Archive validée <span>le</span></td>
+ <td><xsl:value-of select="format-dateTime($manifeste/@dateValidation,'[D01]/[M01]/[Y0001] [H01]:[m01]:[s01]')"/></td>
+ <td class="libelle">Par</td>
+ <td><xsl:value-of select="$manifeste/@nomValideur"/></td>
+ </tr>
+ </xsl:when>
+ <xsl:otherwise>
+ <tr>
+ <td class="libelle warn" colspan="4">Archive non validée</td>
+ </tr>
+ </xsl:otherwise>
+ </xsl:choose>
+ </tbody>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="information.archive.import">
+ <xsl:param name="import"/>
+ <!-- FA-383 -->
+ <h2>Import</h2>
+ <table width="95%">
+ <tbody>
+ <tr>
+ <td class="libelle">Date de réception</td>
+ <td><xsl:if test="$import/@LastModify"><xsl:value-of select="format-dateTime($import/@LastModify,'[D01]/[M01]/[Y0001] [H01]:[m01]:[s01]')"/></xsl:if></td>
+ <td class="libelle">Importé par</td>
+ <td><xsl:value-of select="$import/@User"/></td>
+ </tr>
+ <tr>
+ <td class="libelle">Début d'import</td>
+ <td><xsl:value-of select="format-dateTime($import/@Debut,'[D01]/[M01]/[Y0001] [H01]:[m01]:[s01]')"/></td>
+ <td class="libelle">Fin d'import</td>
+ <td><xsl:value-of select="format-dateTime($import/@Fin,'[D01]/[M01]/[Y0001] [H01]:[m01]:[s01]')"/></td>
+ </tr>
+ <tr>
+ <td class="libelle">Durée d'import</td>
+ <td><xsl:value-of select="$import/@Duree"/></td>
+ <td class="libelle">Données présentes</td>
+ <td><xsl:value-of select="/n:manifeste/n:volumes/n:volume/@added:archive"/></td>
+ </tr>
+ </tbody>
+ </table>
+ <xsl:call-template name="information.import.detail"><xsl:with-param name="parent.elements" select="$import/n:importation"/></xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="informations.document">
+ <xsl:param name="document"/>
+ <xsl:variable name="nom.doc">
+ <xsl:choose>
+ <xsl:when test="contains($document/@path,'/')"><xsl:value-of select="tokenize($document/@path,'/')[count(tokenize($document/@path,'/'))]"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="$document/@path"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="docId" select="fn:getDocIdFromType(@type)"/>
+ <h3><a name="{fn:getAnchor($document/@path)}"/>Document <xsl:value-of select="$nom.doc"/><xsl:if test="'no'=$document/@imported"><span class="warn">Non importé</span></xsl:if></h3>
+ <xsl:choose>
+ <xsl:when test="$document/@imported eq 'Non'"><p style="margin-bottom: 1px; margin-left: 5px; margin-top: 0px; font-weight: bold;">Ce document n'a pas été importé</p></xsl:when>
+ <xsl:when test="$document/@imported eq 'Non fourni'"><p>Ce document n'était pas disponible dans l'archive</p></xsl:when>
+ </xsl:choose>
+ <table style="margin-left: 5px;">
+ <colgroup>
+ <xsl:choose>
+ <xsl:when test="exists($document/n:resultatimport)">
+ <col width="15%"/>
+ <col width="20%"/>
+ <col width="15%"/>
+ <col width="20%"/>
+ <col width="15%"/>
+ <col width="15%"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <col width="20%"/>
+ <col width="30%"/>
+ <col width="20%"/>
+ <col width="30%"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </colgroup>
+ <tbody>
+ <xsl:variable name="_blank" select="not($document/@imported eq 'Oui')"/>
+ <tr>
+ <xsl:if test="$_blank"><xsl:attribute name="style">background-color: #EEEEEE;</xsl:attribute></xsl:if>
+ <td class="libelle">Poste comptable</td>
+ <td><xsl:value-of select="$document/@buCodic"/></td>
+ <td class="libelle">Type de doument</td>
+ <td><xsl:value-of select="$config//conf:document[@id=$docId]/@libelle"/></td>
+ <xsl:if test="exists($document/n:resultatimport)">
+ <td class="libelle">Début d'import</td>
+ <td><xsl:value-of select = "format-dateTime($document/n:resultatimport/@Debut,'[D01]/[M01]/[Y] [H01]:[m01]:[s01]')"/></td>
+ </xsl:if>
+ </tr>
+ <tr>
+ <xsl:if test="$_blank"><xsl:attribute name="style">background-color: #EEEEEE;</xsl:attribute></xsl:if>
+ <td class="libelle">Identifiant coll.</td>
+ <td><xsl:value-of select="$document/@buIdCol"/></td>
+ <td class="libelle">Code collectivité</td>
+ <td><xsl:value-of select="$document/@buCodeCol"/></td>
+ <xsl:if test="exists($document/n:resultatimport)">
+ <td class="libelle">Fin d'import</td>
+ <td><xsl:value-of select = "format-dateTime($document/n:resultatimport/@Fin,'[D01]/[M01]/[Y] [H01]:[m01]:[s01]')"/></td>
+ </xsl:if>
+ </tr>
+ <tr>
+ <xsl:if test="$_blank"><xsl:attribute name="style">background-color: #EEEEEE;</xsl:attribute></xsl:if>
+ <td class="libelle">Budget Collectivité</td>
+ <td><xsl:value-of select="$document/@buLibelle"/></td>
+ <td class="libelle">Code budget</td>
+ <td><xsl:value-of select="$document/@buCode"/></td>
+ <xsl:if test="exists($document/n:resultatimport)">
+ <td class="libelle">Durée d'import</td>
+ <td><xsl:value-of select = "$document/n:resultatimport/@Duree"/></td>
+ </xsl:if>
+ </tr>
+ <xsl:if test="$config//conf:document[@id=$docId]/@archive-ventil-attr">
+ <xsl:variable name="attrName" select="$config//conf:document[@id=$docId]/@archive-ventil-attr"/>
+ <tr>
+ <xsl:if test="$_blank"><xsl:attribute name="style">background-color: #EEEEEE;</xsl:attribute></xsl:if>
+ <td class="libelle">Type <xsl:value-of select="$attrName"/></td>
+ <td>
+ <xsl:attribute name="colspan"><xsl:choose>
+ <xsl:when test="exists($document/n:resultatimport)">5</xsl:when>
+ <xsl:otherwise>3</xsl:otherwise>
+ </xsl:choose></xsl:attribute>
+ <xsl:value-of select="$document/@*[name() eq $attrName]"/>
+ </td>
+ </tr>
+ </xsl:if>
+ </tbody>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="informations.document.import">
+ <xsl:param name="import"/>
+ <xsl:param name="document"/>
+
+ <table width="95%">
+ <!-- FA-383 -->
+ <caption><h3>Informations sur l'import du document</h3></caption>
+ <colgroup>
+ <col width="35%"/>
+ <col width="35%"/>
+ <col width="30%"/>
+ </colgroup>
+ <thead>
+ <tr>
+ <th>Début d'import</th>
+ <th>Fin d'import</th>
+ <th>Durée d'import</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><xsl:value-of select="format-dateTime($import/@Debut,'[D01]/[M01]/[Y] [H01]:[m01]:[s01]')"></xsl:value-of></td>
+ <td><xsl:value-of select="format-dateTime($import/@Fin,'[D01]/[M01]/[Y] [H01]:[m01]:[s01]')"/></td>
+ <td><xsl:value-of select="$import/@Duree"/></td>
+ </tr>
+ </tbody>
+ </table>
+ <xsl:call-template name="information.import.detail">
+ <xsl:with-param name="parent.elements" select="$import/n:importation"/>
+ <xsl:with-param name="document" select="$document"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="information.import.detail">
+ <xsl:param name="parent.elements"/>
+ <xsl:param name="document"/>
+
+ <table width="95%">
+ <colgroup>
+ <col width="85%"/>
+ <col width="15%"/>
+ </colgroup>
+ <thead>
+ <tr>
+ <th>Element</th>
+ <th>Nombre</th>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="$parent.elements/n:element">
+ <xsl:sort select="@Libelle"/>
+ <tr>
+ <xsl:choose>
+ <xsl:when test="@imported='no'">
+ <xsl:choose>
+ <xsl:when test="(position() mod 2) = 0">
+ <xsl:attribute name="id">ni-col1</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="id">ni-col2</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="(position() mod 2) = 0">
+ <xsl:attribute name="id">colorised1</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="id">colorised2</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td><xsl:value-of select="@Libelle"/></td>
+ <td><xsl:value-of select="@Nb"/></td>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="iso-date">
+ <xsl:param name="datebrute"/>
+ <xsl:choose>
+ <xsl:when test="string-length($datebrute)>0 and not(contains($datebrute,'..'))">
+ <xsl:value-of select="substring($datebrute, 9, 2)"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="substring($datebrute,6,2)"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="substring($datebrute, 1, 4)"/>
+ </xsl:when>
+ <xsl:when test="string-length($datebrute)>0 and contains($datebrute,'..')">
+ <xsl:value-of select="$datebrute"/>
+ </xsl:when>
+ <xsl:otherwise>-</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:function name="fn:getDocIdFromType" as="xs:string">
+ <xsl:param name="type" as="xs:string"/>
+ <xsl:variable name="docId">
+ <xsl:choose>
+ <xsl:when test="'CGE' eq $type">cg-colloc</xsl:when>
+ <xsl:when test="'CGETAT' eq $type">cg-etat</xsl:when>
+ <xsl:when test="'PES' eq $type">pes-aller</xsl:when>
+ <xsl:when test="'EDMN' eq $type">edmn</xsl:when>
+ <xsl:when test="'ERTN' eq $type">ertn</xsl:when>
+ <xsl:when test="'PJ' eq $type"></xsl:when>
+ <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:sequence select="$docId"/>
+ </xsl:function>
+ <xsl:function name="fn:getAnchor" as="xs:string">
+ <xsl:param name="path" as="xs:string"/>
+ <xsl:sequence select="replace($path,'/','-')"/>
+ </xsl:function>
+</xsl:stylesheet>