diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php index 8bc982713..f2fd8ea3a 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php @@ -35,6 +35,7 @@ use Chill\PersonBundle\Form\Type\Select2MaritalStatusType; use Symfony\Component\Form\AbstractType; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\CommentType; +use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\Form\Extension\Core\Type\EmailType; use Symfony\Component\Form\Extension\Core\Type\TelType; use Symfony\Component\Form\Extension\Core\Type\TextType; @@ -114,7 +115,19 @@ class PersonType extends AbstractType } if ($this->config['place_of_birth'] === 'visible') { - $builder->add('placeOfBirth', TextType::class, array('required' => false)); + $builder->add('placeOfBirth', TextType::class, array( + 'required' => false, + 'attr' => ['style' => 'text-transform: uppercase;'], + )); + + $builder->get('placeOfBirth')->addModelTransformer(new CallbackTransformer( + function ($string) { + return strtoupper($string); + }, + function ($string) { + return strtoupper($string); + } + )); } if ($this->config['contact_info'] === 'visible') { @@ -192,6 +205,7 @@ class PersonType extends AbstractType array('attr' => array('class' => 'cf-fields'), 'group' => $options['cFGroup'])) ; } + } /** diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig index 98ac7c5d0..fdbc0d8ad 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig @@ -143,11 +143,3 @@ {% block js %} {{ encore_entry_script_tags('page_person') }} {% endblock %} - -{% block css %} - -{% endblock %} \ No newline at end of file