<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:import href="include/variables.xsl"/>
<xsl:import href="include/copyright.xsl"/>
<xsl:import href="include/login.xsl"/>
<xsl:import href="include/head.xsl"/>
<xsl:import href="include/menu.xsl"/>
<xsl:import href="include/banner.xsl"/>
<xsl:template match="/" xmlns="http://www.w3.org/1999/xhtml">
<html>
<xsl:call-template name="head"/>
<body>
<center>
<form action="/?page=P_HOME" method="post" onsubmit="submitForm();">
<input type="hidden" name="chp:wk" id="chp:wk"/>
<input type="hidden" name="chp:emp" id="chp:emp"/>
<xsl:call-template name="banner"/>
<div id="top">
<h1>
<xsl:value-of select="page/title"/>
</h1>
<xsl:call-template name="login"/>
</div>
<xsl:call-template name="menu"/>
<div id="content">
<xsl:value-of select="void"/>
<xsl:apply-templates select="/page/login/line/calendrier"/>
</div>
<xsl:call-template name="copyright"/>
</form>
</center>
</body>
</html>
</xsl:template>
<xsl:template match="calendrier" xmlns="http://www.w3.org/1999/xhtml">
<xsl:choose>
<xsl:when test="/page/login/line/rights = 1">
<fieldset>
<legend>Choisissez un mois :</legend>
<input type="hidden" id="hAnnee" value="{/page/parameters/parameter[@name = 'chp:annee']/@value}"/>
<input type="hidden" id="hMois" value="{/page/parameters/parameter[@name = 'chp:mois']/@value}"/>
Année <select name="chp:annee" id="fAnnee"><xsl:value-of select="void"/></select> Mois <select name="chp:mois" id="fMois"><xsl:value-of select="void"/></select>
<div id="navPlaceHolder"><xsl:value-of select="void"/></div>
</fieldset>
<br/>
<br/>
<table border="1" style="empty-cells: show;">
<tr>
<th colspan="2"><xsl:value-of select="line/nm"/> <xsl:value-of select="line/yyyy"/></th>
<xsl:for-each select="../employe/line">
<th>
<xsl:value-of select="nom"/>
</th>
</xsl:for-each>
</tr>
<xsl:for-each select="line">
<xsl:variable name="currentDate"><xsl:copy-of select="."/></xsl:variable>
<tr onmouseover="this.oldBg = this.style.backgroundColor; this.style.backgroundColor = '#eeeeee';" onmouseout="this.style.backgroundColor = this.oldBg;">
<xsl:if test="dw = 6 or dw = 7">
<xsl:attribute name="style">background-color: #ffcccc;</xsl:attribute>
</xsl:if>
<xsl:if test="dw = 1 or position() = 1">
<td>
<xsl:choose>
<xsl:when test="dw = 1 and position() + 7 <= count(../line)">
<xsl:attribute name="rowspan">7</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="position() + 7 > count(../line)">
<xsl:attribute name="rowspan"><xsl:value-of select="(count(../line) + 1) - position()"/></xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="dw > 1">
<xsl:attribute name="rowspan"><xsl:value-of select="8 - dw"/></xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:value-of select="wk"/>
</td>
</xsl:if>
<td>
<xsl:value-of select="ndw"/> <xsl:value-of select="d"/>
</td>
<xsl:for-each select="../../employe/line">
<xsl:variable name="emp"><xsl:value-of select="id"/></xsl:variable>
<td onclick="ShowWeek('{msxsl:node-set($currentDate)/line/wk}', '{id}');">
<xsl:for-each select="../../affectation/line">
<xsl:variable name="dte">
<xsl:value-of select="concat(substring(msxsl:node-set($currentDate)/line/dte, 1, 4), substring(msxsl:node-set($currentDate)/line/dte, 6, 2), substring(msxsl:node-set($currentDate)/line/dte, 9, 2))"/>
</xsl:variable>
<xsl:variable name="datdeb">
<xsl:value-of select="concat(substring(datdeb, 1, 4), substring(datdeb, 6, 2), substring(datdeb, 9, 2))"/>
</xsl:variable>
<xsl:variable name="datfin">
<xsl:value-of select="concat(substring(datfin, 1, 4), substring(datfin, 6, 2), substring(datfin, 9, 2))"/>
</xsl:variable>
<xsl:if test="employe_id = $emp and $datdeb <= $dte and $datfin >= $dte and not ((msxsl:node-set($currentDate)/line/dw = 6 or msxsl:node-set($currentDate)/line/dw = 7) and we = 'N')">
<xsl:variable name="aff"><xsl:copy-of select="."/></xsl:variable>
<xsl:for-each select="../../projets/line">
<xsl:if test="pid = msxsl:node-set($aff)/line/projet_id">
<div style="width: 15px; height: 15px; background-color: {couleur}; float: left;" onmouseover="showToolTip('toolTip', '{cnom}', '{pnom}', '{msxsl:node-set($aff)/line/commentaires}');" onmouseout="hideToolTip('toolTip');">
<xsl:value-of select="void"/>
</div>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
<div id="toolTip" style="display: none; position: absolute; background-color: #ffffcc;"><xsl:value-of select="void"/></div>
</xsl:when>
<xsl:when test="/page/login/line/rights = 2">
<input type="hidden" id="hAnnee" value="{/page/parameters/parameter[@name = 'chp:annee']/@value}"/>
<input type="hidden" id="hMois" value="{/page/parameters/parameter[@name = 'chp:mois']/@value}"/>
Choisissez un mois :<br/>
Année <select name="chp:annee" id="fAnnee">
<xsl:value-of select="void"/>
</select> Mois <select name="chp:mois" id="fMois">
<xsl:value-of select="void"/>
</select>
<div id="navPlaceHolder">
<xsl:value-of select="void"/>
</div>
<br/>
<br/>
<table border="1" style="empty-cells: show;">
<tr>
<th colspan="2">
<xsl:value-of select="line/nm"/> <xsl:value-of select="line/yyyy"/>
</th>
<xsl:for-each select="../employe/line">
<th>
<xsl:value-of select="nom"/>
</th>
</xsl:for-each>
</tr>
<xsl:for-each select="line">
<xsl:variable name="currentDate">
<xsl:copy-of select="."/>
</xsl:variable>
<tr onmouseover="this.oldBg = this.style.backgroundColor; this.style.backgroundColor = '#eeeeee';" onmouseout="this.style.backgroundColor = this.oldBg;">
<xsl:if test="dw = 6 or dw = 7">
<xsl:attribute name="style">background-color: #ffcccc;</xsl:attribute>
</xsl:if>
<xsl:if test="dw = 1 or position() = 1">
<td>
<xsl:choose>
<xsl:when test="dw = 1 and position() + 7 <= count(../line)">
<xsl:attribute name="rowspan">7</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="position() + 7 > count(../line)">
<xsl:attribute name="rowspan">
<xsl:value-of select="(count(../line) + 1) - position()"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="dw > 1">
<xsl:attribute name="rowspan">
<xsl:value-of select="8 - dw"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:value-of select="wk"/>
</td>
</xsl:if>
<td>
<xsl:value-of select="ndw"/> <xsl:value-of select="d"/>
</td>
<xsl:for-each select="../../employe/line">
<xsl:variable name="emp">
<xsl:value-of select="id"/>
</xsl:variable>
<td>
<xsl:for-each select="../../affectation/line">
<xsl:variable name="dte">
<xsl:value-of select="concat(substring(msxsl:node-set($currentDate)/line/dte, 1, 4), substring(msxsl:node-set($currentDate)/line/dte, 6, 2), substring(msxsl:node-set($currentDate)/line/dte, 9, 2))"/>
</xsl:variable>
<xsl:variable name="datdeb">
<xsl:value-of select="concat(substring(datdeb, 1, 4), substring(datdeb, 6, 2), substring(datdeb, 9, 2))"/>
</xsl:variable>
<xsl:variable name="datfin">
<xsl:value-of select="concat(substring(datfin, 1, 4), substring(datfin, 6, 2), substring(datfin, 9, 2))"/>
</xsl:variable>
<xsl:if test="employe_id = $emp and $datdeb <= $dte and $datfin >= $dte and not ((msxsl:node-set($currentDate)/line/dw = 6 or msxsl:node-set($currentDate)/line/dw = 7) and we = 'N')">
<xsl:variable name="aff">
<xsl:copy-of select="."/>
</xsl:variable>
<xsl:for-each select="../../projets/line">
<xsl:if test="pid = msxsl:node-set($aff)/line/projet_id">
<div style="width: 15px; height: 15px; background-color: {couleur}; float: left;" onmouseover="showToolTip('toolTip', '{cnom}', '{pnom}', '{msxsl:node-set($aff)/line/commentaires}');" onmouseout="hideToolTip('toolTip');">
<xsl:value-of select="void"/>
</div>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
<div id="toolTip" style="display: none; position: absolute; background-color: #ffffcc;">
<xsl:value-of select="void"/>
</div>
</xsl:when>
<xsl:otherwise>
Non supporté
<br/>
<br/>
<a href="mailto:administrator@manga-torii.com">Rapportez ce bug</a>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
|