add email and phonenumber: wrote migration file, changed templates, changed validation rules

This commit is contained in:
nobohan
2018-05-18 17:41:33 +02:00
parent 3eb96c4479
commit e9698f2cbc
9 changed files with 118 additions and 16 deletions

View File

@@ -31,8 +31,12 @@ Chill\PersonBundle\Entity\Person:
memo:
type: text
default: ''
contactInfo:
type: text
nullable: true
email:
type: text
nullable: true
proxyAccompanyingPeriodOpenState:
type: boolean
name: proxy_open
@@ -41,6 +45,11 @@ Chill\PersonBundle\Entity\Person:
phonenumber:
type: text
nullable: true
length: 40
mobilenumber:
type: text
nullable: true
length: 40
manyToOne:
countryOfBirth:
targetEntity: Chill\MainBundle\Entity\Country

View File

@@ -34,11 +34,12 @@ Chill\PersonBundle\Entity\Person:
- Email:
groups: [general, creation]
message: 'The email "{{ value }}" is not a valid email.'
checkMX: true
phonenumber:
- Regex:
pattern: '/^([\+{1}]|[0])([0-9\s*]{4,20})$/'
pattern: '/^([\+{1}])([0-9\s*]{4,20})$/'
groups: [general, creation]
message: 'Invalid phone number: it should begin with "0" or "+", hold only digits and be smaller than 20 characters '
message: 'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33123456789 '
constraints: