Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/controller/ManiphestReportController.php
Show First 20 Lines • Show All 331 Lines • ▼ Show 20 Lines | public function renderBurn() { | ||||
if ($handle) { | if ($handle) { | ||||
$inst = pht( | $inst = pht( | ||||
'NOTE: This table reflects tasks currently in '. | 'NOTE: This table reflects tasks currently in '. | ||||
'the project. If a task was opened in the past but added to '. | 'the project. If a task was opened in the past but added to '. | ||||
'the project recently, it is counted on the day it was '. | 'the project recently, it is counted on the day it was '. | ||||
'opened, not the day it was categorized. If a task was part '. | 'opened, not the day it was categorized. If a task was part '. | ||||
'of this project in the past but no longer is, it is not '. | 'of this project in the past but no longer is, it is not '. | ||||
'counted at all.'); | 'counted at all. This table may not agree exactly with the chart '. | ||||
'above.'); | |||||
$header = pht('Task Burn Rate for Project %s', $handle->renderLink()); | $header = pht('Task Burn Rate for Project %s', $handle->renderLink()); | ||||
$caption = phutil_tag('p', array(), $inst); | $caption = phutil_tag('p', array(), $inst); | ||||
} else { | } else { | ||||
$header = pht('Task Burn Rate for All Tasks'); | $header = pht('Task Burn Rate for All Tasks'); | ||||
$caption = null; | $caption = null; | ||||
} | } | ||||
if ($caption) { | if ($caption) { | ||||
Show All 25 Lines | $chart = phutil_tag( | ||||
'background-color: #fff; '. | 'background-color: #fff; '. | ||||
'margin: 8px 16px; '. | 'margin: 8px 16px; '. | ||||
'height: 400px; ', | 'height: 400px; ', | ||||
), | ), | ||||
''); | ''); | ||||
list($burn_x, $burn_y) = $this->buildSeries($data); | list($burn_x, $burn_y) = $this->buildSeries($data); | ||||
require_celerity_resource('d3'); | if ($project_phid) { | ||||
require_celerity_resource('phui-chart-css'); | $argv = array( | ||||
'sum', | |||||
Javelin::initBehavior('line-chart-legacy', array( | array( | ||||
'hardpoint' => $id, | 'accumulate', | ||||
'x' => array( | array('fact', 'tasks.open-count.create.project', $project_phid), | ||||
$burn_x, | |||||
), | ), | ||||
'y' => array( | array( | ||||
$burn_y, | 'accumulate', | ||||
array('fact', 'tasks.open-count.status.project', $project_phid), | |||||
), | ), | ||||
'xformat' => 'epoch', | array( | ||||
'yformat' => 'int', | 'accumulate', | ||||
)); | array('fact', 'tasks.open-count.assign.project', $project_phid), | ||||
), | |||||
); | |||||
} else { | |||||
$argv = array( | |||||
'sum', | |||||
array('accumulate', array('fact', 'tasks.open-count.create')), | |||||
array('accumulate', array('fact', 'tasks.open-count.status')), | |||||
epriestley: We count two types of events for open tasks:
- `*.create` is when a new task is created into… | |||||
); | |||||
} | |||||
$box = id(new PHUIObjectBoxView()) | $function = id(new PhabricatorComposeChartFunction()) | ||||
->setHeaderText(pht('Burnup Rate')) | ->setArguments(array($argv)); | ||||
->appendChild($chart); | |||||
$datasets = array( | |||||
id(new PhabricatorChartDataset()) | |||||
->setFunction($function), | |||||
); | |||||
$chart = id(new PhabricatorFactChart()) | |||||
->setDatasets($datasets); | |||||
$engine = id(new PhabricatorChartEngine()) | |||||
->setViewer($viewer) | |||||
->setChart($chart); | |||||
$chart = $engine->getStoredChart(); | |||||
$panel_type = id(new PhabricatorDashboardChartPanelType()) | |||||
->getPanelTypeKey(); | |||||
$chart_panel = id(new PhabricatorDashboardPanel()) | |||||
->setPanelType($panel_type) | |||||
->setName(pht('Burnup Rate')) | |||||
->setProperty('chartKey', $chart->getChartKey()); | |||||
$chart_view = id(new PhabricatorDashboardPanelRenderingEngine()) | |||||
->setViewer($viewer) | |||||
->setPanel($chart_panel) | |||||
->setParentPanelPHIDs(array()) | |||||
->renderPanel(); | |||||
return array($filter, $box, $panel); | return array($filter, $chart_view, $panel); | ||||
} | } | ||||
private function renderReportFilters(array $tokens, $has_window) { | private function renderReportFilters(array $tokens, $has_window) { | ||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
$form = id(new AphrontFormView()) | $form = id(new AphrontFormView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
▲ Show 20 Lines • Show All 473 Lines • Show Last 20 Lines |
We count two types of events for open tasks:
To get the overall open task count for an install, we have to combine these. However, in other views, we might care about reopened tasks separately (e.g., how much of our timeline slippage is due to making mistakes and needing to rework things?), which is why they're tracked separately.
Likewise, above, we count three types of events for project tasks:
To show an overall chart, we add these together. In other views, we might care about rework or new scope to help us understand timelines.