projectService = $projectService; $this->sprintService = $sprintService; $this->ticketService = $ticketService; session(['lastPage' => BASE_URL.'/reports/show']); $this->reportService = $reportService; $this->reportService->dailyIngestion(); } /** * @throws BindingResolutionException */ #[RequiresPermission(ReportsPermissions::VIEW)] public function get(array $params): Response { $currentProject = (int) session('currentProject'); // Project Progress $this->tpl->assign('projectProgress', $this->projectService->getProjectProgress($currentProject)); $this->tpl->assign('currentProjectName', $this->projectService->getProjectName($currentProject)); // Sprint Burndown $requestedSprintId = isset($params['sprint']) ? (int) $params['sprint'] : null; $allSprints = $this->sprintService->getAllSprints($currentProject); $sprintBurndown = $this->reportService->getSprintBurndownForReport($currentProject, $requestedSprintId); $this->tpl->assign('sprintBurndown', $sprintBurndown['chart']); if ($allSprints !== false && count($allSprints) > 0) { $this->tpl->assign('currentSprint', $sprintBurndown['currentSprintId']); } $this->tpl->assign('backlogBurndown', $this->sprintService->getCummulativeReport($currentProject)); $this->tpl->assign('allSprints', $allSprints); $this->tpl->assign('fullReport', $this->reportService->getFullReport($currentProject)); $this->tpl->assign('fullReportLatest', $this->reportService->getRealtimeReport($currentProject, '')); $this->tpl->assign('states', $this->ticketService->getStatusLabels()); // Milestones. getAllMilestones no longer computes percentDone in the query, so backfill each // milestone's completion the same way the Roadmap/timeline does — otherwise the report shows // every milestone at 0% (#3624). $allProjectMilestones = $this->ticketService->getAllMilestones(['sprint' => '', 'type' => 'milestone', 'currentProject' => $currentProject]); $allProjectMilestones = $this->ticketService->getBulkMilestoneProgress($allProjectMilestones); $this->tpl->assign('milestones', $allProjectMilestones); return $this->tpl->display('reports.show'); } #[RequiresPermission(ReportsPermissions::VIEW)] public function post($params): Response { return Frontcontroller::redirect(BASE_URL.'/dashboard/show'); } }