$a = round ($hours); $b = round (get_task_workunit_hours ($id_task)); $image = histogram_2values($a, $b, $labela, $labelb); $table_advanced->data[0][1] = print_label (__('Estimated hours'), '', '', true, $image); $labela = __('Total'); $labelb = __('Imp'); $a = round (task_workunit_cost ($id_task, 0)); $b = round (task_workunit_cost ($id_task, 1)); $image = histogram_2values($a, $b, $labela, $labelb); $table_advanced->data[0][1] .= print_label (__('Imputable estimation'), '', '', true, $image); $labela = __('Est.'); $labelb = __('Real'); $a = $estimated_cost; $b = round (task_workunit_cost ($id_task, 1)); $image = histogram_2values($a, $b, $labela, $labelb); $table_advanced->data[0][1] .= print_label (__('Cost estimation'), '', '', true, $image); //Workload distribution chart $image = graph_workunit_task (200, 170, $id_task, true); $image = '<div class="graph_frame">' . $image . '</div>'; $table_advanced->data[0][2] = print_label (__('Workunit distribution'), '', '', true, $image); $table->colspan['row_task_stats'][0] = 3; $table->data['row_task_stats'][0] = print_container_div('task_stats', __('Task statitics'), print_table($table_advanced, true), 'open', true, true); print_table ($table); ?>
function project_workunit_cost($id_project, $only_marked = 1) { global $config; $total = 0; $res = mysql_query("SELECT * FROM ttask WHERE id_project = {$id_project}"); while ($row = mysql_fetch_array($res)) { $total += task_workunit_cost($row[0], $only_marked); } return $total; }