+++ /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;}
-
- 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; }
- </style>
- </head>
- <body width="100%">
- <center><h1>Manifeste d'archive</h1></center>
- <h1>Archive</h1>
- <xsl:call-template name="informations.archive"><xsl:with-param name="manifeste" select="."/></xsl:call-template>
- <xsl:call-template name="information.archive.import"><xsl:with-param name="import" select="n:resultatimport"/></xsl:call-template>
-
- <h1>Documents présents dans l'archive</h1>
- <table>
- <thead>
- <tr>
- <th>Document</th>
- <th>Type</th>
- <th>Poste comptable</th>
- <th>Collectivité Budget</th>
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="n:volumes/n:volume/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='no'">
- <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: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><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>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
- <xsl:for-each select="n:volumes/n:volume/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="informations.archive">
- <xsl:param name="manifeste"/>
- <h3>Informatons de l'archive</h3>
- <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">Archive validée le</td>
- <td><xsl:value-of select="format-dateTime($manifeste/@dateValidation,'[D01]/[M01]/[Y] [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"/>
- <h3>Informatons sur l'import de l'archive</h3>
- <table width="95%">
- <tbody>
- <tr>
- <td class="libelle">Date de réception</td>
- <td><xsl:value-of select="format-dateTime($import/@LastModify,'[D01]/[M01]/[Y] [H01]:[m01]:[s01]')"/></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]/[Y] [H01]:[m01]:[s01]')"/></td>
- <td class="libelle">Fin d'import</td>
- <td><xsl:value-of select="format-dateTime($import/@Fin,'[D01]/[M01]/[Y] [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>
- <table width="95%">
- <colgroup>
- <col width="25%"/>
- <col width="25%"/>
- <col width="25%"/>
- <col width="25%"/>
- </colgroup>
- <tbody>
- <tr>
- <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>
- </tr>
- <tr>
- <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>
- </tr>
- <tr>
- <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>
- </tr>
- </tbody>
- </table>
- </xsl:template>
-
- <xsl:template name="informations.document.import">
- <xsl:param name="import"/>
- <xsl:param name="document"/>
-
- <table width="95%">
- <caption><h3>Informatons 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>