Skip to content
Snippets Groups Projects
Commit e48e94c6 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #15047 TIME 1:10 Improve msg error in export seda action

parent 2da65f42
No related branches found
No related tags found
No related merge requests found
...@@ -71,7 +71,7 @@ class SedaController ...@@ -71,7 +71,7 @@ class SedaController
$sedaXml = CoreConfigModel::getXmlLoaded(['path' => 'modules/export_seda/xml/config.xml']); $sedaXml = CoreConfigModel::getXmlLoaded(['path' => 'modules/export_seda/xml/config.xml']);
if (empty($sedaXml->CONFIG->senderOrgRegNumber)) { if (empty($sedaXml->CONFIG->senderOrgRegNumber)) {
return $response->withStatus(400)->withJson(['errors' => 'No senderOrgRegNumber found in config.xml (export_seda)']); return $response->withStatus(400)->withJson(['errors' => 'No senderOrgRegNumber found in config.xml (export_seda)', 'lang' => 'noSenderOrgRegNumber']);
} }
$date = new \DateTime(); $date = new \DateTime();
...@@ -182,17 +182,17 @@ class SedaController ...@@ -182,17 +182,17 @@ class SedaController
]; ];
} }
$archivalAgreements = SedaController::getArchivalAgreements([ $archivalAgreements = SedaController::getArchivalAgreements([
'configXml' => $sedaXml, 'configXml' => $sedaXml,
'senderArchiveEntity' => (string)$sedaXml->CONFIG->senderOrgRegNumber, 'senderArchiveEntity' => (string)$sedaXml->CONFIG->senderOrgRegNumber,
'producerService' => $entity['producer_service'] 'producerService' => $entity['producer_service']
]); ]);
if (!empty($archivalAgreements['error'])) { if (!empty($archivalAgreements['errors'])) {
return $response->withStatus(400)->withJson(['errors' => 'ArchivalAgreements error : ' . $archivalAgreements['error']]); return $response->withStatus(400)->withJson($archivalAgreements);
} }
$recipientArchiveEntities = SedaController::getRecipientArchiveEntities(['configXml' => $sedaXml, 'archivalAgreements' => $archivalAgreements['archivalAgreements']]); $recipientArchiveEntities = SedaController::getRecipientArchiveEntities(['configXml' => $sedaXml, 'archivalAgreements' => $archivalAgreements['archivalAgreements']]);
if (!empty($recipientArchiveEntities['error'])) { if (!empty($recipientArchiveEntities['errors'])) {
return $response->withStatus(400)->withJson(['errors' => 'ArchivalEntities error : ' . $recipientArchiveEntities['error']]); return $response->withStatus(400)->withJson($recipientArchiveEntities);
} }
$return['archivalAgreements'] = $archivalAgreements['archivalAgreements']; $return['archivalAgreements'] = $archivalAgreements['archivalAgreements'];
...@@ -217,7 +217,9 @@ class SedaController ...@@ -217,7 +217,9 @@ class SedaController
]); ]);
if (!empty($curlResponse['errors'])) { if (!empty($curlResponse['errors'])) {
return ['error' => 'Error during processing in getRecipientArchiveEntities : ' . $curlResponse['errors']]; return ['errors' => 'Error returned by the route /organization/organization/Byrole/archiver : ' . $curlResponse['errors']];
} elseif ($curlResponse['code'] != 200) {
return ['errors' => 'Error returned by the route /organization/organization/Byrole/archiver : ' . $curlResponse['response']['message']];
} }
$archiveEntitiesAllowed = array_column($args['archivalAgreements'], 'archiveEntityRegNumber'); $archiveEntitiesAllowed = array_column($args['archivalAgreements'], 'archiveEntityRegNumber');
...@@ -267,14 +269,16 @@ class SedaController ...@@ -267,14 +269,16 @@ class SedaController
]); ]);
if (!empty($curlResponse['errors'])) { if (!empty($curlResponse['errors'])) {
return ['error' => 'Error during processing in getArchivalAgreements : ' . $curlResponse['errors']]; return ['errors' => 'Error returned by the route /medona/archivalAgreement/Index : ' . $curlResponse['errors']];
} elseif ($curlResponse['code'] != 200) {
return ['errors' => 'Error returned by the route /medona/archivalAgreement/Index : ' . $curlResponse['response']['message']];
} }
$producerService = SedaController::getProducerServiceInfo(['configXml' => $args['configXml'], 'producerServiceName' => $args['producerService']]); $producerService = SedaController::getProducerServiceInfo(['configXml' => $args['configXml'], 'producerServiceName' => $args['producerService']]);
if (!empty($producerService['errors'])) { if (!empty($producerService['errors'])) {
return ['error' => 'Error during processing in getArchivalAgreements producer service info : ' . $curlResponse['errors']]; return ['errors' => $curlResponse['errors']];
} elseif (empty($producerService['producerServiceInfo'])) { } elseif (empty($producerService['producerServiceInfo'])) {
return ['error' => 'ProducerService does not exists in MaarchRM']; return ['errors' => 'ProducerService does not exists in MaarchRM', 'lang' => 'producerServiceDoesNotExists'];
} }
$archivalAgreements[] = [ $archivalAgreements[] = [
...@@ -321,7 +325,9 @@ class SedaController ...@@ -321,7 +325,9 @@ class SedaController
]); ]);
if (!empty($curlResponse['errors'])) { if (!empty($curlResponse['errors'])) {
return ['error' => $curlResponse['errors']]; return ['errors' => 'Error returned by the route /organization/organization/Search : ' . $curlResponse['errors']];
} elseif ($curlResponse['code'] != 200) {
return ['errors' => 'Error returned by the route /organization/organization/Search : ' . $curlResponse['response']['message']];
} }
return ['producerServiceInfo' => $curlResponse['response'][0]]; return ['producerServiceInfo' => $curlResponse['response'][0]];
...@@ -352,7 +358,9 @@ class SedaController ...@@ -352,7 +358,9 @@ class SedaController
]); ]);
if (!empty($curlResponse['errors'])) { if (!empty($curlResponse['errors'])) {
return $response->withStatus(400)->withJson(['errors' => 'Error during processing in getRetentionRules : ' . $curlResponse['errors']]); return $response->withStatus(400)->withJson(['errors' => 'Error returned by the route /recordsManagement/retentionRule/Index : ' . $curlResponse['errors']]);
} elseif ($curlResponse['code'] != 200) {
return $response->withStatus(400)->withJson(['errors' => 'Error returned by the route /recordsManagement/retentionRule/Index : ' . $curlResponse['response']['message']]);
} }
$retentionRules[] = [ $retentionRules[] = [
......
...@@ -2057,7 +2057,7 @@ ...@@ -2057,7 +2057,7 @@
"manualSearchInfo" : "Vous pouvez laisser le terme dans le champ sans sélectionner de valeur pour la recherche.", "manualSearchInfo" : "Vous pouvez laisser le terme dans le champ sans sélectionner de valeur pour la recherche.",
"groupSign" : "Groupe du signataire", "groupSign" : "Groupe du signataire",
"noAdminSearchConfiguration": "Aucune configuration de recherche trouvée", "noAdminSearchConfiguration": "Aucune configuration de recherche trouvée",
"producerService": "Service producteur", "producerService": "Identifiant de service producteur",
"sendersDepartment": "Département des expéditeurs", "sendersDepartment": "Département des expéditeurs",
"recordManagement": "Archivage électronique", "recordManagement": "Archivage électronique",
"slipLabel": "Libellé du bordereau", "slipLabel": "Libellé du bordereau",
...@@ -2078,6 +2078,11 @@ ...@@ -2078,6 +2078,11 @@
"recordManagement_replyNotReadable": "La réponse de transfert de ce courrier n'est pas correctement structurée", "recordManagement_replyNotReadable": "La réponse de transfert de ce courrier n'est pas correctement structurée",
"recordManagement_noReplyReference": "Aucun bordereau correspond à la réponse de transfert", "recordManagement_noReplyReference": "Aucun bordereau correspond à la réponse de transfert",
"recordManagement_wrongReply": "La réponse de transfert n'est pas lié au bon courrier", "recordManagement_wrongReply": "La réponse de transfert n'est pas lié au bon courrier",
"noDestination": "Le courrier n'a pas d'entité traitante",
"noRetentionInfo": "Le type de courrier n'a pas de règle de conservation ou de sort final",
"noProducerService": "L'entité traitante n'a pas d'identifiant de service producteur",
"noSenderOrgRegNumber": "Aucun service versant défini (Balise senderOrgRegNumber dans config.xml)",
"producerServiceDoesNotExists": "Le service producteur n'existe pas dans MaarchRM",
"nextPage": "Page suivante", "nextPage": "Page suivante",
"prevPage": "Page précédente", "prevPage": "Page précédente",
"onlySingleResourceAllowed": "Seule une ressource peut être traité par cette action" "onlySingleResourceAllowed": "Seule une ressource peut être traité par cette action"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment