Re: [Planner Dev] Reporting Actual Effort in the Tasks Page



Attached is my quick hack to the planner stylesheets.
I couldn't work out how to sum() only leaf task nodes within one stylesheet, so I strung a number of stylesheets together.
You can execute the stylesheets using the following:

xsltproc evm1.xsl schedule.mrproject > x.xml ; xsltproc evm2.xsl x.xml > y.xml ; xsltproc mrproject2html.xsl y.xml > schedule.html

If you have a look at schedule.html (attached) you will see I've added columns for Work Completed, Earned Value = Cost Completed, Earned Value % (EV as a percentage).

I've also fixed a bug where the "Cost" column was being calculated incorrectly. (This bug might be fixed in v13, I was using v11 as my source).

Richard Hult wrote:

Cameron Shorter wrote:
Richard Hult wrote:

Cameron Shorter wrote:


I'm considering writing XSL to extract BCWS and BCWP from the MrProject
format.
I'm guessing that if I write this properly, then it could slot quite
easilly into the HTML export function.
1. If I write this would developers be interested in it?
2. Is there anything I should consider (coding standards etc) before I
start?
Hi,

I think it would be interesting to write this kind of functionality
either as a plugin or as a separate export filter. A plugin could add
menu items and have a small UI that displayed additional information,


Yes, this would be nice, although I'm not volunteering to do this.  (I
assume this means updating C code).  I can't get the head version of
planner to compile on my Mandrake 10.0 linux, and I'm not planning to
upgrade in the near future.

while an export filter would output a new file that could be used in
another external application like a spreadsheet app for example.


I assume this would be done with XSL? This is within my capabilities. Unfortunatly my time is limited so I probably won't be able to give much
more than a quick hack.

Yes, it would consist of an XSL file and a more or less copy and paste
job of the HTML export plugin (so some C hacking required).

You could always just modify the HTML XSL and post it here in case
someone else wants to turn it into a separate plugin.

We shouldn't add extra information to the HTML export, it should just be
a HTML version of the available data.

I've been playing around a bit with the ability to add a custom property
column from a plugin and calculating the cell contents from the plugin.
This might be the best way to go and it would also be usable for other
similar improvements.


Yes, this would be ideal.  What is your timeframe for implementing these
features?

I can't say anything about that since I don't have a lot of time for
Planner these days.

/Richard



--
Cameron Shorter
http://cameron.shorter.net

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">

  <!-- Add extra Earned Value Management attributes to task -->
  <xsl:template match="task">
    <xsl:copy>
      <xsl:attribute name="work-complete">
        <xsl:value-of select="@work * @percent-complete div 100"/>
      </xsl:attribute>

      <xsl:variable name="tid" select="@id"/>
      <xsl:variable name="std-rates" select="/project/resources/resource[ id=/project/allocations/allocation[ task-id=$tid]/@resource-id]/@std-rate"/>

      <xsl:if test="$std-rates">
        <!-- Budgeted Cost of Work Performed, or Earned Value -->
        <xsl:attribute name="earned-value">
          <xsl:value-of select="@work * @percent-complete * $std-rates div 360000"/>
        </xsl:attribute>

        <!-- Cost -->
        <xsl:attribute name="cost">
          <xsl:value-of select="@work * $std-rates div 3600"/>
        </xsl:attribute>
      </xsl:if>

      <!-- Set @work=0 for non-leaf <task> nodes.  This makes sum of work
           easier in next stylesheet. -->
      <xsl:if test="task">
        <xsl:attribute name="work">0</xsl:attribute>
      </xsl:if>


      <xsl:apply-templates
       select="*|@*|comment()|processing-instruction()|text()"/>
    </xsl:copy>
  </xsl:template>

  <!-- Unity transform -->
  <xsl:template 
    match="*|@*|comment()|processing-instruction()|text()">
    <xsl:copy>
      <xsl:apply-templates
       select="*|@*|comment()|processing-instruction()|text()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns="http://www.w3.org/1999/xhtml"; xmlns:date="http://exslt.org/dates-and-times"; version="1.0">
<!--**************************************************************************
    *
    * html1_tasks.xsl: Display tasks in a table with progress bars
    *
    * Copyright (c)2003 Daniel Lundin
    * Copyright (c)2003 CodeFactory AB
    * Copyright (c) 2004 Chris Ladd (caladd particlestorm net)
    *
    *-->

  <!-- Sum task attributes for node tasks -->
  <xsl:template match="task">
    <xsl:choose>
      <xsl:when test="task">
        <xsl:copy>
          <xsl:attribute name="work">
            <xsl:value-of select="sum(.//task/@work)"/>
          </xsl:attribute>
          <xsl:attribute name="work-complete">
            <xsl:value-of select="sum(.//task/@work-complete)"/>
          </xsl:attribute>
          <xsl:attribute name="cost">
            <xsl:value-of select="sum(.//task/@cost)"/>
          </xsl:attribute>
          <xsl:attribute name="earned-value">
            <xsl:value-of select="sum(.//task/@earned-value)"/>
          </xsl:attribute>
          <xsl:attribute name="percent-complete">
            <xsl:value-of select="sum(.//task/@percent-complete)"/>
          </xsl:attribute>

          <xsl:apply-templates
           select="*|@*|comment()|processing-instruction()|text()"/>
        </xsl:copy>
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy>
          <xsl:apply-templates
           select="*|@*|comment()|processing-instruction()|text()"/>
        </xsl:copy>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <!-- Unity transform -->
  <xsl:template 
    match="*|@*|comment()|processing-instruction()|text()">
    <xsl:copy>
      <xsl:apply-templates
       select="*|@*|comment()|processing-instruction()|text()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<xsl:stylesheet version="1.0"
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                  xmlns="http://www.w3.org/1999/xhtml";>
<xsl:comment>

