Verified Commit 38ed9d63 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Change status of archives only when archiver closes transaction

no when recipient aknowlegdes
parent 327cac51
...@@ -340,11 +340,6 @@ class ArchiveRestitution extends abstractMessage ...@@ -340,11 +340,6 @@ class ArchiveRestitution extends abstractMessage
$requestMessage->unitIdentifier = $this->sdoFactory->readChildren('medona/unitIdentifier', $requestMessage); $requestMessage->unitIdentifier = $this->sdoFactory->readChildren('medona/unitIdentifier', $requestMessage);
foreach ($requestMessage->unitIdentifier as $unitIdentifier) {
$this->archiveController->setStatus($unitIdentifier->objectId, 'restituted');
}
$eventInfo = array(); $eventInfo = array();
$eventInfo['type'] = "ArchiveRestitution"; $eventInfo['type'] = "ArchiveRestitution";
$eventInfo['senderOrgRegNumber'] = $message->senderOrgRegNumber; $eventInfo['senderOrgRegNumber'] = $message->senderOrgRegNumber;
...@@ -406,6 +401,11 @@ class ArchiveRestitution extends abstractMessage ...@@ -406,6 +401,11 @@ class ArchiveRestitution extends abstractMessage
$this->sdoFactory->update($message, "medona/message"); $this->sdoFactory->update($message, "medona/message");
$requestMessage = $this->sdoFactory->find('medona/message', "type='ArchiveRestitutionRequest' AND senderOrgRegNumber='".$message->recipientOrgRegNumber."' AND replyReference='".$message->relatedReference."'")[0];
$requestMessage->unitIdentifier = $this->sdoFactory->readChildren('medona/unitIdentifier', $requestMessage);
foreach ($requestMessage->unitIdentifier as $unitIdentifier) {
$this->archiveController->setStatus($unitIdentifier->objectId, 'restituted');
}
$this->changeStatus($messageId, "validated"); $this->changeStatus($messageId, "validated");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment