Actually i am trying to use dotproject to build my own small application.
I am stuck up at a point where dotproject displays all the tasks related to a particular project .It queries the database for this firing the sql below
$q->addJoin('tasks', 't1', 'projects.project_id = t1.task_project');
$q->addQuery('com.company_name AS company_name, com_internal.company_name'
. ' AS company_name_internal'
. ", CONCAT_WS(', ',contact_last_name,contact_first_name) user_name"
. ', projects.*, SUM(t1.task_duration * t1.task_percent_complete'
." * IF(t1.task_duration_type = 24, {$working_hours}, t1.task_duration_type))"
." / SUM(t1.task_duration * IF(t1.task_duration_type = 24, {$working_hours},"
. ' t1.task_duration_type)) AS project_percent_complete');
$q->addWhere('t1.task_id = t1.task_parent');
$q->addWhere('project_id = ' . $project_id);
$q->addGroup('project_id');
I am not able to understand the sql properly.Actually, this sql retrieves all the tasks associated with a project.But in my project i want only that tasks whose duration has completed.
How do i change the sql to make that happen?