Differential D20496 Diff 48997 src/applications/project/controller/PhabricatorProjectReportsController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectReportsController.php
Show All 25 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$nav = $this->newNavigation( | $nav = $this->newNavigation( | ||||
$project, | $project, | ||||
PhabricatorProject::ITEM_REPORTS); | PhabricatorProject::ITEM_REPORTS); | ||||
$crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
$crumbs->addTextCrumb(pht('Reports')); | $crumbs->addTextCrumb(pht('Reports')); | ||||
$crumbs->setBorder(true); | $crumbs->setBorder(true); | ||||
$project_phid = $project->getPHID(); | $chart_panel = id(new PhabricatorProjectBurndownChartEngine()) | ||||
$argv = array( | |||||
'sum', | |||||
array( | |||||
'accumulate', | |||||
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), | |||||
), | |||||
); | |||||
$function = id(new PhabricatorComposeChartFunction()) | |||||
->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(array($project)) | ||||
->buildChartPanel(); | |||||
$chart = $engine->getStoredChart(); | |||||
$panel_type = id(new PhabricatorDashboardChartPanelType()) | |||||
->getPanelTypeKey(); | |||||
$chart_panel = id(new PhabricatorDashboardPanel()) | $chart_panel->setName(pht('%s: Burndown', $project->getName())); | ||||
->setPanelType($panel_type) | |||||
->setName(pht('%s: Burndown', $project->getName())) | |||||
->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(); | ||||
$view = id(new PHUITwoColumnView()) | $view = id(new PHUITwoColumnView()) | ||||
Show All 13 Lines |