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

This commit is contained in:
nobohan 2018-05-21 09:56:46 +02:00
parent e9698f2cbc
commit e96da0c641
7 changed files with 86 additions and 78 deletions

View File

@ -119,7 +119,7 @@ class PersonController extends Controller
if ( ! $form->isValid() ) { if ( ! $form->isValid() ) {
$this->get('session') $this->get('session')
->getFlashBag()->add('error', 'Thp person data provided' ->getFlashBag()->add('error', 'The person data provided'
. ' are not valid'); . ' are not valid');
return $this->render('ChillPersonBundle:Person:edit.html.twig', return $this->render('ChillPersonBundle:Person:edit.html.twig',

View File

@ -56,9 +56,10 @@ class ListPerson implements ListInterface, ExportElementValidatedInterface
protected $fields = array( protected $fields = array(
'id', 'firstName', 'lastName', 'birthdate', 'id', 'firstName', 'lastName', 'birthdate',
'placeOfBirth', 'gender', 'memo', 'email', 'phonenumber', 'placeOfBirth', 'gender', 'memo', 'email', 'phonenumber',
'countryOfBirth', 'nationality', 'address_street_address_1', 'mobilenumber', 'contactInfo', 'countryOfBirth', 'nationality',
'address_street_address_2', 'address_valid_from', 'address_postcode_label', 'address_street_address_1', 'address_street_address_2',
'address_postcode_code', 'address_country_name', 'address_country_code' 'address_valid_from', 'address_postcode_label', 'address_postcode_code',
'address_country_name', 'address_country_code'
); );
public function __construct( public function __construct(

View File

@ -33,13 +33,18 @@ Chill\PersonBundle\Entity\Person:
email: email:
- Email: - Email:
groups: [general, creation] groups: [general, creation]
message: 'The email "{{ value }}" is not a valid email.' message: 'The email is not valid'
checkMX: true checkMX: true
phonenumber: phonenumber:
- Regex: - Regex:
pattern: '/^([\+{1}])([0-9\s*]{4,20})$/' pattern: '/^([\+{1}])([0-9\s*]{4,20})$/'
groups: [general, creation] 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: constraints:

View File

@ -40,7 +40,7 @@ Phonenumber: 'Numéro de téléphone'
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'
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' 'Remarks': 'Remarques'
'{0} Born the %date% | {1} Born the %date%': '{0} Né le %date% | {1} Née le %date%' '{0} Born the %date% | {1} Born the %date%': '{0} Né le %date% | {1} Née le %date%'
'Spoken languages': 'Langues parlées' 'Spoken languages': 'Langues parlées'

View File

@ -12,7 +12,9 @@
'Closing date can not be null': 'La date de fermeture ne peut être nulle' '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 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% 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 Two addresses has the same validFrom date: La date de validité est identique à celle d'une autre adresse
#export list #export list

View File

@ -66,7 +66,7 @@
</fieldset> </fieldset>
{%- endif -%} {%- 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> <fieldset>
<legend><h2>{{ 'Contact information'|trans }}</h2></legend> <legend><h2>{{ 'Contact information'|trans }}</h2></legend>
{%- if form.email is defined -%} {%- if form.email is defined -%}
@ -78,8 +78,8 @@
{%- if form.mobilenumber is defined -%} {%- if form.mobilenumber is defined -%}
{{ form_row(form.mobilenumber, {'label': 'Mobilenumber'}) }} {{ form_row(form.mobilenumber, {'label': 'Mobilenumber'}) }}
{%- endif -%} {%- endif -%}
{%- if form.contact_info is defined -%} {%- if form.contactInfo is defined -%}
{{ form_row(form.contact_info, {'label': 'Contact information: remarks'}) }} {{ form_row(form.contactInfo, {'label': 'Notes on contact information'}) }}
{%- endif -%} {%- endif -%}
</fieldset> </fieldset>
{%- endif -%} {%- endif -%}

View File

@ -162,7 +162,7 @@ This view should receive those arguments:
</figure> </figure>
</div> </div>
{%- endif -%} {%- 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"> <div class="grid-6">
<figure class="person-details"> <figure class="person-details">
<h2 class="chill-blue"><i class="fa fa-envelope-o"></i>&nbsp;{{ 'Contact information'|trans }}</h2> <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 %} {% endif %}
{%- if chill_person.fields.contact_info == 'visible' -%} {%- if chill_person.fields.contact_info == 'visible' -%}
<dl> <dl>
<dt>{{ 'Remarks'|trans }}&nbsp;:</dt> <dt>{{ 'Notes on contact information'|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> <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> </dl>
{%- endif -%} {%- endif -%}