diff --git a/CHANGELOG.md b/CHANGELOG.md index 1794d5a36..de73733d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to * [main] fix adding multiple AddresseDeRelais (combine PickAddressType with ChillCollection) * [person]: do not suggest the current household of the person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/51) +* [person]: display other phone numbers in view + add message in case no others phone numbers (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/184) * unnecessary whitespace removed from person banner after person-id + double parentheses removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/290) * [person]: delete accompanying period work, including related objects (cascade) (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/36) * [address]: Display of incomplete address adjusted. 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 ef8e58bb1..7f9527b91 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