|
|
@@ -179,6 +179,7 @@ class OrganizationFactory
|
|
|
$this->logger->warning('-- Operation ended with errors, check the logs for more information --');
|
|
|
} else {
|
|
|
$organizationCreationRequest->setStatus(OrganizationCreationRequest::STATUS_OK);
|
|
|
+ $this->logger->info("The organization has been created (id=".$organization->getId().").");
|
|
|
}
|
|
|
|
|
|
return $organization;
|
|
|
@@ -828,6 +829,7 @@ class OrganizationFactory
|
|
|
|
|
|
$this->entityManager->flush();
|
|
|
$this->entityManager->commit();
|
|
|
+ $this->logger->info("Organization deleted");
|
|
|
} catch (\Exception $e) {
|
|
|
$this->logger->critical("An error happened, operation cancelled\n".$e);
|
|
|
$this->entityManager->rollback();
|
|
|
@@ -836,6 +838,7 @@ class OrganizationFactory
|
|
|
|
|
|
try {
|
|
|
$this->deleteTypo3Website($organizationDeletionRequest->getOrganizationId());
|
|
|
+ $this->logger->info("Typo3 website deleted");
|
|
|
} catch (\Exception $e) {
|
|
|
$this->logger->critical('An error happened while deleting the Typo3 website, please proceed manually.');
|
|
|
$this->logger->debug($e);
|
|
|
@@ -844,6 +847,7 @@ class OrganizationFactory
|
|
|
|
|
|
try {
|
|
|
$this->switchDolibarrSocietyToProspect($organizationDeletionRequest->getOrganizationId());
|
|
|
+ $this->logger->info("Dolibarr society switched to prospect");
|
|
|
} catch (\Exception $e) {
|
|
|
$this->logger->critical('An error happened while updating the Dolibarr society, please proceed manually.');
|
|
|
$this->logger->debug($e);
|
|
|
@@ -852,6 +856,9 @@ class OrganizationFactory
|
|
|
|
|
|
try {
|
|
|
$this->fileManager->deleteOrganizationFiles($organizationDeletionRequest->getOrganizationId());
|
|
|
+ $this->logger->info("Organization files deleted");
|
|
|
+ } catch (\RuntimeException $e) {
|
|
|
+ // Nothing to delete
|
|
|
} catch (\Exception $e) {
|
|
|
$this->logger->critical("An error happened while deleting the organization's files, please proceed manually.");
|
|
|
$this->logger->debug($e);
|
|
|
@@ -861,12 +868,15 @@ class OrganizationFactory
|
|
|
foreach ($deletedPersonIds as $personId) {
|
|
|
try {
|
|
|
$this->fileManager->deletePersonFiles($personId);
|
|
|
+ } catch (\RuntimeException $e) {
|
|
|
+ // Nothing to delete
|
|
|
} catch (\Exception $e) {
|
|
|
$this->logger->critical("An error happened while deleting the person's files, please proceed manually (id=".$personId.').');
|
|
|
$this->logger->debug($e);
|
|
|
$withError = true;
|
|
|
}
|
|
|
}
|
|
|
+ $this->logger->info("Organization's persons files deleted");
|
|
|
|
|
|
if ($withError) {
|
|
|
$organizationDeletionRequest->setStatus(OrganizationDeletionRequest::STATUS_OK_WITH_ERRORS);
|
|
|
@@ -875,6 +885,10 @@ class OrganizationFactory
|
|
|
$organizationDeletionRequest->setStatus(OrganizationDeletionRequest::STATUS_OK);
|
|
|
}
|
|
|
|
|
|
+ $this->logger->info(
|
|
|
+ "The organization has been deleted."
|
|
|
+ );
|
|
|
+
|
|
|
return $organizationDeletionRequest;
|
|
|
}
|
|
|
|