mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
badge adapted+ menu entry + persistance of object fixed
This commit is contained in:
@@ -99,7 +99,7 @@ class AccompanyingCourseController extends Controller
|
||||
public function indexAction(AccompanyingPeriod $accompanyingCourse): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $accompanyingCourse);
|
||||
|
||||
|
||||
// compute some warnings
|
||||
// get persons without household
|
||||
$withoutHousehold = [];
|
||||
@@ -179,7 +179,9 @@ class AccompanyingCourseController extends Controller
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($accompanyingCourse);
|
||||
|
||||
$workflow = $this->registry->get($accompanyingCourse);
|
||||
|
||||
if ($workflow->can($accompanyingCourse, 'close')) {
|
||||
@@ -187,10 +189,16 @@ class AccompanyingCourseController extends Controller
|
||||
if( count($errors) > 0 ){
|
||||
return $this->json($errors, 422);
|
||||
}
|
||||
|
||||
$workflow->apply($accompanyingCourse, 'close');
|
||||
$em->persist($accompanyingCourse);
|
||||
}
|
||||
|
||||
$em->flush();
|
||||
|
||||
return $this->redirectToRoute('chill_person_accompanying_course_index', [
|
||||
'accompanying_period_id' => $accompanyingCourse->getId()
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
return $this->render('@ChillPerson/AccompanyingCourse/close.html.twig', [
|
||||
|
Reference in New Issue
Block a user