Commit 626786c4 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Merge branch 'fix/21614_disable_delete_used_archival_profile' into 'release/2.9'

Fix/21614 disable delete used archival profile

See merge request !736
parents 3a787cd9 888a9b24
Pipeline #19745 failed with stages
in 21 seconds
......@@ -359,14 +359,27 @@ class archivalProfile
*/
public function isUsed($archivalProfile)
{
$archivalProfileReference = $archivalProfile->reference;
$archivalAgreementController = \laabs::newController('medona/archivalAgreement');
$archivalAgreement = $archivalAgreementController->getByProfileReference($archivalProfile->reference);
if (!empty($archivalAgreement)) {
return false;
return true;
}
$archivalProfileAccessController = \laabs::newController('organization/organization');
$archivalProfileAccess = $archivalProfileAccessController->getArchivalProfileAccess(null,$archivalProfileReference);
if (!empty($archivalProfileAccess)) {
return true;
}
return (bool) $this->sdoFactory->count('recordsManagement/archive', "archivalProfileReference = '$archivalProfile->reference'");
if((bool) $this->sdoFactory->count('recordsManagement/archivalProfileContents', "containedProfileId = '$archivalProfile->archivalProfileId'")) {
return true;
}
if((bool) $this->sdoFactory->count('recordsManagement/archive', "archivalProfileReference = '$archivalProfileReference'")) {
return true;
}
return false;
}
/**
......
......@@ -69,7 +69,6 @@ class archivalProfile
$dataTable->setUnsortableColumns(3);
$this->view->translate();
$this->view->setSource("profile", $archivalProfiles);
$this->view->merge();
......
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