raks13

Untitled

Feb 28th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.01 KB | None | 0 0
  1. <tr>
  2.     <td><xsl:value-of select="concat($name,' ',$surname)" /></td>
  3.     <xsl:variable name="datesMois">
  4.         <xsl:call-template name="dayOfMonth">
  5.             <xsl:with-param name="pDay" select="1" />
  6.             <xsl:with-param name="pMonth" select="$query/@month" />
  7.             <xsl:with-param name="pYear" select="$query/@year" />          
  8.         </xsl:call-template>
  9.     </xsl:variable>
  10.     <xsl:variable name="hours">
  11.         <xsl:for-each select="tokenize($datesMois,',')">
  12.             <xsl:variable name="dateJour" select="." />
  13.             <xsl:variable name="jourSemaine" select="functx:day-of-week($dateJour)" />
  14.             <xsl:variable name="zero" select="0" />
  15.             <xsl:if test="not($dateJour='')">
  16.                 <xsl:choose>
  17.                     <xsl:when test="$event[substring-before(start/datetime, 'T')=$dateJour]">
  18.                         <xsl:variable name="total">
  19.                             <xsl:call-template name="sum">
  20.                                 <xsl:with-param name="events"
  21.                                     select="$event[substring-before(start/datetime,'T')=$dateJour and substring-before(start/datetime,'T')=substring-before(end/datetime,'T')
  22. and upper-case(summary)=$query/customer/task/@code]" />
  23.                             </xsl:call-template>
  24.                         </xsl:variable>
  25.                         <xsl:choose>
  26.                             <xsl:when test="$total &gt; 0">
  27.                             <xsl:choose>                                           
  28.                                 <xsl:when test="$jourSemaine=6 or $jourSemaine=0 or $dateJour=$query/bank-holiday/@date">
  29.                                 <td style="text-align:right; background-color:#D3D3D3;"><xsl:value-of select="$total" /></td>
  30.                             </xsl:when>
  31.                             <xsl:otherwise>
  32.                                 <xsl:choose>
  33.                                     <xsl:when test="number($total) &gt; number($query/parameter[@name='work-hour-max']/@value) or number($total) &lt; number($query/parameter[@name='work-hour-min']/@value)">
  34.                                 <td style="text-align:right; color:red;"><xsl:value-of select="$total" /></td>
  35.                                     </xsl:when>
  36.                                     <xsl:otherwise>
  37.                                         <td style="text-align:right;"><xsl:value-of select="$total" /></td>
  38.                                     </xsl:otherwise>
  39.                                 </xsl:choose>
  40.                             </xsl:otherwise>
  41.                         </xsl:choose>  
  42.                     </xsl:when>
  43.                     <xsl:otherwise>
  44.                         <xsl:choose>                                           
  45.                             <xsl:when test="$jourSemaine=6 or $jourSemaine=0 or $dateJour=$query/bank-holiday/@date">
  46.                             <td style="text-align:right; background-color:#D3D3D3; color:#D3D3D3;"><xsl:value-of select="$zero" /></td>
  47.                             </xsl:when>
  48.                             <xsl:otherwise>
  49.                                 <td style="text-align:right; color:red;"><xsl:value-of select="$zero" /></td>
  50.                             </xsl:otherwise>
  51.                         </xsl:choose>
  52.                     </xsl:otherwise>
  53.                 </xsl:choose>
  54.             </xsl:when>
  55.             <xsl:otherwise>
  56.                 <xsl:choose>                                           
  57.                     <xsl:when test="$jourSemaine=6 or $jourSemaine=0 or $dateJour=$query/bank-holiday/@date">
  58.                         <td style="text-align:right; background-color:#D3D3D3; color:#D3D3D3;"><xsl:value-of select="$zero" /></td>
  59.                     </xsl:when>
  60.                     <xsl:otherwise>
  61.                         <td style="text-align:right; color:red;"><xsl:value-of select="$zero" /></td>
  62.                     </xsl:otherwise>
  63.                 </xsl:choose>
  64.             </xsl:otherwise>
  65.         </xsl:choose>
  66.     </xsl:if>
  67. </xsl:for-each>
  68. </xsl:variable>
  69. <td style="text-align:right;"><xsl:value-of select="sum($hours/td)" /></td>
  70. </tr>
Advertisement
Add Comment
Please, Sign In to add comment