Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/controller/ManiphestReportController.php
Show First 20 Lines • Show All 375 Lines • ▼ Show 20 Lines | $chart = phutil_tag( | ||||
'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); | ||||
if ($project_phid) { | if ($project_phid) { | ||||
$argv = array( | $projects = id(new PhabricatorProjectQuery()) | ||||
'sum', | ->setViewer($viewer) | ||||
array( | ->withPHIDs(array($project_phid)) | ||||
'accumulate', | ->execute(); | ||||
array('fact', 'tasks.open-count.create.project', $project_phid), | |||||
), | |||||
array( | |||||
'accumulate', | |||||
array('fact', 'tasks.open-count.status.project', $project_phid), | |||||
), | |||||
array( | |||||
'accumulate', | |||||
array('fact', 'tasks.open-count.assign.project', $project_phid), | |||||
), | |||||
); | |||||
} else { | } else { | ||||
$argv = array( | $projects = array(); | ||||
'sum', | |||||
array('accumulate', array('fact', 'tasks.open-count.create')), | |||||
array('accumulate', array('fact', 'tasks.open-count.status')), | |||||
); | |||||
} | } | ||||
$function = id(new PhabricatorComposeChartFunction()) | $panel = id(new PhabricatorProjectBurndownChartEngine()) | ||||
->setArguments(array($argv)); | |||||
$datasets = array( | |||||
id(new PhabricatorChartDataset()) | |||||
->setFunction($function), | |||||
); | |||||
$chart = id(new PhabricatorFactChart()) | |||||
->setDatasets($datasets); | |||||
$engine = id(new PhabricatorChartEngine()) | |||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setChart($chart); | ->setProjects($projects) | ||||
->buildChartPanel(); | |||||
$chart = $engine->getStoredChart(); | |||||
$panel_type = id(new PhabricatorDashboardChartPanelType()) | |||||
->getPanelTypeKey(); | |||||
$chart_panel = id(new PhabricatorDashboardPanel()) | $chart_panel = $panel->setName(pht('Burnup Rate')); | ||||
->setPanelType($panel_type) | |||||
->setName(pht('Burnup Rate')) | |||||
->setProperty('chartKey', $chart->getChartKey()); | |||||
$chart_view = id(new PhabricatorDashboardPanelRenderingEngine()) | $chart_view = id(new PhabricatorDashboardPanelRenderingEngine()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setPanel($chart_panel) | ->setPanel($chart_panel) | ||||
->setParentPanelPHIDs(array()) | ->setParentPanelPHIDs(array()) | ||||
->renderPanel(); | ->renderPanel(); | ||||
return array($filter, $chart_view, $panel); | return array($filter, $chart_view, $panel); | ||||
▲ Show 20 Lines • Show All 481 Lines • Show Last 20 Lines |