redcarton.com

phpCollab: MODs and HACKs...

phpCollab LogophpCollab is an open source project management suite written in php. It is a (barely) active project on SourceForge and has a decent set of basic features. Below are the modifications and hacks that I have made. For others, see the forums on the phpCollab website.

MOD - Linked Content List

phpCollab allows you to upload files (what it calls "Linked Content"). The files are neatly organized by project and task. However, after a while you can have files all over your projects and tasks and you may not remember where you uploaded them.

Tired of searching through all your projects and tasks for old linked content? This page will give you a list of all the linked content in projects that you are a member of.

The list shows the Type, Name, Date, Project, Task and Owner.

Download (2.44 KB). Just follow the simple installation instructions in the header of the file.

Tested in phpCollab 2.5b4.

MOD - Show Version Comments in File Details

Currently, when you view file details for linked content, only the comments for the latest version are shown. The code below will allow you to show the comments for the previous versions as well. It inserts a new row in the Version History table if the version has comments (with the exception of the latest version, since it's comments are already shown).

To install:

1. Open ../linkedcontent/viewfile.php
2. Find this line (approx line # 381)

echo"</td><td>".$strings["date"]." : ".$listVersions->fil_date[$i]."</td></tr>";

3. Insert this after that line

// Show comments for each version if ($i != 0 && $listVersions->fil_comments[$i] != "") { echo "<tr class=\"$class\"><td>&nbsp;</td><td colspan=\"5\">". $strings["comments"]." : ".nl2br($listVersions->fil_comments[$i]). "</td></tr>"; }

4. Save changes.

Tested in phpCollab 2.5b4.

HACK - Highlight Today in Gantt Charts

This hack will highlight today's date in the gantt chart. This makes it easier to situate yourself in the chart. Insert the code below into the following files after the tasks are retrieved and before they are added to the chart.

  • ../tasks/graphtasks.php
  • ../subtasks/graphsubtasks.php *
  • ../projects_site/graphtasks.php
  • ../projects_site/graphsubtasks.php *
  • ../phases/graphtasks.php
  • ../calendar/graphtasks.php
  • ../reports/graphtasks.php

* For these files be sure to refer to subtas_start_date and subtas_start_date instead of tas_start_date and tas_start_date.

$minDate; $maxDate; $todayDate = date('Y-m-d'); for ($i=0;$i<$comptListTasks;$i++) { $startDate = strtotime($listTasks->tas_start_date[$i]); if ($startDate < $minDate) { $minDate = $startDate; } $dueDate = strtotime($listTasks->tas_due_date[$i]); if ($dueDate > $maxDate) { $maxDate = $dueDate; } } if (strtotime($todayDate) >= $minDate && strtotime($todayDate) <= $maxDate) { $today = new GanttVLine($todayDate,'Today','#6699FF',9,'solid'); $today->SetDayOffset(0.5); $graph->Add($today); }

Tested in phpCollab 2.5b4.

HACK - Remember Last Page Fix

phpCollab remembers the last page you viewed and returns you to it when you log back in. This is pretty neat but it has a draw back when the last page is viewing linked content or a project site. When that happens there is no way to return to phpCollab. To fix this, edit ../includes/library.php and replace

$tmpquery = "UPDATE ".$tableCollab["members"]. " SET last_page='$page' WHERE id = '".fixInt($idSession)."'";

with

if (strpos($page, "accessfile.php") == false && strpos($page, "projects_site") == false) { $tmpquery = "UPDATE ".$tableCollab["members"]. " SET last_page='$page' WHERE id = '".fixInt($idSession)."'"; }

This will continue to save every page except when you view or save linked content and when you view a projects site. It simply keeps the page you viewed before that.

Tested in phpC 2.5b4.