dotProject Recipe: Add journal entries from the project view page
July 02, 2008
Dotproject | PHP | Snippets | Web Building

NOTE (07-02-08): The modified Journal module has now been updated to work with v. 2.x of dotProject.

J. Christopher Pereira created a journal module which is quite handy: it lets you add notes to projects - any type of note, without creating a task.

The module is very useful, but a coworker requested that we modify it so you could add a journal note without ever leaving the project view page. Instead of a new window opening to enter the journal note, you simply enter the note into a text box that is always visible on the project view page.

You just enter text in the new text field, hit "save"...

Ads by Google

Posted by ellen at July 02, 2008 06:07 PM

..and it shows up at the top of the list.

To give you an idea of how I work when customizing dotproject, since my knowledge of php is limited, I look for similar functionality to what I want somewhere else in the application, then copy the code to where I want it to appear. That usually creates errors, but with debugging on, the errors give you clues to what is missing, often database queries or url parameters. I fix them one by one - laborious but it works!

The revised journal module files are available below. The files which were modified are modules/journal/index.php, modules/journal/addedit.php and modules/projects/view.php.

  1. In "modules/projects/view.php":
    Right after the line:

    $tabBox = new CTabBox( "?m=projects&a=view&project_id=$project_id", "", $tab );

    Add this line:

    $tabBox->add( DP_BASE_DIR.'/modules/journal/index', 'Journal' );

    or, to avoid modifying the core code, use the new framework mechanism in 2.x. Create a new file in the modules/journal folder named projects_tab.view.journal.php with the following content:

    if (!defined('DP_BASE_DIR')){
    die('You should not access this file directly');
    include (DP_BASE_DIR . '/modules/journal/index.php') ;

    (thanks to Barry A. for this tip)
  2. Unzip the journal folder from the zip archive and upload the "journal" folder into the /modules/ folder. Activate the Journal module.

To see the new functionality, from the Projects list, click on any project title. On the page that appears, you should now see the journal text entry box on the first tab. I set this tab as the default to lower the barriers to recording notes as much as possible. I'm also thinking of adding a popup version of this right on the projects list page.

Ads by Google



I have tried this out with Dotproject 2.1.1 and it throws up all kinds of horrible mysql error messages? The original Journal module works fine but these changed files cause all kinds of problems.

Are these mods compatible with the latest Dot project? They look very useful..


They may not be. When I have time, I'll experiment with getting this particular mod to work with 2.1.1.

The files have now been updated to work with version 2.x.

you should try searching this topic with google


I want to create my website too, could you help me ?



I want to create my website too, could you help me ?


Ads by Google

 RSS   |   Contact Me

Ads by Google