SPRA-4 fix mobile views

This commit is contained in:
2024-07-29 13:32:03 +02:00
parent 55b520bdfe
commit f54b6db693
4 changed files with 30 additions and 17 deletions
+4 -2
View File
@@ -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,
]);
}
}
+1 -1
View File
@@ -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;