1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:fo="http://www.w3.org/1999/XSL/Format">
6 <xsl:import href="custom_default.xsl"/>
7 <xsl:import href="custom_rml.xsl"/>
9 <xsl:template match="/">
10 <xsl:call-template name="rml"/>
13 <xsl:template name="stylesheet">
14 <paraStyle name="normal" fontName="Helvetica" fontSize="6" alignment="left" />
15 <paraStyle name="normal-title" fontName="Helvetica" fontSize="6" />
16 <paraStyle name="title" fontName="Helvetica" fontSize="18" alignment="center" />
17 <paraStyle name="employee" fontName="Helvetica-Oblique" fontSize="10" textColor="blue" />
18 <paraStyle name="glande" textColor="red" fontSize="7" fontName="Helvetica"/>
19 <paraStyle name="normal_people" textColor="green" fontSize="7" fontName="Helvetica"/>
20 <paraStyle name="esclave" textColor="purple" fontSize="7" fontName="Helvetica"/>
21 <blockTableStyle id="month">
22 <blockAlignment value="CENTER" start="1,0" stop="-1,-1" />
23 <blockFont name="Helvetica" size="8" start="0,0" stop="-1,1"/>
24 <blockFont name="Helvetica" size="6" start="0,2" stop="-2,-2"/>
25 <blockFont name="Helvetica-BoldOblique" size="8" start="0,-1" stop="-1,-1"/>
26 <blockBackground colorName="#AAAAAA" start="1,0" stop="-2,1"/>
27 <xsl:for-each select="/report/days/day[@weekday=6 or @weekday=7]">
28 <xsl:variable name="col" select="attribute::number" />
30 <xsl:attribute name="colorName">lightgrey</xsl:attribute>
31 <xsl:attribute name="start">
32 <xsl:value-of select="$col" />
33 <xsl:text>,0</xsl:text>
35 <xsl:attribute name="stop">
36 <xsl:value-of select="$col" />
37 <xsl:text>,-1</xsl:text>
41 <lineStyle kind="LINEABOVE" colorName="black" start="0,0" stop="-1,-1" />
42 <lineStyle kind="LINEBEFORE" colorName="black" start="0,0" stop="-1,-1"/>
43 <lineStyle kind="LINEAFTER" colorName="black" start="-1,0" stop="-1,-1"/>
44 <lineStyle kind="LINEBELOW" colorName="black" start="0,-1" stop="-1,-1"/>
45 <blockValign value="TOP"/>
49 <xsl:template name="story">
50 <spacer length="1cm" />
51 <para style="title" t="1">Timesheet</para>
52 <spacer length="1cm" />
53 <para style="employee"><xsl:value-of select="/report/employee" /></para>
54 <spacer length="1cm" />
56 <xsl:attribute name="style">month</xsl:attribute>
57 <xsl:attribute name="colWidths"><xsl:value-of select="report/cols" /></xsl:attribute>
59 <td><xsl:value-of select="report/date/attribute::year" /></td>
60 <xsl:for-each select="report/days/day">
62 <xsl:value-of select="attribute::name" />
68 <td><xsl:value-of select="report/date/attribute::month" /></td>
69 <xsl:for-each select="report/days/day">
71 <xsl:value-of select="attribute::number" />
76 <xsl:apply-templates select="report/account"/>
79 <xsl:for-each select="report/days/day">
80 <xsl:variable name="today" select="attribute::number" />
84 <xsl:when test="sum(//time-element[@date=$today]) < 7.5">
85 <xsl:attribute name="style">glande</xsl:attribute>
87 <xsl:when test="sum(//time-element[@date=$today]) < 8.5 and sum(//time-element[@date=$today]) >= 7.5">
88 <xsl:attribute name="style">normal_people</xsl:attribute>
91 <xsl:attribute name="style">esclave</xsl:attribute>
94 <xsl:value-of select="format-number(sum(//time-element[@date=$today]),'##.##')" />
99 <xsl:value-of select="format-number(sum(//time-element),'##.##')" />
105 <xsl:template match="account">
106 <xsl:variable name="aid" select="attribute::id" />
110 <para style="normal-title"><xsl:value-of select="attribute::name" /></para>
112 <xsl:for-each select="/report/days/day">
113 <xsl:variable name="today" select="attribute::number" />
115 <para style="normal"><xsl:value-of select="//account[@id=$aid]/time-element[@date=$today]" /></para>
119 <para style="normal"><xsl:value-of select="format-number(sum(//account[@id=$aid]/time-element),'##.##')" /></para>