Commit e96da0c6 authored by Julien Minet's avatar Julien Minet

add email and mobile number to person: last modif and translations

parent e9698f2c
Pipeline #53023 failed with stages
in 50 seconds
......@@ -39,12 +39,12 @@ class PersonController extends Controller
* @var SimilarPersonMatcher
*/
protected $similarPersonMatcher;
public function __construct(SimilarPersonMatcher $similarPersonMatcher)
{
$this->similarPersonMatcher = $similarPersonMatcher;
}
public function getCFGroup()
{
$cFGroup = null;
......@@ -119,7 +119,7 @@ class PersonController extends Controller
if ( ! $form->isValid() ) {
$this->get('session')
->getFlashBag()->add('error', 'Thp person data provided'
->getFlashBag()->add('error', 'The person data provided'
. ' are not valid');
return $this->render('ChillPersonBundle:Person:edit.html.twig',
......
This diff is collapsed.
......@@ -33,13 +33,18 @@ Chill\PersonBundle\Entity\Person:
email:
- Email:
groups: [general, creation]
message: 'The email "{{ value }}" is not a valid email.'
message: 'The email is not valid'
checkMX: true
phonenumber:
- Regex:
pattern: '/^([\+{1}])([0-9\s*]{4,20})$/'
groups: [general, creation]
message: 'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33123456789 '
message: 'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33123456789'
mobilenumber:
- Regex:
pattern: '/^([\+{1}])([0-9\s*]{4,20})$/'
groups: [general, creation]
message: 'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33623456789'
constraints:
......
......@@ -40,7 +40,7 @@ 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
'Contact information: remarks': 'Remarques'
'Notes on contact information': 'Remarques sur les informations de contact'
'Remarks': 'Remarques'
'{0} Born the %date% | {1} Born the %date%': '{0} le %date% | {1} Née le %date%'
'Spoken languages': 'Langues parlées'
......
......@@ -12,7 +12,9 @@
'Closing date can not be null': 'La date de fermeture ne peut être nulle'
The date of closing is before the date of opening: La période de fermeture est après la période d'ouverture
The birthdate must be before %date%: La date de naissance doit être avant le %date%
'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33123456789': 'Numéro de téléphone invalide: il doit commencer par le préfixe international précédé de "+", ne comporter que des chiffres et faire moins de 20 caractères. Ex: +31623456789'
'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33623456789': 'Numéro de téléphone invalide: il doit commencer par le préfixe international précédé de "+", ne comporter que des chiffres et faire moins de 20 caractères. Ex: +33623456789'
'The email is not valid': 'Le courriel n''est pas valide'
Two addresses has the same validFrom date: La date de validité est identique à celle d'une autre adresse
#export list
......
......@@ -66,7 +66,7 @@
</fieldset>
{%- endif -%}
{%- if form.email is defined or form.phonenumber is defined or form.mobilenumber is defined or form.contact_info is defined-%}
{%- if form.email is defined or form.phonenumber is defined or form.mobilenumber is defined or form.contactInfo is defined-%}
<fieldset>
<legend><h2>{{ 'Contact information'|trans }}</h2></legend>
{%- if form.email is defined -%}
......@@ -78,8 +78,8 @@
{%- if form.mobilenumber is defined -%}
{{ form_row(form.mobilenumber, {'label': 'Mobilenumber'}) }}
{%- endif -%}
{%- if form.contact_info is defined -%}
{{ form_row(form.contact_info, {'label': 'Contact information: remarks'}) }}
{%- if form.contactInfo is defined -%}
{{ form_row(form.contactInfo, {'label': 'Notes on contact information'}) }}
{%- endif -%}
</fieldset>
{%- endif -%}
......
......@@ -162,7 +162,7 @@ This view should receive those arguments:
</figure>
</div>
{%- endif -%}
{%- if chill_person.fields.email == 'visible' or chill_person.fields.phonenumber == 'visible' -%}
{%- if chill_person.fields.email == 'visible' or chill_person.fields.phonenumber == 'visible' or chill_person.fields.mobilenumber == 'visible' or chill_person.fields.contact_info == 'visible' -%}
<div class="grid-6">
<figure class="person-details">
<h2 class="chill-blue"><i class="fa fa-envelope-o"></i>&nbsp;{{ 'Contact information'|trans }}</h2>
......@@ -217,8 +217,8 @@ This view should receive those arguments:
{% endif %}
{%- if chill_person.fields.contact_info == 'visible' -%}
<dl>
<dt>{{ 'Remarks'|trans }}&nbsp;:</dt>
<dd>{% if person.contactInfo is not empty %}<blockquote class="chill-user-quote">{{ person.contactInfo|nl2br }}</blockquote>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>{% endif %}</dd>
<dt>{{ 'Notes on contact information'|trans }}&nbsp;:</dt>
<dd>{% if person.contactInfo is not empty %}{{ person.contactInfo|nl2br }}{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>{% endif %}</dd>
</dl>
{%- endif -%}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment