mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
template page for list events participation by person
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Chill\EventBundle\Controller;
|
||||
|
||||
use Chill\EventBundle\Entity\Participation;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Chill\PersonBundle\Form\Type\PickPersonType;
|
||||
@@ -231,5 +232,24 @@ class EventController extends Controller
|
||||
*/
|
||||
public function listByPersonAction($person_id)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
|
||||
|
||||
if ($person === NULL) {
|
||||
throw $this->createNotFoundException('Person not found');
|
||||
}
|
||||
|
||||
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
|
||||
|
||||
$participations = $em->getRepository('ChillEventBundle:Participation')
|
||||
->findBy(
|
||||
array('person' => $person)
|
||||
);
|
||||
|
||||
return $this->render('ChillEventBundle:Event:listByPerson.html.twig', array(
|
||||
'participations' => $participations,
|
||||
'person' => $person
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user