diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php index bf2d18922..4218174eb 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php @@ -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() diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php index 85b8619c2..abe4750f2 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php @@ -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 diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig index a8fc88f5e..80c1e76f9 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig @@ -95,6 +95,11 @@