mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 10:03:49 +00:00
fix deprecations: set choices_as_values = true + flip content of choices options
This commit is contained in:
@@ -31,6 +31,7 @@ use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Chill\MainBundle\Form\Type\DataTransformer\ScopeTransformer;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
/**
|
||||
* Trait to add an input with reachable scope for a given center and role.
|
||||
|
@@ -28,6 +28,7 @@ use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Security\RoleProvider;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
/**
|
||||
* Form to Edit/create a role scope. If the role scope does not
|
||||
|
@@ -22,6 +22,8 @@ namespace Chill\MainBundle\Form\Type\Export;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
use Chill\MainBundle\Export\ExportManager;
|
||||
|
||||
/**
|
||||
|
@@ -6,6 +6,7 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
use Chill\MainBundle\Form\UserPasswordType;
|
||||
|
||||
class UserType extends AbstractType
|
||||
@@ -28,11 +29,12 @@ class UserType extends AbstractType
|
||||
$builder->add($builder
|
||||
->create('enabled', ChoiceType::class, array(
|
||||
'choices' => array(
|
||||
0 => 'Disabled, the user is not allowed to login',
|
||||
1 => 'Enabled, the user is active'
|
||||
'Disabled, the user is not allowed to login' => 0,
|
||||
'Enabled, the user is active' => 1
|
||||
),
|
||||
'expanded' => false,
|
||||
'multiple' => false
|
||||
'multiple' => false,
|
||||
'choices_as_values' => true // Can be removed when upgraded to Sf3.
|
||||
))
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user