Exemplo n.º 1
0
                $tEndObj = new CDate($t['task_end_date']);
                if ($t['task_milestone'] != 1) {
                    $gantt->addSubBar(substr(' --' . $t['task_name'], 0, 20) . '...', $tStart, $tEnd, $caption, $t['task_dynamic'] == 1 ? 0.1 : 0.6, $p['project_color_identifier'], $progress);
                } else {
                    $gantt->addMilestone(array('-- ' . $t['task_name']), $t['task_start_date']);
                }
                // Insert workers for each task into Gantt Chart
                $q = new DBQuery();
                $q->addTable('user_tasks', 't');
                $q->addQuery('DISTINCT contact_first_name, contact_last_name, t.task_id');
                $q->addJoin('users', 'u', 'u.user_id = t.user_id', 'inner');
                $q->addJoin('contacts', 'c', 'c.contact_id = u.user_contact', 'inner');
                $q->addWhere('t.task_id = ' . (int) $t['task_id']);
                $q->addOrder('user_username ASC');
                $workers = $q->loadList();
                $q->clear();
                foreach ($workers as $w) {
                    $label = '   * ' . $w['contact_first_name'] . ' ' . $w['contact_last_name'];
                }
                // End of insert workers for each task into Gantt Chart
            }
            unset($tasks);
            // End of insert tasks into Gantt Chart
        }
        // End of if showAllGant checkbox is checked
    }
}
// End of check for valid projects array.
unset($projects);
$gantt->render();