Customizing dotProject files

dotProject is the most promising open-source (and free) project management software that I’ve found so far.

There are many small changes that needed to be made to the dotProject interface in order for it to work for my team, though. Chief among them was that all projects be numbered. The “short name” field just wasn’t sufficient to uniquely identify projects. We use project numbers in our workflow, in documents, email, and file systems. The number needs to combine the month and year the project was started with a 4-digit unique number.

projectsScreen.jpg

Under “Projects,” by default, you see a tabbed view, with the “All Projects” tab selected.

The files that generate all these Project views are in

modules/projects/

The one that generates the “All Projects” view is

modules/projects/vw_idx_proposed.php

.

Besides adding a number column to each of the project views, some of the other columns needed to be rearranged or removed.

To rearrange/remove columns from the “All Projects View”, open

modules/projects/vw_idx_proposed.php

At approximately line 18 in the unmodified file, you’ll find the HTML code that creates the top row of the multi-column table:


Click image to see larger view.

<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tbl">
<tr>
<td align="right" width="65" nowrap="nowrap">&nbsp;<?php echo $AppUI->_('sort by');?>:&nbsp;</td>
</tr>
<tr>
    <th nowrap="nowrap">
    <a href="?m=projects&orderby=project_id" class="hdr">Number</a>
    </th>
<th nowrap="nowrap">
<a href="?m=projects&orderby=company_name" class="hdr"><?php echo $AppUI->_('Company');?></a>
</th>
<th nowrap="nowrap">
<a href="?m=projects&orderby=project_name" class="hdr"><?php echo $AppUI->_('Project Name');?></a>
</th>
        <th nowrap="nowrap">
<a href="?m=projects&orderby=project_start_date" class="hdr"><?php echo $AppUI->_('Start');?></a>
</th>
        <th nowrap="nowrap">
<a href="?m=projects&orderby=project_end_date" class="hdr"><?php echo $AppUI->_('End');?></a>
</th>
        <th nowrap="nowrap">
<a href="?m=projects&orderby=project_actual_end_date" class="hdr"><?php echo $AppUI->_('Actual');?></a>
</th>
        <th nowrap="nowrap">
<a href="?m=projects&orderby=task_log_problem" class="hdr"><?php echo $AppUI->_('P');?></a>
</th>
<th nowrap="nowrap">
<a href="?m=projects&orderby=user_username" class="hdr"><?php echo $AppUI->_('Owner');?></a>
</th>
<th nowrap="nowrap">
<a href="?m=projects&orderby=total_tasks" class="hdr"><?php echo $AppUI->_('Tasks');?></a>
<a href="?m=projects&orderby=my_tasks" class="hdr">(<?php echo $AppUI->_('My');?>)</a>
</th>
<th nowrap="nowrap">
<?php echo $AppUI->_('Selection'); ?>
</th>
<?php
if($show_all_projects){
?>
<th nowrap="nowrap">
<?php echo $AppUI->_('Status'); ?>
</th>
<?php
}
?>
</tr>
<tr>

To rearrange column headings, simply move around the <th> tags and the text between them.

To change the order of the data columns themselves, things get a little stickier.
The HTML comprising each table cell is generated by several lines of code, concatenated together. To move the entire cell you need to be sure you get all relevant code.

For example the code comprising the project color cell starts on line 89:


$s .= '<td width="65" align="center" style="border: outset #eeeeee 2px;background-color:#'
. $row["project_color_identifier"] . '">';
$s .= $CT . '<font color="' . bestColor( $row["project_color_identifier"] ) . '">'
. sprintf( "%.1f%%", $row["project_percent_complete"] )
. '</font>';
$s .= $CR . '</td>';

The cell containing the checkbox at t is a little trickier, since it contains an if statement. To move this column, you would have to move all of:

$s .= $CR . '<td align="center">';
if ($perms->checkModuleItem('projects', 'edit', $row['project_id']))
$s .= $CT . '<input type="checkbox" name="project_id[]" value="'.$row["project_id"].'" />';
else
      $s .= $CT . '&nbsp;';
$s .= $CR . '</td>';