SPRA-4 fix mobile views
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user