diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php index 42c625baa..d576822a9 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php @@ -34,9 +34,12 @@ use Chill\PersonBundle\Entity\PersonPhone; 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\Extension\Core\Type\EmailType; use Symfony\Component\Form\Extension\Core\Type\TelType; use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\Extension\Core\Type\IntegerType; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -82,8 +85,17 @@ class PersonType extends AbstractType ->add('birthdate', ChillDateType::class, [ 'required' => false, ]) + ->add('deathdate', ChillDateType::class, [ + 'required' => false, + ]) ->add('gender', GenderType::class, array( 'required' => true + )) + ->add('genderComment', CommentType::class, array( + 'required' => false + )) + ->add('numberOfChildren', IntegerType::class, array( + 'required' => false )); if ($this->configAltNamesHelper->hasAltNames()) { @@ -111,7 +123,12 @@ class PersonType extends AbstractType } if ($this->config['mobilenumber'] === 'visible') { - $builder->add('mobilenumber', TelType::class, array('required' => false)); + $builder + ->add('mobilenumber', TelType::class, array('required' => false)) + ->add('acceptSMS', CheckboxType::class, array( + 'value' => false, + 'required' => true //TODO required only if mobilenumber is filled + )); } $builder->add('otherPhoneNumbers', ChillCollectionType::class, [ @@ -130,7 +147,9 @@ class PersonType extends AbstractType ]); if ($this->config['email'] === 'visible') { - $builder->add('email', EmailType::class, array('required' => false)); + $builder + ->add('email', EmailType::class, array('required' => false)) + ->add('acceptEmail', CheckboxType::class, array('required' => false));//TODO visible only if email is filled } if ($this->config['country_of_birth'] === 'visible') { @@ -153,9 +172,16 @@ class PersonType extends AbstractType } if ($this->config['marital_status'] === 'visible'){ - $builder->add('maritalStatus', Select2MaritalStatusType::class, array( - 'required' => false - )); + $builder + ->add('maritalStatus', Select2MaritalStatusType::class, array( + 'required' => false + )) + ->add('maritalStatusDate', ChillDateType::class, array( + 'required' => false + )) + ->add('maritalStatusComment', CommentType::class, array( + 'required' => false + )); } if($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 a69253695..66e1cb6e6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig @@ -43,6 +43,7 @@ {{ form_widget(form.altNames, { 'label': 'Alternative names'}) }} {% endif %} {{ form_row(form.gender, {'label' : 'Gender'}) }} + {{ form_row(form.genderComment, { 'label' : 'Comment on the gender'} ) }}
@@ -54,6 +55,9 @@ {%- if form.countryOfBirth is defined -%} {{ form_row(form.countryOfBirth, { 'label' : 'Country of birth' } ) }} {%- endif -%} + {%- if form.deathdate is defined -%} + {{ form_row(form.deathdate, { 'label' : 'Date of death' } ) }} + {%- endif -%}
{%- if form.nationality is defined or form.spokenLanguages is defined or form.maritalStatus is defined -%} @@ -65,8 +69,11 @@ {%- if form.spokenLanguages is defined -%} {{ form_row(form.spokenLanguages, {'label' : 'Spoken languages'}) }} {%- endif -%} + {{ form_row(form.numberOfChildren, {'label' : 'Number of children'}) }} {%- if form.maritalStatus is defined -%} {{ form_row(form.maritalStatus, { 'label' : 'Marital status'} ) }} + {{ form_row(form.maritalStatusDate, { 'label' : 'Date of last marital status change'} ) }} + {{ form_row(form.maritalStatusComment, { 'label' : 'Comment on the marital status'} ) }} {%- endif -%} {%- endif -%} @@ -76,12 +83,14 @@

{{ 'Contact information'|trans }}

{%- if form.email is defined -%} {{ form_row(form.email, {'label': 'Email'}) }} + {{ form_row(form.acceptEmail, {'label' : 'Accept emails ?'}) }} {%- endif -%} {%- if form.phonenumber is defined -%} {{ form_row(form.phonenumber, {'label': 'Phonenumber'}) }} {%- endif -%} {%- if form.mobilenumber is defined -%} {{ form_row(form.mobilenumber, {'label': 'Mobilenumber'}) }} + {{ form_row(form.acceptSMS, {'label' : 'Accept short text message ?'}) }} {%- endif -%} {%- if form.otherPhoneNumbers is defined -%} {{ form_widget(form.otherPhoneNumbers) }} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index cd65950a0..e6f33355c 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -10,6 +10,8 @@ First name or Last name: Prénom ou nom id: identifiant Birthdate: 'Date de naissance' birthdate: date de naissance +deathdate: date de décès +Date of death: Date de décès 'Date of birth': 'Date de naissance' dateOfBirth: date de naissance dateofbirth: date de naissance @@ -30,16 +32,20 @@ placeOfBirth: lieu de naissance countryOfBirth: 'Pays de naissance' 'Unknown country of birth': 'Pays inconnu' 'Marital status': 'État civil' +Date of last marital status change: État civil depuis le +Comment on the marital status: Commentaires sur l'état civil 'Number of children': 'Nombre d''enfants' '{0} No child|{1} One child | ]1,Inf] %nb% children': '{0} Aucun enfant|{1} Un enfant | ]1,Inf] %nb% enfants' 'National number': 'Numéro national' Email: 'Courrier électronique' +Accept emails ?: Accepte les courriels? Address: Adresse Memo: Mémo Phonenumber: 'Numéro de téléphone' phonenumber: numéro de téléphone Mobilenumber: 'Numéro de téléphone portable' mobilenumber: numéro de téléphone portable +Accept short text message ?: Accepte les SMS? Other phonenumber: Autre numéro de téléphone Description: description Add new phone: Ajouter un numéro de téléphone