/* 
 * CSS Stylesheet for Planner HTML output.
 * 
 * Copyright (C) 2003 CodeFactory AB
 * Copyright (C) 2003 Daniel Lundin (daniel edgewall com)
 * Copyright (C) 2004 Chris Ladd (caladd particlestorm net)
 * Copyright (C) 2004 Imendio HB
 *
 */

HTML,BODY,TABLE { 
  font-family: Vera Sans,Arial,Helvetica,sans-serif;
  font-size: 10pt;
  white-space: nowrap;
}

H1 {
  font-size: 14pt;
  font-weight: bold;
  color: #000000;
}

H2 {
  font-size: 12pt;
  font-weight: bold;
  color: #000000;
  margin-bottom: 2px;
}

A:link, A:visited, A:hover[href] { 
  color: #213559;       
  text-decoration: none;
  font-weight: bold;       
}

A:hover[href] { 
  color: #992525;
}

/*
 * Separator (decorative)
 */

DIV.separator {
  margin: 40px;
}

/*
 * Project header
 */

DIV.proj-header {
	padding: 4px;
	right: 5px;
	top: 5px;
	float: left;
	font-size: 12pt;
	margin-bottom: 20px;
}

DIV.proj-header DIV .header {
	font-size: 10pt;
	font-weight: bold;
	margin-right: 5px;
}	

DIV.proj-header DIV .value {
	font-size: 10pt;
	font-weight: normal;
}	

/*
 * Footer 
 */

.footer {
	margin-top: 50px;
	border-style: solid;
	border-width: 1px 0px 0px 0px;
	border-color: #999;
	clear: both;
}

.footer-date {
	font-size: 10pt;
	float: left;
	color: #666;
}

.footer-disclaimer {
	font-size: 10pt;
	text-align: right;
	color: #666;
}

/*
 * Gantt
 */

DIV.gantt-empty-begin,DIV.gantt-empty-end,DIV.gantt-complete-done,DIV.gantt-complete-notdone
{
  clear: none;
  float: left; 
  height: 13px;
}

DIV.gantt-complete-done {
  background-color: #495f6b;
  border-style: solid;
  border-width: 0px;
  border-color: #000000;
  vertical-align: middle;
  height: 7px;
  margin-top: 3px
}

DIV.gantt-complete-notdone {
  background-color: #8db6cd;
  border-style: solid;
  border-width: 1px;
  border-color: #000000;
}

DIV.gantt-empty-end {
  margin-left: 5px;
}

SPAN.gantt-milestone {
  font-size: 11pt;
  color: #000000;
  vertical-align: middle;
  position: relative;
  margin-left: 0px;
  padding-left: 0px;
}


TH.gantt-day-header {
  margin: 0px;
  padding: 0px;
  font-size: 8pt;
  white-space: nowrap;
}
/*
 * Table Style
 */

TABLE {
  display: table;
  border-collapse: collapse;	
  border-style: solid;
  border-width: 1px; 1px; 1px; 1px;
  border-color: #000000;
  white-space: nowrap;
  margin: 2px;
  padding: 2px;
}

TR.header {
  background-color: #aaaaaa;
  border-style: solid;
  border-width: 1px; 0px; 0px; 0px;
  color: #ffffff;
  border-color: #000000;
  font-size: 9pt;
  white-space: nowrap;
}

