Improve pull-request that compare hours
This commit is contained in:
parent
db7a9ddf5f
commit
9e1f4fa6c7
|
|
@ -1,6 +1,10 @@
|
|||
Version 1.0.23 (unreleased)
|
||||
---------------------------
|
||||
|
||||
New features:
|
||||
|
||||
- Add report to compare working hours between open and closed tasks
|
||||
|
||||
Bug fixes:
|
||||
|
||||
- Fix wrong constant name that cause a PHP error in project management section
|
||||
|
|
|
|||
|
|
@ -173,21 +173,19 @@ class Analytic extends Base
|
|||
*
|
||||
* @access public
|
||||
*/
|
||||
|
||||
public function compareHours()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$params = $this->getProjectFilters('analytic', 'compareHours');
|
||||
$params = $this->getProjectFilters('analytic', 'compareHours');
|
||||
$query = $this->taskFilter->search('status:all')->filterByProject($params['project']['id'])->getQuery();
|
||||
|
||||
|
||||
$paginator = $this->paginator
|
||||
->setUrl('analytics', 'compare_hours')
|
||||
->setUrl('analytic', 'compareHours', array('project_id' => $project['id']))
|
||||
->setMax(30)
|
||||
->setOrder(TaskModel::TABLE.'.id')
|
||||
->setQuery($query)
|
||||
->calculate();
|
||||
|
||||
|
||||
$stats = $this->projectAnalytic->getHoursByStatus($project['id']);
|
||||
|
||||
$this->response->html($this->layout('analytic/compare_hours', array(
|
||||
|
|
@ -195,6 +193,6 @@ class Analytic extends Base
|
|||
'paginator' => $paginator,
|
||||
'metrics' => $stats,
|
||||
'title' => t('Compare hours for "%s"', $project['name']),
|
||||
)));
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,14 +202,14 @@ class ProjectAnalytic extends Base
|
|||
|
||||
// Init values
|
||||
$stats['closed'] = array(
|
||||
'time_spent' => 0,
|
||||
'time_estimated' => 0,
|
||||
);
|
||||
$stats['open'] = array(
|
||||
'time_spent' => 0,
|
||||
'time_estimated' => 0,
|
||||
);
|
||||
'time_spent' => 0,
|
||||
'time_estimated' => 0,
|
||||
);
|
||||
|
||||
$stats['open'] = array(
|
||||
'time_spent' => 0,
|
||||
'time_estimated' => 0,
|
||||
);
|
||||
|
||||
// Add times spent and estimated to each status
|
||||
foreach ($tasks as &$task) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -28,11 +28,6 @@ CompareHoursColumnChart.prototype.execute = function() {
|
|||
x: {
|
||||
type: 'category',
|
||||
categories: categories
|
||||
},
|
||||
y: {
|
||||
tick: {
|
||||
format: this.app.formatDuration
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue