rdv: add default status on rdv when creating a new rdv

This commit is contained in:
nobohan
2021-07-19 12:06:21 +02:00
parent 4b8736ae57
commit 227be0b482
4 changed files with 24 additions and 13 deletions

View File

@@ -158,6 +158,7 @@ class CalendarController extends AbstractController
$entity = new Calendar();
$entity->setUser($this->getUser());
$entity->setStatus($entity::STATUS_VALID);
// if ($user instanceof User) {
// $entity->setPerson($user);
@@ -167,9 +168,6 @@ class CalendarController extends AbstractController
$entity->setAccompanyingPeriod($accompanyingPeriod);
}
// $entity->setType($activityType);
// $entity->setDate(new \DateTime('now'));
$form = $this->createForm(CalendarType::class, $entity, [
'accompanyingPeriod' => $accompanyingPeriod,
])->handleRequest($request);
@@ -191,7 +189,6 @@ class CalendarController extends AbstractController
}
$entity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
dump($entity_array);
return $this->render($view, [
'user' => $user,