TR.even {
  background-color: #eeeeee;
  border-style: solid;
  border-width: 0px; 0px; 0px; 0px;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

TR.odd {
  background-color: #ffffff;
  border-style: solid;
  border-width: 0px; 0px; 0px; 0px;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

TH SPAN, TR SPAN {
  margin-left: 10px;
  margin-right: 20px;
  white-space: nowrap;
}

</xsl:comment>
</xsl:stylesheet>
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<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";>

<!--**************************************************************************
    *
    * html1_gantt.xsl: Display a simplified (but useful?) gantt chart with CSS
    *
    * Copyright (c) 2003 CodeFactory AB
    * Copyright (c) 2003 Daniel Lundin
    * Copyright (c) 2004 Chris Ladd (caladd particlestorm net)
    *
    *-->

<xsl:template name="create-week-row">
  <xsl:param name="days"/>
  <xsl:param name="date"/>
  <xsl:choose>
    <xsl:when test="date:day-in-week($date) = 2 and $days >= 7">
      <th align="center" colspan="7">
		Week <xsl:value-of select="date:week-in-year($date)"/>,
		<xsl:value-of select="date:year($date)"/>
      </th>
      <xsl:if test="not($days = 7)">
        <xsl:call-template name="create-week-row">
          <xsl:with-param name="days" select="$days - 7"/>
	      <xsl:with-param name="date" select="date:add($date, date:duration(604800))"/>
	    </xsl:call-template>
      </xsl:if>
    </xsl:when>
	<xsl:when test="not($days >= 7)">
      <th colspan="{$days}"></th>
	</xsl:when>
	<xsl:otherwise> 
      <xsl:variable name="colspan">
	    <xsl:choose>
		  <xsl:when test="date:day-in-week($date) = 1">1</xsl:when>
		  <xsl:otherwise>
		    <xsl:value-of select="9 - date:day-in-week($date)"/>
		  </xsl:otherwise>
		</xsl:choose>
	  </xsl:variable>
	  <th colspan="{$colspan}"></th>
      <xsl:if test="$days > 1">
        <xsl:call-template name="create-week-row">
          <xsl:with-param name="days" select="$days - $colspan"/>
	      <xsl:with-param name="date" select="date:add($date, date:duration(86400 * $colspan))"/>
	    </xsl:call-template>
      </xsl:if>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="create-day-row">
  <xsl:param name="days"/>
  <xsl:param name="date"/>
  <th class="gantt-day-header" align="center" width="19px">
  <xsl:value-of select="date:day-in-month($date)"/>
  </th>
  <xsl:if test="$days > 1">
    <xsl:call-template name="create-day-row">
      <xsl:with-param name="days" select="$days - 1"/>
	  <xsl:with-param name="date" select="date:add($date, date:duration(86400))"/>
	</xsl:call-template>
  </xsl:if>
</xsl:template>

<xsl:template name="gantt">
  <h2><a name="gantt">Gantt Chart</a></h2>

  <!-- Display for non-CSS browsers -->
  <div style="display: none">
    <hr/>
    <strong>*** Note: Gantt chart requires CSS capability. ***</strong>
    <hr/>
  </div>

  <xsl:variable name="days" select="ceiling($projlength div 86400)"/>
  
  <div style="overflow:auto">
  <table cellspacing="0" cellpadding="0" border="1">
    <tr class="header" align="left">
      <th rowspan="2"><span>WBS</span></th>
      <th rowspan="2"><span>Name</span></th>
      <th rowspan="2"><span>Work</span></th>
      <xsl:call-template name="create-week-row">
        <xsl:with-param name="days" select="$days"/>
		<xsl:with-param name="date" select="$projstart"/>
	  </xsl:call-template>
	</tr>

    <tr class="header" align="left">
      <xsl:call-template name="create-day-row">
        <xsl:with-param name="days" select="$days"/>
		<xsl:with-param name="date" select="$projstart"/>
	  </xsl:call-template>
    </tr>

    <xsl:for-each select="//project//task">
      <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="indent" select="count(ancestor::task)"/>
      
	  <xsl:variable name="start">
        <xsl:call-template name="mrproj-parse-date">
          <xsl:with-param name="thedate" select="@start"/>
        </xsl:call-template>
      </xsl:variable>

      <xsl:variable name="end">
        <xsl:call-template name="mrproj-parse-date">
          <xsl:with-param name="thedate" select="@end"/>
        </xsl:call-template>
      </xsl:variable>

      <xsl:variable name="task-start" select="floor(20 * date:seconds(date:difference($projstart, $start)) div 86400)"/>
      <xsl:variable name="task-end" select="floor(20 * date:seconds(date:difference($projstart, $end)) div 86400) - $task-start"/>
      <xsl:variable name="task-complete" select="floor($task-end * (@percent-complete div 100))"/>
      
      <tr class="{$rowclass}">
        <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>
          <xsl:choose>
			<!-- Task has subtasks -->
			<xsl:when test="task">
			  <a name="task-{ id}" style="white-space: nowrap; font-weight: bold; margin-left: {$indent*$task-indent-pixels}px;">
   			    <span>
				  <xsl:value-of select="@name"/>
				</span>
			  </a>
			</xsl:when>
			<!-- Task is leaf -->
            <xsl:otherwise>
              <a name="gantt-{ id}" style="white-space: nowrap; margin-left: {$indent*$task-indent-pixels}px;">
                <span>
				  <xsl:value-of select="@name"/>
				</span>
			  </a>
			</xsl:otherwise>
		  </xsl:choose>
        </td>

		<td>
		  <xsl:choose>
			<!-- Task has subtasks -->
			<xsl:when test="task">
			  <span style="white-space: nowrap; font-weight: bold;">
		        <xsl:call-template name="mrproj-duration">
                  <xsl:with-param name="duration-in-seconds" select="@work"/>
			    </xsl:call-template>
			  </span>
			</xsl:when>
			
			<!-- Task is leaf -->
            <xsl:otherwise>
			  <span>
		        <xsl:call-template name="mrproj-duration">
                  <xsl:with-param name="duration-in-seconds" select="@work"/>
			    </xsl:call-template>
			  </span>
			</xsl:otherwise>
		  </xsl:choose>
		</td>
		<td colspan="{$days}">
		  <div style="width: {$days * 20}px; white-space: nowrap;">
		    <xsl:if test="not (task)">
		      <xsl:if test="$task-start > 0">
			    <xsl:choose>
			      <xsl:when test="@type = 'milestone'">
				    <div class="gantt-empty-begin" style="width: {$task-start - 4}px;">
				    </div>
				  </xsl:when>
				  <xsl:otherwise>
				    <div class="gantt-empty-begin" style="width: {$task-start}px;">
					</div>
				  </xsl:otherwise>
			    </xsl:choose>
			  </xsl:if>
			  
              <xsl:if test="$task-end > 0">
			    <div class="gantt-complete-notdone" style="width: {$task-end}px;">
			      <xsl:if test="$task-complete > 0">
			        <div class="gantt-complete-done" style="width: {$task-complete}px;">
				    </div>
			      </xsl:if>
			    </div>
			  </xsl:if>
			  
			  <xsl:choose>
                <xsl:when test="@type = 'milestone'">
                  <span class="gantt-milestone">&#9670;</span>
				  <xsl:variable name="task-id" select="@id"/>
				  <xsl:for-each select="/project/allocations/allocation[ task-id=$task-id]">
			        <xsl:sort data-type="number" select="@resource-id" order="descending"/>
				    <xsl:variable name="resource-id" select="@resource-id"/>
				    <xsl:value-of select="/project/resources/resource[ id=$resource-id]/@short-name"/>
				    <xsl:if test="not(position() = last())">
				      <xsl:text>, </xsl:text>
				    </xsl:if>
			      </xsl:for-each>
				</xsl:when>
				<xsl:otherwise>
				  <div class="gantt-empty-end"></div>
				  <xsl:variable name="task-id" select="@id"/>
			      <xsl:for-each select="/project/allocations/allocation[ task-id=$task-id]">
			        <xsl:sort data-type="number" select="@resource-id" order="descending"/>
				    <xsl:variable name="resource-id" select="@resource-id"/>
				    <xsl:value-of select="/project/resources/resource[ id=$resource-id]/@short-name"/>
				    <xsl:if test="not(position() = last())">
				      <xsl:text>, </xsl:text>
				    </xsl:if>
			      </xsl:for-each>
				</xsl:otherwise>
			  </xsl:choose>
            </xsl:if>
	      </div>
        </td>
      </tr>
    </xsl:for-each>
  </table><br/>
  </div>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<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";>

<!--**************************************************************************
    *
    * html1_resources.xsl: Display resources in a table
    *
    * Copyright (c)2003 Daniel Lundin
    * Copyright (c)2003 CodeFactory AB
    * Copyright (c) 2004 Chris Ladd (caladd particlestorm net)
    *
    *-->

<xsl:template match="resources">
  <xsl:variable name="hasproperties" 
    select="boolean (count(//resource/properties/property[ value!='']))"/>
  <xsl:variable name="hasnotes"
    select="boolean (count(//resource[ note!='']))"/>
  
  <h2><a name="resources">Resources</a></h2>

  <table cellspacing="0" cellpadding="0" border="1">
    <tr class="header" align="left">
      <th><span>Name</span></th>
      <th><span>Short name</span></th>
      <th><span>Type</span></th>
      <th><span>Group</span></th>
      <th><span>Email</span></th>
      <th><span>Cost</span></th>
      <xsl:if test="$hasnotes">
        <th><span>Notes</span></th>
      </xsl:if>
    </tr>

    <xsl:for-each select="../resources/resource">
	  <xsl:sort select="@type"/>
	  <xsl:sort select="@name"/>
          
      <xsl:call-template name="resource-row">
        <xsl:with-param name="hasnotes" select="$hasnotes"/>
	  </xsl:call-template>
          
	</xsl:for-each>
  </table>
</xsl:template>


<xsl:template name="resource-row">
  <xsl:param name="hasnotes"/>
        <xsl:variable name="rid" select="@id"/>
        <xsl:variable name="gid" select="@group"/>
        
		<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>
      
	    <tr class="{$rowclass}">
          <td>
            <a name="res-{ id}">
			  <span>
			    <xsl:value-of select="@name"/>
			  </span>
			</a>
          </td>
	      <td>
            <span>
			  <xsl:value-of select="@short-name"/>
			</span>
          </td>
          <td>
            <span>
			  <xsl:choose>
                <xsl:when test="@type = 1">Work</xsl:when>
                <xsl:otherwise>Material</xsl:otherwise>
              </xsl:choose>
			</span> 
          </td>
          <td>
		    <span>
			  <xsl:value-of select="../../resource-groups/group[ id=$gid]/@name"/>
		    </span>
		  </td>
		  <td>
            <a href="mailto:{ email}">
              <span>
			    <xsl:value-of select="@email"/>
			  </span>
            </a>
          </td>
         <td align="right">
           <span>
		     <xsl:value-of select="@std-rate"/>
		   </span>
         </td>
         <xsl:if test="$hasnotes">
           <td>
             <span>
			   <xsl:value-of select="@note"/>
			 </span>
           </td>
         </xsl:if>
       </tr>
</xsl:template>

</xsl:stylesheet>
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<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";>

<!--**************************************************************************
    *
    * html1_tasks.xsl: Display tasks in a table with progress bars
    *
    * 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:value-of select="($std-rate * $unit * $work) + $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!='']))"/>
  <h2><a name="tasks">Tasks</a></h2>
  <table cellspacing="0" cellpadding="0" border="1">
    <tr class="header" align="left">
      <th><span>WBS</span></th>
      <th><span>Name</span></th>
      <th><span>Start</span></th>
      <th><span>Finish</span></th>
      <th><span>Work</span></th>
      <th><span>Completed<br/>Work</span></th>
      <th><span>Priority</span></th>
      <th><span>Cost</span></th>
      <xsl:if test="$hasnotes">
        <th><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="@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:choose>
          <xsl:when test="task">
		    <tr class="{$rowclass}">
              <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="font-weight: bold; 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>
                <span>
				  <xsl:call-template name="mrproj-duration">
                    <xsl:with-param name="duration-in-seconds" select="@work"/>
                  </xsl:call-template>
				</span>
              </td>
              <td>
              </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>
              <xsl:if test="$hasnotes">
                <td>
                  <span>
				    <xsl:value-of select="@note"/>
				  </span>
                </td>
              </xsl:if>
            </tr>
		  </xsl:when>
		  <xsl:when test="@type='milestone'">
            <tr class="{$rowclass}">
              <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>
			  </td>
			  <td>
              </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>
              <xsl:if test="$hasnotes">
                <td>
                  <span>
				    <xsl:value-of select="@note"/>
				  </span>
                </td>
              </xsl:if>
            </tr>
          </xsl:when>
          <xsl:otherwise>
            <tr class="{$rowclass}">
              <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>
                <span>
				  <xsl:call-template name="mrproj-duration">
                    <xsl:with-param name="duration-in-seconds" select="@work"/>
                  </xsl:call-template>
				</span>
              </td>
			  <td align="center">
			    <span>
				  <xsl:if test="not(@priority = 0)">
				    <xsl:value-of select="format-number(@priority, '0')"/>
				  </xsl:if>
				</span>
              </td>
              <td align="right">
				<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>
              <xsl:if test="$hasnotes">
                <td>
                  <span>
				    <xsl:value-of select="@note"/>
				  </span>
                </td>
              </xsl:if>
            </tr>
          </xsl:otherwise>
        </xsl:choose>
    </xsl:for-each>
  </table>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns="http://www.w3.org/1999/xhtml"; xmlns:date="http://exslt.org/dates-and-times"; version="1.0">
<!--**************************************************************************
    *
    * html1_tasks.xsl: Display tasks in a table with progress bars
    *
    * 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:value-of select="($std-rate * $unit * $work) + $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!='']))"/>
    <h2>
      <a name="tasks">Tasks</a>
    </h2>
    <table cellspacing="0" cellpadding="0" border="1">
      <tr class="header" align="left">
        <th>
          <span>WBS</span>
        </th>
        <th>
          <span>Name</span>
        </th>
        <th>
          <span>Start</span>
        </th>
        <th>
          <span>Finish</span>
        </th>
        <th>
          <span>Work</span>
        </th>
        <th>
          <span>Work<br/>Complete</span>
        </th>
        <th>
          <span>Cost</span>
        </th>
        <th>
          <span>Earned<br/>Value</span>
        </th>
        <th>
          <span>Earned<br/>Value %</span>
        </th>
        <th>
          <span>Priority</span>
        </th>
        <xsl:if test="$hasnotes">
          <th>
            <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="@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:choose>
          <xsl:when test="task">
            <tr class="{$rowclass}">
              <!-- WBS -->
              <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>
              <!-- Name -->
              <td>
                <a name="task{ id}" style="font-weight: bold; margin-left: {$indent*$task-indent-pixels}px">
                  <span>
                    <xsl:value-of select="@name"/>
                  </span>
                </a>
              </td>
              <!-- Start -->
              <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>
              <!-- Finish -->
              <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>
              <!-- Duration -->
              <td>
                <span>
                  <xsl:call-template name="mrproj-duration">
                    <xsl:with-param name="duration-in-seconds" select="@work"/>
                  </xsl:call-template>
                </span>
              </td>
              <!-- Work Complete -->
              <td>
                <xsl:call-template name="mrproj-duration">
                  <xsl:with-param name="duration-in-seconds" select="@work-complete"/>
                </xsl:call-template>
              </td>
              <!-- Cost -->
              <td>
                <span>
                  <xsl:if test="@cost&gt;0">
                    <xsl:value-of select="format-number(@cost, '###,###,###,###.##')"/>
                  </xsl:if>
                </span>
              </td>
              <!-- Earned Value -->
              <td>
                <span>
                  <xsl:if test="@earned-value&gt;0">
                    <xsl:value-of select="format-number(@earned-value, '###,###,###,###.##')"/>
                  </xsl:if>
                </span>
              </td>
              <!-- Earned Value % -->
              <td>
                <span>
                  <xsl:if test="@earned-value&gt;0 and @cost&gt;0">
                    <xsl:value-of select="format-number(@earned-value * 100 div @cost, '###')"/>%
                  </xsl:if>
                </span>
              </td>
              <!-- Priority -->
              <td align="center">
                <span>
                  <xsl:if test="@priority &gt; 0">
                    <xsl:value-of select="format-number(@priority, '0')"/>
                  </xsl:if>
                </span>
              </td>
              <!-- Notes -->
              <xsl:if test="$hasnotes">
                <td>
                  <span>
                    <xsl:value-of select="@note"/>
                  </span>
                </td>
              </xsl:if>
            </tr>
          </xsl:when>
          <xsl:when test="@type='milestone'">
            <tr class="{$rowclass}">
              <!-- WBS -->
              <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>
              <!-- Name -->
              <td>
                <a name="task{ id}" style="margin-left: {$indent*$task-indent-pixels}px">
                  <span>
                    <xsl:value-of select="@name"/>
                  </span>
                </a>
              </td>
              <!-- Start -->
              <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>
              <!-- Finish -->
              <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>
              <!-- Work -->
              <td></td>
              <!-- Work Complete -->
              <td>
                <xsl:call-template name="mrproj-duration">
                  <xsl:with-param name="duration-in-seconds" select="@work-complete"/>
                </xsl:call-template>
              </td>
              <!-- Cost -->
              <td>
                <span>
                  <xsl:if test="@cost&gt;0">
                    <xsl:value-of select="format-number(@cost, '###,###,###,###.##')"/>
                  </xsl:if>
                </span>
              </td>
              <!-- Earned Value -->
              <td>
                <span>
                  <xsl:if test="@earned-value&gt;0">
                    <xsl:value-of select="format-number(@earned-value, '###,###,###,###.##')"/>
                  </xsl:if>
                </span>
              </td>
              <!-- Earned Value % -->
              <td>
                <span>
                  <xsl:if test="@earned-value&gt;0 and @cost&gt;0">
                    <xsl:value-of select="format-number(@earned-value * 100 div @cost, '###')"/>%
                  </xsl:if>
                </span>
              </td>
              <!-- Priority -->
              <td align="center">
                <span>
                  <xsl:if test="@priority &gt; 0">
                    <xsl:value-of select="format-number(@priority, '0')"/>
                  </xsl:if>
                </span>
              </td>
              <!-- Notes -->
              <xsl:if test="$hasnotes">
                <td>
                  <span>
                    <xsl:value-of select="@note"/>
                  </span>
                </td>
              </xsl:if>
            </tr>
          </xsl:when>
          <xsl:otherwise>
            <tr class="{$rowclass}">
              <!-- WBS -->
              <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>
              <!-- Name -->
              <td>
                <a name="task{ id}" style="margin-left: {$indent*$task-indent-pixels}px">
                  <span>
                    <xsl:value-of select="@name"/>
                  </span>
                </a>
              </td>
              <!-- Start -->
              <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>
              <!-- Finish -->
              <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>
              <!-- Work -->
              <td>
                <span>
                  <xsl:call-template name="mrproj-duration">
                    <xsl:with-param name="duration-in-seconds" select="@work"/>
                  </xsl:call-template>
                </span>
              </td>
              <!-- Work Complete -->
              <td>
                <xsl:call-template name="mrproj-duration">
                  <xsl:with-param name="duration-in-seconds" select="@work-complete"/>
                </xsl:call-template>
              </td>
              <!-- Cost -->
              <td>
                <span>
                  <xsl:if test="@cost&gt;0">
                    <xsl:value-of select="format-number(@cost, '###,###,###,###.##')"/>
                  </xsl:if>
                </span>
              </td>
              <!-- Earned Value -->
              <td>
                <span>
                  <xsl:if test="@earned-value&gt;0">
                    <xsl:value-of select="format-number(@earned-value, '###,###,###,###.##')"/>
                  </xsl:if>
                </span>
              </td>
              <!-- Earned Value % -->
              <td>
                <span>
                  <xsl:if test="@earned-value&gt;0 and @cost&gt;0">
                    <xsl:value-of select="format-number(@earned-value * 100 div @cost, '###')"/>%
                  </xsl:if>
                </span>
              </td>
              <!-- Priority -->
              <td align="center">
                <span>
                  <xsl:if test="@priority &gt; 0">
                    <xsl:value-of select="format-number(@priority, '0')"/>
                  </xsl:if>
                </span>
              </td>
              <!-- Notes -->
              <xsl:if test="$hasnotes">
                <td>
                  <span>
                    <xsl:value-of select="@note"/>
                  </span>
                </td>
              </xsl:if>
            </tr>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </table>
  </xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<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";>

<!--**************************************************************************
    *
    * html1.xsl: Convert a Planner XML file to HTML
    *
    * 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="ISO-8859-1"
  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'"/>


<!-- 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: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:variable>

<xsl:variable name="projend" select="date:add($projstart, date:duration($projlength))"/>

<!--/\___________________________________________________________________/\-->
<!--                     Include the actual templates                      -->

<xsl:include href="html2_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>
  

<!-- XHTML page header -->
<xsl:template name="htmlhead">
  <xsl:param name='title'/>
  <head>

      <xsl:comment>
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

              This file is generated from xml source: DO NOT EDIT

        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      </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>
  </head>
</xsl:template>


<!-- XHTML page footer -->
<xsl:template name="htmlfooter">
  <div class="footer">
  <div class="footer-date">
    Created 
    <xsl:value-of select="date:month-name(date:date())"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="date:day-in-month(date:date())"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="date:year(date:date())"/>
    <xsl:text> at </xsl:text>
    <xsl:value-of select="date:hour-in-day(date:time())"/>
	<xsl:text>:</xsl:text>
    <xsl:value-of select="date:minute-in-hour(date:time())"/>
	<xsl:text>:</xsl:text>
    <xsl:value-of select="date:second-in-minute(date:time())"/>
  </div>
  <div class="footer-disclaimer">
    <div>
      This file was generated by <a
      href="http://planner.imendio.org/";>Planner</a>
    </div>
  </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:value-of select="@name"/></a></h1>
      <div class="proj-header">
        <xsl:if test="@company != ''">
          <div>
            <span class="header">Company: </span>
            <span class="value"><xsl:value-of select="@company"/></span>
          </div>
        </xsl:if>
        <xsl:if test="@manager != ''">
          <div>
            <span class="header">Manager: </span>
            <span class="value"><xsl:value-of select="@manager"/></span>
          </div>
        </xsl:if>
        <div>
          <span class="header">Start Date: </span>
          <span class="value">
            <xsl:value-of select="date:month-name($projstart)"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="date:day-in-month($projstart)"/>
			<xsl:text>, </xsl:text>
			<xsl:value-of select="date:year($projstart)"/>
          </span>
        </div>
        <div>
          <span class="header">Finish Date: </span>
          <span class="value">
            <xsl:value-of select="date:month-name($projend)"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="date:day-in-month($projend)"/>
			<xsl:text>, </xsl:text>
			<xsl:value-of select="date:year($projend)"/>
          </span>
        </div>
        <div>
          <span class="header">Duration: </span>
          <span class="value">
            <xsl:value-of select="floor($projlength div 86400)"/>d
			<xsl:value-of select="floor($projlength div 3600) mod 24"/>h
          </span>
        </div>
		<xsl:if test="@phase != ''">
          <div>
            <span class="header">Phase: </span>
            <span class="value"><xsl:value-of select="@phase"/></span>
          </div>
        </xsl:if>
        <xsl:for-each select="properties/property[ owner='project']">
		  <div>
		    <span class="header">
			  <xsl:value-of select="@label"/>
			  <xsl:text>: </xsl:text>
			</span>
			<span class="value">
              <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>
		    </span>
		  </div>
		</xsl:for-each>
        <div>
          <span class="header">Report Date: </span>
          <span class="value">
            <xsl:value-of select="date:month-name(date:date())"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="date:day-in-month(date:date())"/>
			<xsl:text>, </xsl:text>
			<xsl:value-of select="date:year(date:date ())"/>
          </span>
        </div>
      </div>
      <div style="clear: both"/>

      <!-- 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>
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
 <xsl:output method="xml" indent="yes"/>
 
<xsl:template match="@priority"/>
<xsl:template match="@short-name"/>

<xsl:template match="@*|node()">
  <xsl:copy >
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>
</xsl:stylesheet>
Title: Bicycle Mapbuilder - Planner

Bicycle Mapbuilder

Manager: Cameron Shorter
Start Date: April 21, 2005
Finish Date: October 7, 2005
Duration: 169d 7h
Phase: Planning
Requirement: abc
Report Date: May 23, 2005

Gantt Chart


*** Note: Gantt chart requires CSS capability. ***
WBS Name Work Week 16, 2005 Week 17, 2005 Week 18, 2005 Week 19, 2005 Week 20, 2005 Week 21, 2005 Week 22, 2005 Week 23, 2005 Week 24, 2005 Week 25, 2005 Week 26, 2005 Week 27, 2005 Week 28, 2005 Week 29, 2005 Week 30, 2005 Week 31, 2005 Week 32, 2005 Week 33, 2005 Week 34, 2005 Week 35, 2005 Week 36, 2005 Week 37, 2005 Week 38, 2005
21 22 23 24 25 26 27 28 29 30 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 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 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 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 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 1 2 3 4 5 6 7
1 Bicycle Map Builder Project 62d 6h
1.1 Develop Prototype 45d 6h
1.1.1 Write Pilot PMP 1d
1.1.2 Source ISP 1d
1.1.3 Learn about ISP environment 1d 2h
1.1.4 Fix major bugs in mapbuilder-lib WFS-T demo 6d
1.1.5 Define preliminary schema 1d
1.1.6 Install WFS-T and Mapbuilder 1d 2h
1.1.7 Write Mapbuilder portal 20d
1.1.8 Write Pilot Project Proposal 1d
1.1.9 Write a Wite Paper 2d 4h
1.1.10 Collect Bicycle Rider's Support for Project 3d 6h
1.1.10.1 Create feedback collection, eg html form/email list 1d 2h
1.1.10.2 Go Public with concept
1.1.10.3 Publicise concept 4h
1.1.10.4 Collect feedback 1d
1.1.10.5 Collate feedback into proposal 1d
1.1.11 Write Pilot Project Management Plan 3d 6h
1.1.12 Determine funding requirements for Pilot 1d 2h
1.1.13 Present proposal and support to sponsors 1d
1.1.14 Chase funding for Pilot 1d
1.2 Develop Pilot 17d
1.2.1 Plan the Project 2d
1.2.1.1 Write Project Management Plan 1d
1.2.1.2 Write Measurement Plan 1d
1.2.2 1d
1.2.3 Setup development environment 6d
1.2.3.1 Version Control 1d
1.2.3.2 Issue Tracker 1d
1.2.3.3 Email Lists 1d
1.2.3.4 Wiki 1d
1.2.3.5 Demo Pages 1d
1.2.3.6 Web Pages 1d
1.2.4 Project Management 1d
1.2.5 Development 1d
1.2.5.1 Develop Bike Mapbuilder Portal 1d
1.2.6 Release and Publise BikeMapbuilder Pilot 1d
1.2.7 Maintainance 3d
1.2.7.1 Support Community 1d
1.2.7.2 Maintain software 1d
1.2.7.3 Maintain hosting environment 1d
1.2.8 Implement Measurement Plan 1d
1.2.9 Project wrappup report 1d

Tasks

WBS Name Start Finish Work Work
Complete
Cost Earned
Value
Earned
Value %
Priority Notes
1 Bicycle Map Builder Project Apr 21 Oct 7 62d 6h 5d 4h 54,900 6,720 12%
1.1 Develop Prototype Apr 21 Oct 3 45d 6h 5d 4h 53,700 6,720 13%
1.1.1 Write Pilot PMP Apr 21 Apr 26 1d 1d 1,200 1,200 100%
1.1.2 Source ISP Apr 21 Apr 26 1d 4h 1,200 600 50%
1.1.3 Learn about ISP environment Apr 26 May 3 1d 2h 1,500 Sun 24 Apr 2005, 14:34 Learn how to install stuff. Get login account.
1.1.4 Fix major bugs in mapbuilder-lib WFS-T demo Apr 21 May 24 6d 4h 7,200 720 10% Sun 24 Apr 2005, 14:36 Includes fixing all priority 7 bugs in Mapbuilder bugtracker. Includes building a release.
1.1.5 Define preliminary schema Apr 21 Apr 26 1d 1,200
1.1.6 Install WFS-T and Mapbuilder Apr 26 May 3 1d 2h 1d 2h 1,500 1,500 100%
1.1.7 Write Mapbuilder portal Apr 26 Aug 16 20d 1d 24,000 1,200 5% Sun 24 Apr 2005, 14:49 Web page to describe Bicycle Mapbuilder project and aims of the prototype - Ie to collect support and funding for Pilot. Needs to look professional in presentation. (Maybe use drupal). Needs to present WFS-T example, and snapshot of quality Australian basemaps we can use (eg, Cadastral).
1.1.8 Write Pilot Project Proposal Apr 21 Apr 26 1d 1,200 Sun 24 Apr 2005, 14:54 Most content should come from Business Plan. Just needs a bit of editing. Needs to be put out for review. Try, Mum & Dad, Jon, Gab, Michell Zeibots, Alan Parker, Russ Webber. Mon 25 Apr 2005, 22:00 Need to add feedback from Bicycle Community. Need to show: maps=>more bike riders, community support exists for Mapbuilder. Bike usages=>less pollution, increased health Mapbuilder maps are better than conventional maps Mapbuilder maps are cheaper than conventional maps
1.1.9 Write a Wite Paper Apr 21 May 4 2d 4h 1d 2h 3,000 1,500 50% Fri 06 May 2005, 06:31 Describe why cycling is good, why cyclists need maps, how we can collect maps using Mapbuilder. Release proposal.
1.1.10 Collect Bicycle Rider's Support for Project Aug 16 Sep 21 3d 6h 3,300
1.1.10.1 Create feedback collection, eg html form/email list Aug 16 Aug 23 1d 2h 1,500
1.1.10.2 Go Public with concept Aug 23 Aug 23
1.1.10.3 Publicise concept Aug 23 Aug 25 4h 600 Sun 24 Apr 2005, 15:07 Ask for research which says maps increase bike use. Ask who will update maps, use maps, help write software. Ask if these maps will help people start riding. Ask for help defining schema. Ask people to join an email discussion list.
1.1.10.4 Collect feedback Aug 25 Sep 15 1d
1.1.10.5 Collate feedback into proposal Sep 15 Sep 21 1d 1,200
1.1.11 Write Pilot Project Management Plan Apr 21 May 11 3d 6h 4,500
1.1.12 Determine funding requirements for Pilot May 11 May 18 1d 2h 1,500 Write WBS
1.1.13 Present proposal and support to sponsors Sep 21 Sep 27 1d 1,200 Probably involves a number of meetings.
1.1.14 Chase funding for Pilot Sep 27 Oct 3 1d 1,200
1.2 Develop Pilot Oct 3 Oct 7 17d 1,200
1.2.1 Plan the Project Oct 3 Oct 3 2d
1.2.1.1 Write Project Management Plan Oct 3 Oct 3 1d
1.2.1.2 Write Measurement Plan Oct 3 Oct 3 1d
1.2.2 Oct 3 Oct 3 1d
1.2.3 Setup development environment Oct 3 Oct 3 6d
1.2.3.1 Version Control Oct 3 Oct 3 1d
1.2.3.2 Issue Tracker Oct 3 Oct 3 1d
1.2.3.3 Email Lists Oct 3 Oct 3 1d
1.2.3.4 Wiki Oct 3 Oct 3 1d
1.2.3.5 Demo Pages Oct 3 Oct 3 1d
1.2.3.6 Web Pages Oct 3 Oct 3 1d
1.2.4 Project Management Oct 3 Oct 3 1d
1.2.5 Development Oct 3 Oct 3 1d
1.2.5.1 Develop Bike Mapbuilder Portal Oct 3 Oct 3 1d
1.2.6 Release and Publise BikeMapbuilder Pilot Oct 3 Oct 3 1d
1.2.7 Maintainance Oct 3 Oct 7 3d 1,200
1.2.7.1 Support Community Oct 3 Oct 7 1d 1,200
1.2.7.2 Maintain software Oct 3 Oct 4 1d
1.2.7.3 Maintain hosting environment Oct 3 Oct 4 1d
1.2.8 Implement Measurement Plan Oct 3 Oct 3 1d
1.2.9 Project wrappup report Oct 3 Oct 3 1d

Resources

Name Short name Type Group Email Cost
CS Work cameron shorter net 150

Attachment: schedule.mrproject
Description: application/mrproject



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]