mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
choice of user in form
This commit is contained in:
parent
b91776c594
commit
88510942e5
@ -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();
|
||||
|
@ -36,9 +36,12 @@ class ReportType extends AbstractType
|
||||
$entityManager = $options['em'];
|
||||
|
||||
$builder
|
||||
->add('date', 'date', array('required' => false, 'widget' => 'single_text', 'format' => 'dd-MM-yyyy'))
|
||||
->add('user')
|
||||
->add('date', 'date',
|
||||
array('required' => false, 'widget' => 'single_text', 'format' => 'dd-MM-yyyy'))
|
||||
->add('scope')
|
||||
->add('cFData', 'custom_field', array('attr' => array('class' => 'only-label'), 'group' => $options['cFGroup']))
|
||||
->add('cFData', 'custom_field',
|
||||
array('attr' => array('class' => 'only-label'), 'group' => $options['cFGroup']))
|
||||
;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user