diff --git a/project/src/Controller/BaseController.php b/project/src/Controller/BaseController.php index 53994c0..0de3ac8 100644 --- a/project/src/Controller/BaseController.php +++ b/project/src/Controller/BaseController.php @@ -44,12 +44,13 @@ class BaseController extends AbstractController #[IsGranted('reportView')] public function reportsIndex(EntityManagerInterface $entityManager, int $monthId = 0) : Response { - if ($this->getUser()) + $isOverdue = false; if ($monthId > -1) { $monthCurrent = $this->monthHelper->getCurrentMonth($monthId); $reportsAll = $entityManager->getRepository(Reports::class)->findAllInMonth($monthCurrent); } else { $reportsAll = $entityManager->getRepository(Reports::class)->findAllOverdue(); + $isOverdue = true; } $reports = []; @@ -68,7 +69,8 @@ class BaseController extends AbstractController 'reportsGroup' => $reports, 'months' => $this->monthHelper->takeMonths(), 'currentMonth' => $monthCurrent ?? null, - 'reportToDoList' => ReportTodoEnum::cases() + 'reportToDoList' => ReportTodoEnum::cases(), + 'isOverdue' => $isOverdue, ]); } } diff --git a/project/src/Helper/MonthHelper.php b/project/src/Helper/MonthHelper.php index 0a0f1f3..d21705f 100644 --- a/project/src/Helper/MonthHelper.php +++ b/project/src/Helper/MonthHelper.php @@ -8,7 +8,7 @@ class MonthHelper $startDate = new \DateTime("-6 months"); $return = []; - for ($i=1; $i<=12; $i++) { + for ($i=1; $i<=11; $i++) { $tmp = clone $startDate; $tmp->modify("+$i month"); $return[$i] = $tmp; diff --git a/project/templates/navigation/switch_months.html.twig b/project/templates/navigation/switch_months.html.twig index 8565334..31ab962 100644 --- a/project/templates/navigation/switch_months.html.twig +++ b/project/templates/navigation/switch_months.html.twig @@ -1,18 +1,22 @@ {% macro month_menu(routeName, months, currentMonth) %} -