function renderListHtml(&$efforts = NULL) { $this->render_header(); if (!$efforts && $this->no_items_html) { $this->render_tfoot_empty(); } else { $this->render_thead(); $sum = 0.0; foreach ($efforts as $e) { $this->render_trow($e); } /*if($efforts[0]->getStatus()){ $sum_proj = Effort::getSumEfforts(array('project'=>$efforts[0]->project, 'status'=>$efforts[0]->status)); } else{*/ $sum_proj = Effort::getSumEfforts(array('project' => $efforts[0]->project)); #} if ($sum_proj) { $sum += $sum_proj / 60 / 60 * 1.0; } $sum = round($sum, 1); $this->summary = sprintf(__("Total effort sum: %s hours"), $sum); $this->render_tfoot(); parent::render_blockEnd(); } }
function renderListHtml(&$project = NULL) { $this->render_header(); if (!$project && $this->no_items_html) { $this->render_tfoot_empty(); } else { $this->render_thead(); $this->render_trow($project); $this->render_tfoot(); parent::render_blockEnd(); } }
function renderListHtml(&$efforts = NULL) { $this->render_header(); if (!$efforts && $this->no_items_html) { $this->render_tfoot_empty(); } else { $this->render_thead(); foreach ($efforts as $e) { $this->render_trow($e); } $this->render_tfoot(); parent::render_blockEnd(); } }
function renderListHtml(&$efforts = NULL) { $this->render_header(); if (!$efforts && $this->no_items_html) { $this->render_tfoot_empty(); } else { $this->render_thead(); $sum = 0.0; $day_last = 0; ### grouping ### if ($this->groupings && $this->active_block_function == 'grouped' && $this->groupings->active_grouping_obj) { $last_group = NULL; $gr = $this->groupings->active_grouping_key; foreach ($efforts as $e) { if ($last_group != $e->{$gr}) { echo '<tr class=group><td colspan=' . count($this->columns) . '>' . $this->groupings->active_grouping_obj->render($e) . '</td></tr>'; $last_group = $e->{$gr}; } $sum += (strToClientTime($e->time_end) - strToClientTime($e->time_start)) / 60 / 60 * 1.0; /** * separate new days with style */ $day = gmdate('z', strToClientTime($e->time_end)) * 1; if ($day != $day_last) { $day_last = $day; $this->render_trow($e, 'isNewDay'); } else { $this->render_trow($e); } } } else { foreach ($efforts as $e) { $sum += (strToClientTime($e->time_end) - strToClientTime($e->time_start)) / 60 / 60 * 1.0; /** * separate new days with style */ $day = gmdate('z', strToClientTime($e->time_end)) * 1; if ($day != $day_last) { $day_last = $day; $this->render_trow($e, 'isNewDay'); } else { $this->render_trow($e); } } } $sum = round($sum, 1); $this->summary = sprintf(__("%s effort(s) with %s hours"), count($efforts), $sum); $this->render_tfoot(); parent::render_blockEnd(); } }
function renderListHtml(&$efforts = NULL) { $this->render_header(); if (!$efforts && $this->no_items_html) { $this->render_tfoot_empty(); } else { $this->render_thead(); $sum_hours = 0.0; foreach ($efforts as $e) { $this->render_trow($e); } ## sum effort hours ## /*{ if($efforts[0]->getStatus()){ $sum_proj = Effort::getSumEfforts(array('project'=>$efforts[0]->project, 'status'=>$efforts[0]->status)); } else{ $sum_proj = Effort::getSumEfforts(array('project'=>$efforts[0]->project)); } if($sum_proj){ $sum_hours += $sum_proj/60/60 * 1.0; } $sum_hours = round($sum_hours,1); }*/ $this->render_tfoot(); parent::render_blockEnd(); } }
/** * render complete */ public function render_list(&$tasks = NULL) { global $PH; require_once confGet('DIR_STREBER') . 'render/render_wiki.inc.php'; $this->render_header(); $style = ''; if (!$tasks && $this->no_items_html) { $this->render_tfoot_empty(); } else { ### render table lines ### $this->render_thead(); $count_estimated = 0; $last_group = NULL; foreach ($tasks as $t) { ### get subtasks if expanded $this->tasks_open = Task::getAll(array('for_milestone' => $t->id, 'status_min' => STATUS_NEW, 'status_max' => STATUS_COMPLETED, 'project' => $t->project, 'show_folders' => false)); $this->tasks_closed = Task::getAll(array('for_milestone' => $t->id, 'status_min' => STATUS_APPROVED, 'status_max' => STATUS_CLOSED, 'project' => $t->project, 'show_folders' => false)); $this->num_closed = count($this->tasks_closed); $this->num_open = count($this->tasks_open); $this->num_completed = 0; $this->sum_estimated_min = 0; $this->sum_estimated_max = 0; $this->sum_completion_min = 0; $this->sum_completion_max = 0; foreach ($this->tasks_open as $tt) { $this->sum_estimated_min += $tt->estimated; $this->sum_estimated_max += $tt->estimated_max ? $tt->estimated_max : $tt->estimated; if ($tt->status > STATUS_BLOCKED) { $this->num_completed++; $this->sum_completion_min += $tt->estimated; $this->sum_completion_max += $tt->estimated_max; } else { $this->sum_completion_min += $tt->estimated * $tt->completion / 100; } } foreach ($this->tasks_closed as $tt) { $this->sum_estimated_min += $tt->estimated; $this->sum_estimated_max += $tt->estimated_max ? $tt->estimated_max : $tt->estimated; $this->sum_completion_min += $tt->estimated; $this->sum_completion_max += $tt->estimated_max; } if ($this->groupings && $this->active_block_function == 'grouped') { $gr = $this->groupings->active_grouping_key; if ($last_group != $t->{$gr}) { echo '<tr class=group><td colspan=' . count($this->columns) . '>' . $this->groupings->active_grouping_obj->render($t) . '</td></tr>'; $last_group = $t->{$gr}; } } ### done ### if (@intval($t->status) >= STATUS_COMPLETED) { $style_row = $style . ' isDone'; } else { $style_row = $style; $count_estimated += $t->estimated; } $this->render_trow($t, $style_row); } $this->render_tfoot(); parent::render_blockEnd(); } }