diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index fa49dac3a..678084045 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -255,9 +255,6 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface /** * @ORM\Column(name="telephone", type="phone_number", nullable=true) - * @Assert\Regex("/^([\+{1}])([0-9\s*]{4,20})$/", - * message="Invalid phone number: it should begin with the international prefix starting with ""+"", hold only digits and be smaller than 20 characters. Ex: +33123456789" - * ) * @PhonenumberConstraint(type="any") * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) */ diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 7ca5188b1..480808dfe 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\ThirdPartyBundle\Form; use Chill\MainBundle\Form\Type\ChillCollectionType; +use Chill\MainBundle\Form\Type\ChillPhoneNumberType; use Chill\MainBundle\Form\Type\ChillTextareaType; use Chill\MainBundle\Form\Type\PickAddressType; use Chill\MainBundle\Form\Type\PickCenterType; @@ -75,7 +76,7 @@ class ThirdPartyType extends AbstractType ->add('name', TextType::class, [ 'required' => true, ]) - ->add('telephone', TextType::class, [ + ->add('telephone', ChillPhoneNumberType::class, [ 'label' => 'Phonenumber', 'required' => false, ])