mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
improve form attributes
This commit is contained in:
parent
4578625bb2
commit
156f306daa
@ -117,6 +117,13 @@ class EventController extends Controller
|
||||
/** @var Center $centers */
|
||||
$centers = $this->authorizationHelper->getReachableCenters($this->getUser(), $role);
|
||||
|
||||
if (count($centers) === 1)
|
||||
{
|
||||
return $this->redirectToRoute('chill_event__event_new', array(
|
||||
'center_id' => $centers[0]->getId()
|
||||
));
|
||||
}
|
||||
|
||||
$form = $this->formFactoryInterface
|
||||
->createNamedBuilder(null)
|
||||
->setMethod('GET')
|
||||
@ -126,19 +133,13 @@ class EventController extends Controller
|
||||
'class' => Center::class,
|
||||
'choices' => $centers,
|
||||
'placeholder' => '',
|
||||
'label' => 'To which centre should the event be associated ?'
|
||||
'label' => 'To which centre should the event be associated ?',
|
||||
'csrf_protection' => false // works ?!
|
||||
))
|
||||
->add('submit', SubmitType::class, array(
|
||||
'label' => 'Next step'
|
||||
))
|
||||
->getForm();
|
||||
|
||||
if (count($centers) === 1)
|
||||
{
|
||||
return $this->redirectToRoute('chill_event__event_new', array(
|
||||
'center_id' => $centers[0]->getId()
|
||||
));
|
||||
}
|
||||
|
||||
return $this->render('ChillEventBundle:Event:newPickCenter.html.twig', array(
|
||||
'form' => $form->createView()
|
||||
|
@ -115,7 +115,9 @@ class EventType extends AbstractType
|
||||
->add('type', PickEventType::class)
|
||||
->add('moderator', UserPickerType::class, array(
|
||||
'center' => $options['center'],
|
||||
'role' => $options['role']
|
||||
'role' => $options['role'],
|
||||
'placeholder' => '',
|
||||
'required' => false
|
||||
))
|
||||
;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user