mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
person: capitalise place of birth (frontend + backend)
This commit is contained in:
parent
6a1cf4eb92
commit
b800b62e88
@ -35,6 +35,7 @@ use Chill\PersonBundle\Form\Type\Select2MaritalStatusType;
|
|||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||||
use Chill\MainBundle\Form\Type\CommentType;
|
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\EmailType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TelType;
|
use Symfony\Component\Form\Extension\Core\Type\TelType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
@ -114,7 +115,19 @@ class PersonType extends AbstractType
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->config['place_of_birth'] === 'visible') {
|
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') {
|
if ($this->config['contact_info'] === 'visible') {
|
||||||
@ -192,6 +205,7 @@ class PersonType extends AbstractType
|
|||||||
array('attr' => array('class' => 'cf-fields'), 'group' => $options['cFGroup']))
|
array('attr' => array('class' => 'cf-fields'), 'group' => $options['cFGroup']))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -143,11 +143,3 @@
|
|||||||
{% block js %}
|
{% block js %}
|
||||||
{{ encore_entry_script_tags('page_person') }}
|
{{ encore_entry_script_tags('page_person') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block css %}
|
|
||||||
<style>
|
|
||||||
input#chill_personbundle_person_placeOfBirth {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{% endblock %}
|
|
Loading…
x
Reference in New Issue
Block a user