Customizing dotProject files
August 17, 2006
Dotproject | PHP
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.


Ads by Google

Posted by ellen at August 17, 2006 12:51 PM 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>';

Ads by Google

6 Comments

Hello and welcome to the dotProject community.

I did a similar thing for my wife's install of dotProject. I ended up just using the project_id and normalizing it to 5 digits. Though, you could take the year and month from the start date of the project to simplify it a bit.

On another note, you might want to check out the latest and greatest (CVS HEAD). I'm using it actively in production and have set it up for a few customers. It's completely Smarty Template driven and much cleaner and simpler in terms of tweaking the UI and layout.

I'm a core contributor, so I'm biased though... ;)

Hi Keith,

Thanks for the note - I'm surprised you found this post so fast! I was eventually going to get around to posting something on the forums.

I'll definitely try the newest version from cvs, thanks for letting me know.

Hi,
i need to add a column to the projects list (its a field that i add in the database) but i dont understand how i can do it!...can you help me?

Hi does the example you give have that extra column for project number, that's the only thing I'm missing right now

thanks


Ads by Google

 RSS   |   Contact Me


Ads by Google