Пример #1
0
    }
    $projects[$row['task_project']]['tasks'][] = $row;
}
$q->clear();
unset($proTasks);
//consider critical (concerning end date) tasks as well
if ($caller != 'todo') {
    $start_min = $projects[$project_id]['project_start_date'];
    $end_max = $projects[$project_id]['project_end_date'] > $criticalTasks[0]['task_end_date'] ? $projects[$project_id]['project_end_date'] : $criticalTasks[0]['task_end_date'];
}
$width = min(w2PgetParam($_GET, 'width', 600), 1400);
$start_date = w2PgetParam($_GET, 'start_date', $start_min);
$end_date = w2PgetParam($_GET, 'end_date', $end_max);
$count = 0;
$gantt = new GanttRenderer($AppUI, $width);
$gantt->localize();
$gantt->setTitle($projects[$project_id]['project_name'], '#' . $projects[$project_id]['project_color_identifier']);
$field = $showWork == '1' ? 'Work' : 'Dur';
if ($caller == 'todo') {
    $columnNames = array('Task name', 'Project name', $field, 'Start', 'Finish');
    $columnSizes = array(180, 50, 60, 60, 60);
} else {
    $columnNames = array('Task name', $field, 'Start', 'Finish');
    $columnSizes = array(230, 60, 60, 60);
}
$gantt->setColumnHeaders($columnNames, $columnSizes);
//-----------------------------------------
// nice Gantt image
// if diff(end_date,start_date) > 90 days it shows only
//week number
// if diff(end_date,start_date) > 240 days it shows only