mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-26 08:35:00 +00:00
Fixes in template parameters + remove budget elements when removing event
This commit is contained in:
@@ -78,6 +78,7 @@ final class EventController extends AbstractController
|
||||
|
||||
/** @var array $participations */
|
||||
$participations = $event->getParticipations();
|
||||
$budgetElements = $event->getBudgetElements();
|
||||
|
||||
$form = $this->createDeleteForm($event_id);
|
||||
|
||||
@@ -89,6 +90,10 @@ final class EventController extends AbstractController
|
||||
$em->remove($participation);
|
||||
}
|
||||
|
||||
foreach ($budgetElements as $e) {
|
||||
$em->remove($e);
|
||||
}
|
||||
|
||||
$em->remove($event);
|
||||
$em->flush();
|
||||
|
||||
|
@@ -228,7 +228,7 @@ final class ParticipationController extends AbstractController
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('chill_event__event_show', [
|
||||
'event_id' => $participation->getEvent()->getId(),
|
||||
'id' => $participation->getEvent()->getId(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ final class ParticipationController extends AbstractController
|
||||
/**
|
||||
* @param int $participation_id
|
||||
*/
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{participation_id}/delete', name: 'chill_event_participation_delete', requirements: ['participation_id' => '\d+'], methods: ['GET', 'DELETE'])]
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{participation_id}/delete', name: 'chill_event_participation_delete', requirements: ['participation_id' => '\d+'])]
|
||||
public function deleteAction($participation_id, Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
{
|
||||
$em = $this->managerRegistry->getManager();
|
||||
@@ -273,7 +273,7 @@ final class ParticipationController extends AbstractController
|
||||
);
|
||||
|
||||
return $this->redirectToRoute('chill_event__event_show', [
|
||||
'event_id' => $event->getId(),
|
||||
'id' => $event->getId(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -442,7 +442,7 @@ final class ParticipationController extends AbstractController
|
||||
));
|
||||
|
||||
return $this->redirectToRoute('chill_event__event_show', [
|
||||
'event_id' => $participation->getEvent()->getId(),
|
||||
'id' => $participation->getEvent()->getId(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user