mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
closed step added + form/controller/template basic start
This commit is contained in:
@@ -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
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user