mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
using person template
This commit is contained in:
@@ -121,6 +121,8 @@ class ReportController extends Controller
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
|
||||
|
||||
$entity = new Report();
|
||||
|
||||
$cFGroup = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->find($cf_group_id);
|
||||
@@ -131,6 +133,7 @@ class ReportController extends Controller
|
||||
return $this->render('ChillReportBundle:Report:new.html.twig', array(
|
||||
'entity' => $entity,
|
||||
'form' => $form->createView(),
|
||||
'person' => $person
|
||||
));
|
||||
}
|
||||
|
||||
@@ -161,7 +164,8 @@ class ReportController extends Controller
|
||||
$em->persist($entity);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('report_show', array('id' => $entity->getId())));
|
||||
return $this->redirect($this->generateUrl('report_show',
|
||||
array('person_id' => $person_id,'id' => $entity->getId())));
|
||||
}
|
||||
|
||||
return $this->render('ChillReportBundle:Report:new.html.twig', array(
|
||||
@@ -196,21 +200,24 @@ class ReportController extends Controller
|
||||
* Finds and displays a Report entity.
|
||||
*
|
||||
*/
|
||||
public function showAction($id)
|
||||
public function showAction($id, $person_id)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
|
||||
|
||||
$entity = $em->getRepository('ChillReportBundle:Report')->find($id);
|
||||
|
||||
if (!$entity) {
|
||||
throw $this->createNotFoundException('Unable to find Report entity.');
|
||||
}
|
||||
|
||||
$deleteForm = $this->createDeleteForm($id);
|
||||
//$deleteForm = $this->createDeleteForm($id);
|
||||
|
||||
return $this->render('ChillReportBundle:Report:show.html.twig', array(
|
||||
'entity' => $entity,
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
'entity' => $entity,
|
||||
'person' => $person,
|
||||
//'delete_form' => $deleteForm->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user