rdv: rdv -> activity: pass calendar data to new activity controller

This commit is contained in:
nobohan
2021-09-20 15:23:54 +02:00
parent 3385cb2dda
commit e8d8a57b4b
5 changed files with 55 additions and 5 deletions

View File

@@ -215,10 +215,28 @@ class CalendarController extends AbstractController
throw $this->createNotFoundException('Template not found');
}
$personsId = [];
foreach ($entity->getPersons() as $p) {
array_push($personsId, $p->getId());
}
$professionalsId = [];
foreach ($entity->getProfessionals() as $p) {
array_push($professionalsId, $p->getId());
}
$activityData = [
'personsId' => $personsId,
'professionalsId' => $professionalsId,
'date' => $entity->getStartDate()->format('Y-m-d'),
'durationTime' => $entity->getEndDate()->diff($entity->getStartDate())->format("%H:%M")
];
return $this->render($view, [
'accompanyingCourse' => $accompanyingPeriod,
'entity' => $entity,
'user' => $user
'user' => $user,
'activityData' => $activityData
//'delete_form' => $deleteForm->createView(),
]);
}