Commit 8dafa781 authored by Alexis Ragot's avatar Alexis Ragot
Browse files

fix bug orgId != orgRegNumber

parent 9d2e7b35
......@@ -398,10 +398,18 @@ class archivalProfile
public function getdescendantArchivalProfiles()
{
$descendantArchivalProfiles = [];
$descendantServicesOrgId = [];
$descendantServices = \laabs::callService('organization/userPosition/readDescendantservices');
$archivalProfileAccesses = $this->sdoFactory->find('organization/archivalProfileAccess', "orgId=['". \laabs\implode("','" , $descendantServices)."']");
foreach ($descendantServices as $orgRegNumber) {
$organization = \laabs::callService('organization/organization/readByregnumber_registrationNumber_', $orgRegNumber);
if (!empty($organization)) {
$descendantServicesOrgId[] = $organization->orgId;
}
}
$archivalProfileAccesses = $this->sdoFactory->find('organization/archivalProfileAccess', "orgId=['". \laabs\implode("','" , $descendantServicesOrgId)."']");
foreach ($archivalProfileAccesses as $archivalProfileAccess) {
if (!empty($descendantArchivalProfiles[$archivalProfileAccess->archivalProfileReference])){
......
......@@ -85,14 +85,7 @@ class welcome
$archivalProfileController = \laabs::newController("recordsManagement/archivalProfile");
if (!empty($currentOrganization->registrationNumber)) {
try {
$archivalProfiles = \laabs::callService('recordsManagement/archivalProfile/readDescendantprofiles');
} catch (\Exception $exc) {
echo $exc->getTraceAsString();
exit;
}
$archivalProfiles = \laabs::callService('recordsManagement/archivalProfile/readDescendantprofiles');
foreach ($archivalProfiles as $archivalProfile) {
$archivalProfileController->readDetail($archivalProfile);
......
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