diff --git a/src/app/contact/controllers/ContactController.php b/src/app/contact/controllers/ContactController.php index 7cc8ad17e56a4335128178d5cddab656a6c827a8..4ef28d88ee08683deacfe7bcbe242fa7eca12eb5 100755 --- a/src/app/contact/controllers/ContactController.php +++ b/src/app/contact/controllers/ContactController.php @@ -140,6 +140,8 @@ class ContactController $body['communicationMeans'] = ['email' => $body['communicationMeans']]; } elseif (filter_var($body['communicationMeans'], FILTER_VALIDATE_URL)) { $body['communicationMeans'] = ['url' => $body['communicationMeans']]; + } else { + return $response->withStatus(400)->withJson(['errors' => _COMMUNICATION_MEANS_VALIDATOR]); } } @@ -1036,7 +1038,7 @@ class ContactController if (!empty($body['externalId']['m2m'])) { $businessId = explode("/", $body['externalId']['m2m']); if (!AnnuaryController::isSiretNumber(['siret' => $businessId[0]])) { - return ['errors' => "Wrong format for externalId[m2m]. It must be SIRET/entityId"]; + return ['errors' => _EXTERNALID_M2M_VALIDATOR]; } } diff --git a/src/core/lang/lang-en.php b/src/core/lang/lang-en.php index 9cbd853b2f66e5cabfbbae816896892c6dac2fce..ce08776d0f5838f9a6924a919637354e929da961 100755 --- a/src/core/lang/lang-en.php +++ b/src/core/lang/lang-en.php @@ -461,6 +461,9 @@ define("_UPDATE_AVIS_CIRCUIT", "Opinion workflow updated"); define("_VISA_CIRCUIT_DELETED", "Visa workflow deleted"); define("_AVIS_CIRCUIT_DELETED", "Opinion workflow updated"); +define("_COMMUNICATION_MEANS_VALIDATOR", "Communication Means should be an url or an email"); +define("_EXTERNALID_M2M_VALIDATOR", "Wrong format for externalId[m2m]. It must be SIRET/entityId"); + define("_ACKNOWLEDGEMENT_RECEIPT", "Acknowledgement Receipt"); define("_CREATED_BY", "Created by"); define("_SENT_DATE", "Sent "); diff --git a/src/core/lang/lang-fr.php b/src/core/lang/lang-fr.php index a279ac1e60807edf22dc23c3a51e5c5ea1134064..c25665a2affe6b76e23956a22a4859b630dde87d 100755 --- a/src/core/lang/lang-fr.php +++ b/src/core/lang/lang-fr.php @@ -460,6 +460,9 @@ define("_UPDATE_AVIS_CIRCUIT", "Circuit d'avis mis à jour"); define("_VISA_CIRCUIT_DELETED", "Circuit de visa supprimé"); define("_AVIS_CIRCUIT_DELETED", "Circuit d'avis supprimé"); +define("_COMMUNICATION_MEANS_VALIDATOR", "Le moyen de communication doit être une uri ou un courriel"); +define("_EXTERNALID_M2M_VALIDATOR", "L'identifiant Maarch2Maarch doit être au format SIRET/entityId"); + define("_ACKNOWLEDGEMENT_RECEIPT", "Accusé de réception"); define("_CREATED_BY", "Créé par"); define("_SENT_DATE", "Envoyé le"); diff --git a/src/core/lang/lang-nl.php b/src/core/lang/lang-nl.php index 5184a302ce3456e33cb1c4180a85e7b167fa2b91..f34e39fc348bad20fc8d48e42b8d32e0ddc9df08 100755 --- a/src/core/lang/lang-nl.php +++ b/src/core/lang/lang-nl.php @@ -466,6 +466,9 @@ define("_UPDATE_AVIS_CIRCUIT", "Opinion workflow updated"); //TO TRANSLATE define("_VISA_CIRCUIT_DELETED", "Visa workflow deleted"); //TO TRANSLATE define("_AVIS_CIRCUIT_DELETED", "Opinion workflow updated"); //TO TRANSLATE +define("_COMMUNICATION_MEANS_VALIDATOR", "Communication Means should be an url or an email"); //TO TRANSLATE +define("_EXTERNALID_M2M_VALIDATOR", "Wrong format for externalId[m2m]. It must be SIRET/entityId"); //TO TRANSLATE + define("_ACKNOWLEDGEMENT_RECEIPT", "Acknowledgement Receipt"); //TO TRANSLATE define("_CREATED_BY", "Created by"); //TO TRANSLATE define("_SENT_DATE", "Sent "); //TO TRANSLATE