/usr/share/planner/stylesheets/html1_tasks.xsl is in planner-data 0.14.6-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | <?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:I18N="http://www.gnu.org/software/gettext/" extension-element-prefixes="I18N">
<!--
Copyright (C) 2004-2005 Imendio AB
Copyright (c) 2003 Daniel Lundin
Copyright (c) 2003 CodeFactory AB
Copyright (c) 2004 Chris Ladd (caladd@particlestorm.net)
-->
<xsl:template name="calculate-cost">
<xsl:param name="std-rates"/>
<xsl:param name="units"/>
<xsl:param name="level"/>
<xsl:param name="work"/>
<xsl:choose>
<xsl:when test="$level = 0">0</xsl:when>
<xsl:otherwise>
<xsl:variable name="cost">
<xsl:call-template name="calculate-cost">
<xsl:with-param name="std-rates" select="$std-rates"/>
<xsl:with-param name="units" select="$units"/>
<xsl:with-param name="level" select="$level - 1"/>
<xsl:with-param name="work" select="$work"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="std-rate" select="$std-rates[position()=$level]"/>
<xsl:variable name="unit" select="$units[position()=$level] div 100"/>
<xsl:variable name="totalunits" select="sum($units) div 100"/>
<xsl:value-of select="($std-rate * $unit * $work) div $totalunits + $cost"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="tasks">
<xsl:variable name="hasproperties" select="boolean (count(//task/properties/property[@value!='']))"/>
<xsl:variable name="hasnotes" select="boolean (count(//task[@note!='']))"/>
<div class="tasklist">
<h2><a name="tasks"><xsl:value-of select="I18N:gettext('Tasks')"/></a></h2>
<div class="tasklist-table">
<table cellspacing="0" cellpadding="0" border="1">
<tr class="header" align="left">
<th><span><xsl:value-of select="I18N:gettext('WBS')"/></span></th>
<th><span><xsl:value-of select="I18N:gettext('Name')"/></span></th>
<th><span><xsl:value-of select="I18N:gettext('Start')"/></span></th>
<th><span><xsl:value-of select="I18N:gettext('Finish')"/></span></th>
<th><span><xsl:value-of select="I18N:gettext('Work')"/></span></th>
<th><span><xsl:value-of select="I18N:gettext('Complete')"/></span></th>
<th><span><xsl:value-of select="I18N:gettext('Cost')"/></span></th>
<th><span><xsl:value-of select="I18N:gettext('Assigned to')"/></span></th>
<xsl:if test="$hasnotes">
<th class="note"><span>Notes</span></th>
</xsl:if>
</tr>
<xsl:for-each select="//task">
<xsl:sort data-type="number"
select="date:seconds (date:add (concat (substring (@end, 1, 4),'-',
substring (@end, 5, 2),'-',
substring (@end, 7, 2)),
date:duration (substring (@end, 10))))"
order="descending"/>
<xsl:variable name="tid" select="@id"/>
<!-- Make a proper XSL date value from the start-date attribute -->
<xsl:variable name="start_date">
<xsl:call-template name="mrproj-parse-date">
<xsl:with-param name="thedate" select="@work-start"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="end_date">
<xsl:call-template name="mrproj-parse-date">
<xsl:with-param name="thedate" select="@end"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="indent" select="count (ancestor::task)"/>
<xsl:variable name="tname">
</xsl:variable>
<xsl:variable name="rowclass">
<xsl:choose>
<xsl:when test="(position() mod 2) = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="rowstyle">
<xsl:if test="task">
font-weight: bold;
</xsl:if>
</xsl:variable>
<tr class="{$rowclass}" style="{$rowstyle}">
<td>
<span>
<xsl:for-each select="ancestor-or-self::task">
<xsl:value-of select="count(preceding-sibling::task) + 1"/>
<xsl:if test="not(position() = last())">
<xsl:text>.</xsl:text>
</xsl:if>
</xsl:for-each>
</span>
</td>
<td>
<a name="task{@id}" style="margin-left: {$indent*$task-indent-pixels}px">
<span>
<xsl:value-of select="@name"/>
</span>
</a>
</td>
<td>
<span>
<xsl:value-of select="date:month-abbreviation($start_date)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="date:day-in-month($start_date)"/>
</span>
</td>
<td>
<span>
<xsl:value-of select="date:month-abbreviation($end_date)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="date:day-in-month($end_date)"/>
</span>
</td>
<td>
<xsl:if test="@type!='milestone'">
<span>
<xsl:call-template name="mrproj-duration">
<xsl:with-param name="duration-in-seconds" select="@work"/>
</xsl:call-template>
</span>
</xsl:if>
</td>
<td>
<!-- if the task has no children and isn't a milestone -->
<xsl:if test="not(task) and @type!='milestone'">
<span>
<xsl:value-of select="@percent-complete"/>%
</span>
</xsl:if>
</td>
<td>
<span>
<xsl:variable name="std-rates" select="/project/resources/resource[@id=/project/allocations/allocation[@task-id=$tid]/@resource-id]/@std-rate"/>
<xsl:variable name="units" select="/project/allocations/allocation[@task-id=$tid]/@units"/>
<xsl:variable name="cost">
<xsl:call-template name="calculate-cost">
<xsl:with-param name="std-rates" select="$std-rates"/>
<xsl:with-param name="units" select="$units"/>
<xsl:with-param name="level" select="count($std-rates)"/>
<xsl:with-param name="work" select="@work div 3600"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not($cost = 0)">
<xsl:value-of select="format-number($cost, '###,###,###,###.##')"/>
</xsl:if>
</span>
</td>
<td>
<xsl:call-template name="mrproj-assigned-resources">
<xsl:with-param name="task-id" select="$tid"/>
</xsl:call-template>
</td>
<xsl:if test="$hasnotes">
<td class="note">
<span>
<xsl:value-of select="@note"/>
</span>
</td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</div>
</div>
</xsl:template>
</xsl:stylesheet>
|