PDA

View Full Version : Gantt Chart - Show only current tasks in selected period


Asadullo
20-03-12, 04:47 PM
Hi All!

For our project needs we wanted to show only current tasks in the selected period in Gantt Chart. So that tasks that are finished or tasks that are not started between the selected periods must not be shown.

Using dotproject 2.1.5 version.

in modules/tasks/gantt.php after line 90 just after the block
if ($showPinned) {
$q->addWhere('task_pinned = 1');
}

add lines

//Show only the tasks which are due to that period
if(dPgetParam($_GET, 'start_date', 0) && dPgetParam($_GET, 'end_date', 0)){
$q->addWhere('!(task_start_date >=\''.dPgetParam($_GET, 'start_date', 0).'\' AND task_start_date >=\''.dPgetParam($_GET, 'end_date', 0).'\')');
$q->addWhere('!(task_end_date <=\''.dPgetParam($_GET, 'start_date', 0).'\' AND task_end_date <=\''.dPgetParam($_GET, 'end_date', 0).'\')');
}


and also add the above lines after the line 109 after the block
if ($f != 'myinact') {
$q->addWhere('task_status > -1');
}

Thats it...

And the long list of tasks shorten to show only the tasks which are in the period you have selected.