added/reworded some comments
This commit is contained in:
@@ -168,6 +168,12 @@ class Analytic extends Base
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show comparison between actual and estimated hours chart
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
|
||||||
public function compareHours()
|
public function compareHours()
|
||||||
{
|
{
|
||||||
$project = $this->getProject();
|
$project = $this->getProject();
|
||||||
|
|||||||
@@ -180,13 +180,18 @@ class ProjectAnalytic extends Base
|
|||||||
return $stats;
|
return $stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the time spent and estimated into each status
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param integer $project_id
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getHoursByStatus($project_id)
|
public function getHoursByStatus($project_id)
|
||||||
{
|
{
|
||||||
$stats = array();
|
$stats = array();
|
||||||
$columns = $this->board->getColumnsList($project_id);
|
|
||||||
|
|
||||||
// Get the time spent of the last move for each tasks
|
// Get the times related to each task
|
||||||
$tasks = $this->db
|
$tasks = $this->db
|
||||||
->table(Task::TABLE)
|
->table(Task::TABLE)
|
||||||
->columns('id', 'time_estimated', 'time_spent', 'is_active')
|
->columns('id', 'time_estimated', 'time_spent', 'is_active')
|
||||||
@@ -206,7 +211,7 @@ class ProjectAnalytic extends Base
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Get time spent foreach task/column and take into account the last move
|
// Add times spent and estimated to each status
|
||||||
foreach ($tasks as &$task) {
|
foreach ($tasks as &$task) {
|
||||||
if ($task['is_active']) {
|
if ($task['is_active']) {
|
||||||
$stats['open']['time_estimated'] += $task['time_estimated'];
|
$stats['open']['time_estimated'] += $task['time_estimated'];
|
||||||
|
|||||||
Reference in New Issue
Block a user