Skip to content
Snippets Groups Projects
Commit b30bc3c7 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Merge branch 'fix/7330-eventOutgoingTransfer' into 'develop'

Fix : #7330 - Adding event 'outgoing transfer'

See merge request !41
parents ae5a24d2 ece5747a
No related branches found
No related tags found
5 merge requests!100Develop,!60Hotfix/2.1.3,!59Hotfix/2.1.3,!52Feature/6800 modification of rentention rule,!41Fix : #7330 - Adding event 'outgoing transfer'
INSERT INTO "lifeCycle"."eventFormat" ("type", "format", "notification", "message") VALUES
('recordsManagement/outgoingTransfer', 'resId hashAlgorithm hash address originatorOrgRegNumber archiverOrgRegNumber size', FALSE, 'Transfert sortant de l''archive %6$s');
\ No newline at end of file
......@@ -35,6 +35,7 @@ class archive
archiveComplianceTrait,
archiveConversionTrait,
archiveDestructionTrait,
archiveOutgoingTransferTrait,
archiveLifeCycleTrait;
/**
......
......@@ -215,6 +215,18 @@ trait archiveLifeCycleTrait
return $this->logLifeCycleEvent('recordsManagement/restitution', $archive, $operationResult);
}
/**
* Log an archive outgoing transfer
* @param recordsManagement/archive $archive The archive
* @param bool $operationResult The operation result
*
* @return mixed The created event or the list of created event
*/
public function logOutgoingTransfer($archive, $operationResult = true)
{
return $this->logLifeCycleEvent('recordsManagement/outgoingTransfer', $archive, $operationResult);
}
/**
* Log an archive retention rule modification
* @param recordsManagement/archive $archive The archive
......
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle recordsManagement.
*
* Bundle recordsManagement is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle recordsManagement is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle recordsManagement. If not, see <http://www.gnu.org/licenses/>.
*/
namespace bundle\recordsManagement\Controller;
/**
* Trait for archives restitution
*/
trait archiveOutgoingTransferTrait
{
/**
* Transfer an archive
* @param string $archiveId The identifier of the archive
*
* @return recordsManagement/archive The archive transferred
*/
public function outgoingTransfer($archiveId)
{
$this->verifyIntegrity($archiveId);
$archive = $this->retrieve($archiveId);
$statusChanged = $this->setStatus((string) $archive->archiveId, "transfered");
$valid = count($statusChanged["success"]) ? true : false;
// Life cycle journal
$this->logOutgoingTransfer($archive, $valid);
return $valid ? $archive : null;
}
}
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