closed step added + form/controller/template basic start

This commit is contained in:
2021-11-18 14:46:33 +01:00
parent 0a522b465f
commit 5928215c0d
5 changed files with 91 additions and 0 deletions

View File

@@ -158,4 +158,29 @@ class AccompanyingCourseController extends Controller
]);
}
/**
* @Route("/{_locale}/parcours/{accompanying_period_id}/close", name="chill_person_accompanying_course_close")
* @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"})
*/
public function closeAction(AccompanyingPeriod $accompanyingCourse, Request $request): Response
{
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::EDIT, $accompanyingCourse);
$form = $this->createForm(AccompanyingCourseType::class, $accompanyingCourse);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->getDoctrine()->getManager()->flush();
}
return $this->render('@ChillPerson/AccompanyingCourse/close.html.twig', [
'form' => $form->createView(),
'accompanyingCourse' => $accompanyingCourse
]);
}
}