/usr/share/planner/stylesheets/planner2html.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 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | <?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)
-->
<!-- ********************************************************************* -->
<!-- Output settings -->
<xsl:output
method="xml"
encoding="utf-8"
indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
/>
<!-- ********************************************************************* -->
<!-- Global variables -->
<!-- Indentation-level in pixels for hierarchical tasks -->
<xsl:variable name="task-indent-pixels" select="18"/>
<!-- CSS file to be included in XHTML output -->
<xsl:variable name="css-stylesheet-local" select="'html1_css.xsl'"/>
<xsl:variable name="css-stylesheet-local-ie" select="'html1_css_ie.xsl'"/>
<xsl:variable name="css-stylesheet-local-ie7" select="'html1_css_ie7.xsl'"/>
<!-- Current date/time at UTC/GMT -->
<xsl:variable name="datetime-utc">
<xsl:variable name="lt" select="date:date-time ()"/>
<xsl:variable name="secs" select="date:seconds ()"/>
<xsl:variable name="tz">
<xsl:choose>
<!-- UTC -->
<xsl:when test="substring ($lt, 20, 1) = 'Z'">
0
</xsl:when>
<!-- East of UTC -->
<xsl:when test="substring ($lt, 20, 1) = '+'">
<xsl:value-of select="concat('-', (3600*substring ($lt, 21, 2))+
(60*substring ($lt, 24,2)))"/>
</xsl:when>
<!-- West of UTC -->
<xsl:otherwise>
<xsl:value-of select="(3600*substring ($lt, 21, 2))+
(60*substring ($lt, 24,2))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="date:add ($lt, date:duration (2 * $tz))"/>
</xsl:variable>
<xsl:variable name="projstart">
<xsl:call-template name="mrproj-parse-date">
<xsl:with-param name="thedate" select="//project/@project-start"/>
</xsl:call-template>
</xsl:variable>
<!-- Determine project length in seconds -->
<xsl:variable name="projlength">
<xsl:choose>
<xsl:when test="//project//task">
<xsl:for-each select="//project//task">
<xsl:sort data-type="number"
select="date:seconds(date:add (date:date (concat (substring (@end, 1, 4),
'-', substring (@end, 5, 2),
'-', substring (@end, 7, 2))),
date:duration ((3600 * substring (@end, 10, 2))+
(60 * substring (@end, 12, 2))+
substring (@end, 14, 2))))"
order="descending"/>
<xsl:if test="position()=1">
<xsl:copy-of
select="-(date:seconds ($projstart) - date:seconds (
date:add (date:date (concat (substring (@end, 1, 4),
'-', substring (@end, 5, 2),
'-', substring (@end, 7, 2))),
date:duration ((3600 * substring (@end, 10, 2))+
(60 * substring (@end, 12, 2))+
substring (@end, 14, 2)))))"/>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="projend" select="date:add($projstart, date:duration($projlength))"/>
<!-- ********************************************************************* -->
<!-- Include the actual templates -->
<xsl:include href="html1_tasks.xsl"/>
<xsl:include href="html1_resources.xsl"/>
<xsl:include href="html1_gantt.xsl"/>
<!-- ********************************************************************* -->
<!-- Common templates/functions -->
<!-- Parse a date into an EXSLT date:date -->
<xsl:template name="mrproj-parse-date">
<xsl:param name="thedate"/>
<xsl:variable name="formatted" select="concat(substring($thedate, 1, 4),
'-', substring($thedate, 5, 2), '-', substring($thedate, 7, 2),
substring($thedate, 9, 3), ':', substring($thedate, 12, 2), ':',
substring($thedate, 14, 3))"/>
<xsl:value-of select="date:add($formatted, date:duration(0))"/>
</xsl:template>
<!-- Present a date:duration in human readable form -->
<xsl:template name="mrproj-duration">
<xsl:param name="duration-in-seconds"/>
<xsl:variable name="days" select="floor($duration-in-seconds div 28800)"/>
<xsl:variable name="hours" select="floor(($duration-in-seconds mod 28800) div 3600)"/>
<xsl:if test="$days != '0'">
<xsl:value-of select="$days"/>
<xsl:text>d </xsl:text>
</xsl:if>
<xsl:if test="$hours != '0'">
<xsl:value-of select="$hours"/>
<xsl:text>h </xsl:text>
</xsl:if>
</xsl:template>
<!-- List the resources along with their assigned units if not 100 -->
<xsl:template name="mrproj-assigned-resources">
<xsl:param name="task-id"/>
<xsl:for-each select="/project/allocations/allocation[@task-id=$task-id]">
<xsl:sort data-type="number" select="@resource-id" order="ascending"/>
<xsl:variable name="resource-id" select="@resource-id"/>
<!-- Use the short name of a resource unless it's empty -->
<xsl:choose>
<xsl:when test="/project/resources/resource[@id=$resource-id]/@short-name = ''">
<xsl:value-of select="/project/resources/resource[@id=$resource-id]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/project/resources/resource[@id=$resource-id]/@short-name"/>
</xsl:otherwise>
</xsl:choose>
<!-- Create a tag displaying the number of units this resource spends on this task if it is not 100 -->
<xsl:variable name="units" select="/project/allocations/allocation[@resource-id=$resource-id and @task-id=$task-id]/@units"/>
<xsl:if test="$units != 100">[<xsl:value-of select="$units"/>]</xsl:if>
<xsl:if test="not(position() = last())">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- ********************************************************************* -->
<!-- XHTML page header -->
<xsl:template name="htmlhead">
<xsl:param name='title'/>
<head>
<xsl:comment>
This file is generated from xml source: DO NOT EDIT
</xsl:comment>
<title><xsl:value-of select="$title"/> - Planner</title>
<meta name="GENERATOR" content="Planner HTML output"/>
<style type="text/css">
<xsl:value-of select="document($css-stylesheet-local)"/>
</style>
<xsl:comment>
<xsl:text>[if IE]><style type="text/css"></xsl:text>
<xsl:value-of select="document($css-stylesheet-local-ie)"/>
<xsl:text></style><![endif]</xsl:text>
</xsl:comment>
<xsl:comment>
<xsl:text>[if gte IE 7]><style type="text/css"></xsl:text>
<xsl:value-of select="document($css-stylesheet-local-ie7)"/>
<xsl:text></style><![endif]</xsl:text>
</xsl:comment>
</head>
</xsl:template>
<!-- ********************************************************************* -->
<!-- Footer -->
<xsl:template name="htmlfooter">
<div class="footer">
<div>
<xsl:value-of select="I18N:gettext('This file was generated by')"/>
<a href="http://live.gnome.org/Planner/" style="text-decoration: underline;">Planner</a>
</div>
</div>
</xsl:template>
<xsl:template name="property">
<xsl:if test="@value!=''">
<div class="property">
<span class="property-name"><xsl:value-of select="@name"/></span>:
<span class="property-value"><xsl:value-of select="@value"/></span>
</div>
</xsl:if>
</xsl:template>
<!-- ********************************************************************* -->
<!-- Main Template -->
<xsl:template match="project">
<!-- Project start date -->
<xsl:variable name="projstartdate">
<xsl:call-template name="mrproj-parse-date">
<xsl:with-param name="thedate" select="@project-start"/>
</xsl:call-template>
</xsl:variable>
<html>
<xsl:call-template name="htmlhead">
<xsl:with-param name="title"><xsl:value-of select="@name"/></xsl:with-param>
</xsl:call-template>
<body>
<h1 class="proj-title">
<a name="project">
<xsl:choose>
<xsl:when test="@name != ''">
<xsl:value-of select="@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="I18N:gettext('Unnamed Project')"/>
</xsl:otherwise>
</xsl:choose>
</a>
</h1>
<table class="proj-header">
<xsl:if test="@company != ''">
<tr>
<td class="header"><xsl:value-of select="I18N:gettext('Company:')"/></td>
<td>
<xsl:value-of select="@company"/>
</td>
</tr>
</xsl:if>
<xsl:if test="@manager != ''">
<tr>
<td class="header"><xsl:value-of select="I18N:gettext('Manager:')"/></td>
<td>
<xsl:value-of select="@manager"/>
</td>
</tr>
</xsl:if>
<tr>
<td class="header"><xsl:value-of select="I18N:gettext('Start:')"/></td>
<td>
<xsl:value-of select="I18N:getdate(date:seconds($projstart))"/>
</td>
</tr>
<tr>
<td class="header"><xsl:value-of select="I18N:gettext('Finish:')"/></td>
<td>
<xsl:value-of select="I18N:getdate(date:seconds($projend))"/>
</td>
</tr>
<!--tr>
<td class="header">Duration:</td>
<td>
<xsl:value-of select="floor($projlength div 86400)"/>d
<xsl:value-of select="floor($projlength div 3600) mod 24"/>h
</td>
</tr-->
<xsl:if test="@phase != ''">
<tr>
<td class="header"><xsl:value-of select="I18N:gettext('Phase:')"/></td>
<td>
<xsl:value-of select="@phase"/>
</td>
</tr>
</xsl:if>
<xsl:for-each select="properties/property[@owner='project']">
<tr>
<td class="header"><xsl:value-of select="@label"/><xsl:text>:</xsl:text></td>
<td>
<xsl:variable name="name" select="@name"/>
<xsl:choose>
<xsl:when test="@type='float'">
<xsl:value-of select="format-number(/project/properties/property[@name=$name]/@value, '.####')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/project/properties/property[@name=$name]/@value"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<tr>
<td class="header"><xsl:value-of select="I18N:gettext('Report Date:')"/></td>
<td>
<xsl:value-of select="I18N:getdate(date:seconds(date:date()))"/>
</td>
</tr>
</table>
<div class="separator"/>
<!-- Defined in html1_gantt.xsl -->
<xsl:call-template name="gantt"/>
<div class="separator"/>
<!-- Defined in html1_tasks.xsl -->
<xsl:apply-templates select="tasks"/>
<div class="separator"/>
<!-- Defined in html1_resources.xsl -->
<xsl:apply-templates select="resources"/>
<xsl:call-template name="htmlfooter"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
|