Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <tr>
- <td><xsl:value-of select="concat($name,' ',$surname)" /></td>
- <xsl:variable name="datesMois">
- <xsl:call-template name="dayOfMonth">
- <xsl:with-param name="pDay" select="1" />
- <xsl:with-param name="pMonth" select="$query/@month" />
- <xsl:with-param name="pYear" select="$query/@year" />
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="hours">
- <xsl:for-each select="tokenize($datesMois,',')">
- <xsl:variable name="dateJour" select="." />
- <xsl:variable name="jourSemaine" select="functx:day-of-week($dateJour)" />
- <xsl:variable name="zero" select="0" />
- <xsl:if test="not($dateJour='')">
- <xsl:choose>
- <xsl:when test="$event[substring-before(start/datetime, 'T')=$dateJour]">
- <xsl:variable name="total">
- <xsl:call-template name="sum">
- <xsl:with-param name="events"
- select="$event[substring-before(start/datetime,'T')=$dateJour and substring-before(start/datetime,'T')=substring-before(end/datetime,'T')
- and upper-case(summary)=$query/customer/task/@code]" />
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$total > 0">
- <xsl:choose>
- <xsl:when test="$jourSemaine=6 or $jourSemaine=0 or $dateJour=$query/bank-holiday/@date">
- <td style="text-align:right; background-color:#D3D3D3;"><xsl:value-of select="$total" /></td>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="number($total) > number($query/parameter[@name='work-hour-max']/@value) or number($total) < number($query/parameter[@name='work-hour-min']/@value)">
- <td style="text-align:right; color:red;"><xsl:value-of select="$total" /></td>
- </xsl:when>
- <xsl:otherwise>
- <td style="text-align:right;"><xsl:value-of select="$total" /></td>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$jourSemaine=6 or $jourSemaine=0 or $dateJour=$query/bank-holiday/@date">
- <td style="text-align:right; background-color:#D3D3D3; color:#D3D3D3;"><xsl:value-of select="$zero" /></td>
- </xsl:when>
- <xsl:otherwise>
- <td style="text-align:right; color:red;"><xsl:value-of select="$zero" /></td>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$jourSemaine=6 or $jourSemaine=0 or $dateJour=$query/bank-holiday/@date">
- <td style="text-align:right; background-color:#D3D3D3; color:#D3D3D3;"><xsl:value-of select="$zero" /></td>
- </xsl:when>
- <xsl:otherwise>
- <td style="text-align:right; color:red;"><xsl:value-of select="$zero" /></td>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <td style="text-align:right;"><xsl:value-of select="sum($hours/td)" /></td>
- </tr>
Advertisement
Add Comment
Please, Sign In to add comment