[Planner Dev] Re: Simple patch for %complete



Hello,

We use planner for simple software development task planning under
linux (and perhaps soon mac OSX).

One item we need to see over time is how a project is progressing.
The Gantt chart shows this, but we'd like to see a column in the
tasks table that shows the percent-complete value for each task.

The patch below does this.  Sorry for some extra lines of context,
I reformatted the file to have consistent indentation in emacs.  I
could send the entire file if needed.

Please let me know if there is some other channel through which I
should submit enhancements or fixes.

Another item I'd like to work on is the reporting of the project
duration.  The current report displays the total elapsed time from
start to finish, assuming a start time of 00:00.  In software
development we prefer to think of tasks in terms of "man-days" or
days of effort with a nominal value of 8 hours per day.

If you make some simplifying assumptions, for example a day is
from 09:00 to 17:00 (it doesn't matter in our business when a 
developer actually works during the day, as long as they do the
work) you might hack something like this:

<xsl:template name="mrproj-total-duration">
  <xsl:param name="duration-in-seconds"/>
  <xsl:variable name="basedays" select="floor($duration-in-seconds div
86400)"/>
  <xsl:variable name="remaining-seconds" select="($duration-in-seconds -
($basedays * 86400)) - 32400"/>
  <xsl:variable name="days" select="$basedays + floor($remaining-seconds
div 28800)"/>
  <xsl:variable name="hours" select="($remaining-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>

This has some ugly hard-coded knowledge about the hours worked (but 
then, it looks as if mrproj-duration has the same "problem").  A
more general solution would need to examine the actual working
schedule, which is further complicated if you have multiple shifts
or people working different schedules.  Perhaps we can apply an 
assumption that "man days effort" is always a normalized work day
for days actually worked.


While I've got your attention, another think I'd like to fix is
to add default actions to the dialog boxes in planner, so that
pressing <enter> applies the default action (usually "OK").  I 
assume this is a straight-forward fix that would make the GUI
behavior consistent with other dialogs under gnome.


Another item I'd like to investigate would be a way to track
actual time against estimated time, so we can see over the life
of a project where estimates did not match actual effort.  I
haven't begun to think about how that might be presented.  Perhaps
some of you have ideas on this you'd like to share.

Cheers,
David SUNDSTROM
Kabira Technologies


sunds espoir>> LC_ALL=C TZ=UTC0 diff -NbBaur html1_tasks.xsl.orig
html1_tasks.xsl
--- html1_tasks.xsl.orig        2005-02-14 18:24:16.000000000 +0000
+++ html1_tasks.xsl     2005-02-14 18:33:13.000000000 +0000
@@ -5,7 +5,7 @@
                   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
     *
@@ -15,7 +15,7 @@
     *
     *-->
 
-<xsl:template name="calculate-cost">
+  <xsl:template name="calculate-cost">
   <xsl:param name="std-rates"/>
   <xsl:param name="units"/>
   <xsl:param name="level"/>
@@ -38,9 +38,9 @@
          <xsl:value-of select="($std-rate * $unit * $work) + $cost"/>
     </xsl:otherwise>
   </xsl:choose>
-</xsl:template>
+  </xsl:template>
 
-<xsl:template match="tasks">
+  <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>
@@ -52,6 +52,7 @@
       <th><span>Finish</span></th>
       <th><span>Work</span></th>
       <th><span>Priority</span></th>
+       <th><span>% Complete</span></th>
       <th><span>Cost</span></th>
       <xsl:if test="$hasnotes">
         <th><span>Notes</span></th>
@@ -131,6 +132,8 @@
               <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"/>
@@ -194,6 +197,8 @@
                          <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"/>
@@ -266,6 +271,11 @@
                                  </xsl:if>
                                </span>
               </td>
+             <td>
+               <span>
+                 <xsl:value-of select="@percent-complete"/>%
+               </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"/>
@@ -295,5 +305,5 @@
         </xsl:choose>
     </xsl:for-each>
   </table>
-</xsl:template>
+  </xsl:template>
 </xsl:stylesheet>





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