From 32c2763649dba30fdb3603fd612dea9240be8f0b Mon Sep 17 00:00:00 2001 From: "florian.azizian" <florian.azizian@maarch.org> Date: Fri, 7 Feb 2020 16:50:04 +0100 Subject: [PATCH] FIX #12346 TIME 0:10 validator translation --- src/app/contact/controllers/ContactController.php | 4 +++- src/core/lang/lang-en.php | 3 +++ src/core/lang/lang-fr.php | 3 +++ src/core/lang/lang-nl.php | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/contact/controllers/ContactController.php b/src/app/contact/controllers/ContactController.php index 7cc8ad17e56..4ef28d88ee0 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 9cbd853b2f6..ce08776d0f5 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 a279ac1e608..c25665a2aff 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 5184a302ce3..f34e39fc348 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 -- GitLab