person: re-add accpet email and add possibility of hidding this field

This commit is contained in:
nobohan 2021-10-28 09:45:27 +02:00
parent c90f9ee5bc
commit 046f65f5ff
3 changed files with 11 additions and 0 deletions

View File

@ -82,6 +82,7 @@ class Configuration implements ConfigurationInterface
->append($this->addFieldNode('accompanying_period'))
->append($this->addFieldNode('memo'))
->append($this->addFieldNode('number_of_children'))
->append($this->addFieldNode('acceptEmail'))
->arrayNode('alt_names')
->defaultValue([])
->arrayPrototype()

View File

@ -166,6 +166,11 @@ class PersonType extends AbstractType
->add('email', EmailType::class, array('required' => false));
}
if ($this->config['acceptEmail'] === 'visible') {
$builder
->add('acceptEmail', CheckboxType::class, array('required' => false));
}
if ($this->config['country_of_birth'] === 'visible') {
$builder->add('countryOfBirth', Select2CountryType::class, array(
'required' => false

View File

@ -95,6 +95,11 @@
<div id="personEmail">
{{ form_row(form.email, {'label': 'Email'}) }}
</div>
{% endif %}
{%- if form.acceptEmail is defined -%}
<div id="personAcceptEmail">
{{ form_row(form.acceptEmail, {'label' : 'Accept emails ?'}) }}
</div>
{%- endif -%}
{%- if form.phonenumber is defined -%}