public function createAction($person_id, $cf_group_id, Request $request)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = new Report();
        $cFGroup = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')
              ->find($cf_group_id);
        
        $person = $em->getRepository('ChillPersonBundle:Person')
              ->find($person_id);
        
        if($person === NULL || $cFGroup === NULL) {
            throw $this->createNotFoundException();
        }
        
        $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);

        $form = $this->createCreateForm($entity, $person, $cFGroup);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $entity->setCFGroup($cFGroup);
            $entity->setPerson($person);
            
            $this->denyAccessUnlessGranted('CHILL_REPORT_CREATE', $entity);
            
            $em->persist($entity);
            $em->flush();

            $this->get('session')
                ->getFlashBag()
                ->add('success', 
                    $this->get('translator')
                        ->trans('Success : report created!')
                );

            return $this->redirect($this->generateUrl('report_view', 
                array('person_id' => $person_id,'report_id' => $entity->getId())));
        }


        $this->get('session')
            ->getFlashBag()->add('error',
                $this->get('translator')
                    ->trans('The form is not valid. The report has not been created !')
            );

        return $this->render('ChillReportBundle:Report:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
            'person' => $person
        ));
    }