choice of user in form

This commit is contained in:
Marc Ducobu
2014-11-12 12:49:02 +01:00
parent b91776c594
commit 88510942e5
2 changed files with 6 additions and 5 deletions

View File

@@ -106,6 +106,7 @@ class ReportController extends Controller
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
$entity = new Report();
$entity->setUser($this->get('security.context')->getToken()->getUser());
$cFGroup = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->find($cf_group_id);
$entity->setCFGroup($cFGroup);
@@ -139,9 +140,6 @@ class ReportController extends Controller
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
$entity->setPerson($person);
$user = $this->get('security.context')->getToken()->getUser();
$entity->setUser($user);
$em->persist($entity);
$em->flush();