person: add show hide on some fields + remove unknown genderType

This commit is contained in:
nobohan
2021-06-18 11:28:02 +02:00
parent bccaf5ad6e
commit 3d14f00cac
6 changed files with 61 additions and 11 deletions

View File

@@ -127,7 +127,7 @@ class PersonType extends AbstractType
->add('mobilenumber', TelType::class, array('required' => false))
->add('acceptSMS', CheckboxType::class, array(
'value' => false,
'required' => true //TODO required only if mobilenumber is filled
'required' => true
));
}
@@ -149,7 +149,7 @@ class PersonType extends AbstractType
if ($this->config['email'] === 'visible') {
$builder
->add('email', EmailType::class, array('required' => false))
->add('acceptEmail', CheckboxType::class, array('required' => false));//TODO visible only if email is filled
->add('acceptEmail', CheckboxType::class, array('required' => false));
}
if ($this->config['country_of_birth'] === 'visible') {

View File

@@ -24,8 +24,7 @@ class GenderType extends AbstractType {
$a = array(
Person::MALE_GENDER => Person::MALE_GENDER,
Person::FEMALE_GENDER => Person::FEMALE_GENDER,
Person::BOTH_GENDER => Person::BOTH_GENDER,
Person::NO_INFORMATION => Person::NO_INFORMATION
Person::BOTH_GENDER => Person::BOTH_GENDER
);
$resolver->setDefaults(array(