diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php index 521d9a9d9..664bfe15d 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php @@ -144,7 +144,10 @@ class PersonType extends AbstractType } if ($this->config['phonenumber'] === 'visible') { - $builder->add('phonenumber', TelType::class, array('required' => false)); + $builder->add('phonenumber', TelType::class, array( + 'required' => false, + // 'placeholder' => '+33623124554' //TODO placeholder for phone numbers + )); } if ($this->config['mobilenumber'] === 'visible') { @@ -167,7 +170,8 @@ class PersonType extends AbstractType 'delete_empty' => function(PersonPhone $pp = null) { return NULL === $pp || $pp->isEmpty(); }, - 'error_bubbling' => false + 'error_bubbling' => false, + 'empty_collection_explain' => 'No additional phone numbers' ]); if ($this->config['email'] === 'visible') { diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig index 0351d0ba1..781744bee 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig @@ -216,13 +216,23 @@ This view should receive those arguments: {%- if chill_person.fields.mobilenumber == 'visible' -%}
{{ 'Mobilenumber'|trans }} :
-
{% if person.mobilenumber is not empty %}
{{ person.mobilenumber|chill_format_phonenumber }}
{% else %}{{ 'No data given'|trans }}{% endif %}
+
{% if person.mobilenumber is not empty %}{{ person.mobilenumber|chill_format_phonenumber }}{% else %}{{ 'No data given'|trans }}{% endif %}
{% endif %} - {# TODO - display collection of others phonenumbers - #} + {%- if chill_person.fields.mobilenumber == 'visible' -%} + {% if person.otherPhoneNumbers is not empty %} +
+
{{ 'Others phone numbers'|trans }} :
+ {% for el in person.otherPhoneNumbers %} + {% if el.phonenumber is not empty %} +
{% if el.description is not empty %}{{ el.description }} : {% endif %}{{ el.phonenumber|chill_format_phonenumber }}
+ {% endif %} + {% endfor %} + +
+ {% endif %} + {% endif %} {%- if chill_person.fields.contact_info == 'visible' -%}
diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index af3ca6f05..64873d2ba 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -50,6 +50,8 @@ mobilenumber: numéro de téléphone portable Accept short text message ?: La personne a donné l'autorisation d'utiliser ce no de téléphone pour l'envoi de rappel par SMS Accept short text message: La personne a donné l'autorisation d'utiliser ce no de téléphone pour l'envoi de rappel par SMS Other phonenumber: Autre numéro de téléphone +Others phone numbers: Autres numéros de téléphone +No additional phone numbers: Aucun numéro de téléphone supplémentaire Description: description Add new phone: Ajouter un numéro de téléphone Remove phone: Supprimer