Linking report <> person

This commit is contained in:
Marc Ducobu
2014-11-09 19:19:28 +01:00
parent 0fe3962968
commit 3834e16a7b
3 changed files with 55 additions and 0 deletions

View File

@@ -51,6 +51,39 @@ class ReportController extends Controller
));
}
/**
* Select the type of the Report
*/
public function selectReportTypeAction($person_id, Request $request)
{
$em = $this->getDoctrine()->getManager();
$cFGroups = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')
->findByEntity('Chill\ReportBundle\Entity\Report');
$cFGroupsChoice = array();
foreach ($cFGroups as $cFGroup) {
$cFGroupsChoice[$cFGroup->getId()] = $cFGroup->getName($request->getLocale());
}
$form = $this->get('form.factory')
->createNamedBuilder(null, 'form', null, array(
'method' => 'GET',
'action' => $this->generateUrl('report_new'),
'csrf_protection' => false
))
->add('cFGroup', 'choice', array(
'choices' => $cFGroupsChoice
))
->getForm();
return $this->render('ChillReportBundle:Report:select_report_type.html.twig', array(
'form' => $form->createView()
));
}
/**
* Creates a new Report entity.
*