Features/new phones

This commit is contained in:
Jean-Francois Monfort
2021-04-02 12:11:20 +00:00
committed by Julien Fastré
parent 6ea45e4d16
commit 27c680bb03
14 changed files with 502 additions and 123 deletions

View File

@@ -22,7 +22,7 @@ services:
$closingMotiveRepository: '@Chill\PersonBundle\Repository\ClosingMotiveRepository'
tags:
- { name: form.type, alias: closing_motive }
Chill\PersonBundle\Form\AccompanyingPeriodType:
arguments:
$config: "%chill_person.accompanying_period_fields%"
@@ -39,10 +39,17 @@ services:
- '@Symfony\Component\Translation\TranslatorInterface'
tags:
- { name: form.type }
Chill\PersonBundle\Form\Type\PersonAltNameType:
arguments:
$configHelper: '@Chill\PersonBundle\Config\ConfigPersonAltNamesHelper'
$translatableStringHelper: '@chill.main.helper.translatable_string'
tags:
- { name: form.type }
Chill\PersonBundle\Form\Type\PersonPhoneType:
arguments:
$phonenumberHelper: '@Chill\MainBundle\Phonenumber\PhonenumberHelper'
$em: '@Doctrine\ORM\EntityManagerInterface'
tags:
- { name: form.type }

View File

@@ -51,8 +51,9 @@ Chill\PersonBundle\Entity\Person:
- Chill\MainBundle\Validation\Constraint\PhonenumberConstraint:
type: mobile
groups: [ general, creation ]
otherPhoneNumbers:
- Valid:
traverse: true
constraints:
- Callback:
callback: isAccompanyingPeriodValid
@@ -77,3 +78,14 @@ Chill\PersonBundle\Entity\AccompanyingPeriod:
constraints:
- Callback:
callback: isDateConsistent
Chill\PersonBundle\Entity\PersonPhone:
properties:
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'
- Chill\MainBundle\Validation\Constraint\PhonenumberConstraint:
type: any
groups: [ general, creation ]