Verified Commit 745f930b authored by Alexandre Morin's avatar Alexandre Morin
Browse files

fix (#10533) : problem of unique keys to unit identifier

parent a03626f3
......@@ -903,13 +903,19 @@ trait archiveAccessTrait
* Change the status of an archive
* @param mixed $archiveIds Identifiers of the archives to update
* @param string $status New status to set
* @param bool $isUnFreeze
*
* @return array Archives ids separate by successfully updated archives ['success'] and not updated archives ['error']
*/
public function setStatus($archiveIds, $status)
public function setStatus($archiveIds, $status, $unFreeze = false)
{
$statusList = [];
$statusList['preserved'] = array('frozen', 'disposable', 'error', 'restituable', 'transferable');
if ($unFreeze) {
$statusList['preserved'] = array('frozen', 'disposable', 'error', 'restituable', 'transferable');
} else {
$statusList['preserved'] = array('disposable', 'error', 'restituable', 'transferable');
}
$statusList['restituable'] = array('preserved');
$statusList['restituted'] = array('restituable');
$statusList['transfered'] = array('transferable');
......
......@@ -47,6 +47,12 @@ trait archiveDestructionTrait
foreach ($archiveChildrenIds as $archiveChildrenId) {
$archive = $this->sdoFactory->read('recordsManagement/archive', $archiveChildrenId);
foreach ($archives as $a) {
if ($a->archiveId == $archive->archiveId) {
continue 2;
}
}
$this->checkRights($archive);
$this->checkDisposalRights($archive) ;
......
......@@ -351,7 +351,7 @@ trait archiveModificationTrait
$archives[$archiveId] = $archive;
}
$res = $this->setStatus($archiveIds, 'preserved');
$res = $this->setStatus($archiveIds, 'preserved', true);
for ($i = 0, $count = count($res['success']); $i < $count; $i++) {
......
......@@ -304,7 +304,7 @@ class archiveModification
$this->json->message = sprintf($this->json->message, $success);
if ($echec > 0) {
$message = ' %1$s restitution(s) can not be canceled.';
$message = '%1$s restitution(s) can not be canceled.';
$message = $this->translator->getText($message);
$message = sprintf($message, $echec);
......
......@@ -399,7 +399,7 @@ msgid "recordsManagement/archives/updateSetforrestitution"
msgstr "Paramétrer une archive pour la restitution"
msgid "recordsManagement/archives/updateDisposearchives"
msgstr "Modification d'un dépôt d'archive"
msgstr "Demande de destruction"
msgid "recordsManagement/archives/cancelDestruction"
msgstr "Annuler une destruction"
......
......@@ -746,10 +746,10 @@ msgstr "%1$s archive(s) ne sont pas dégelée(s)."
msgid "%1$s restitution(s) can not be validate(s)."
msgstr "%1$s restitution(s) ne sont pas validée(s)."
msgid "%1$s restitution(s) can not be canceled.'"
msgid "%1$s restitution(s) can not be canceled."
msgstr "%1$s restitution(s) ne sont pas annulée(s)."
msgid "%1$s destruction(s) can not be canceled.'"
msgid "%1$s destruction(s) can not be canceled."
msgstr "%1$s destruction(s) ne sont pas annulée(s)."
msgid "%1$s resource(s) can\'t be deleted."
......
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