diff --git a/Controller/EventController.php b/Controller/EventController.php index f727afca1..18cd6b955 100644 --- a/Controller/EventController.php +++ b/Controller/EventController.php @@ -25,6 +25,7 @@ namespace Chill\EventBundle\Controller; use Chill\EventBundle\Entity\Participation; use Chill\EventBundle\Form\Type\PickEventType; use Chill\EventBundle\Repository\ParticipationRepository; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Chill\EventBundle\Security\Authorization\EventVoter; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\PersonBundle\Entity\Person; @@ -442,6 +443,24 @@ class EventController extends Controller return $builder->getForm(); } + + /** + * @paramConverter("event", options={"id" = "event_id"}) + * @param Event $event + * @return \Symfony\Component\HttpFoundation\Response + */ + public function exportParticipationsAction(Event $event) + { + dump($event); + + return $this->render('ChillEventBundle:Event:exportParticipations.html.twig', [ + 'event' => $event, + ]); + } + + + + // pour aller plus loin // TODO ?? inclure le type d'événement et la date dans les résultats de recherche (ex: on tape 'vis' --> il affiche les visites ) // TODO ?? exclure des résultats les événement déjà sélectionnés pour une personne. empêcher d'inscrire 2x une personne ! diff --git a/Resources/config/routing/event.yml b/Resources/config/routing/event.yml index 4271c6d49..79c3da414 100644 --- a/Resources/config/routing/event.yml +++ b/Resources/config/routing/event.yml @@ -40,3 +40,10 @@ chill_event__list_by_person: path: /{person_id}/list defaults: { _controller: "ChillEventBundle:Event:listByPerson" } methods: [ GET ] + +chill_event__event_export_participations: + path: /{event_id}/export/participations + defaults: { _controller: "ChillEventBundle:Event:exportParticipations" } + requirements: + event_id: \d+ + methods: [ GET ] diff --git a/Resources/views/Event/exportParticipations.html.twig b/Resources/views/Event/exportParticipations.html.twig new file mode 100644 index 000000000..20bfed6dc --- /dev/null +++ b/Resources/views/Event/exportParticipations.html.twig @@ -0,0 +1,3 @@ +{% for participation in event.participations %} + {{ dump(participation.person.firstname ~ ' ' ~ participation.person.lastname) }} +{% endfor %} \ No newline at end of file diff --git a/Resources/views/Event/show.html.twig b/Resources/views/Event/show.html.twig index a283add84..3e5ba1d55 100644 --- a/Resources/views/Event/show.html.twig +++ b/Resources/views/Event/show.html.twig @@ -104,6 +104,7 @@