Commit fb56142f authored by Alexis Ragot's avatar Alexis Ragot
Browse files

get descendant archival profiles to fix the search view in the main screen

parent caf84d16
......@@ -389,4 +389,27 @@ class archivalProfile
return $orgUnitArchivalProfiles;
}
/**
* Get descendant archival profiles
*
* @return array
*/
public function getdescendantArchivalProfiles()
{
$descendantArchivalProfiles = [];
$descendantServices = \laabs::callService('organization/userPosition/readDescendantservices');
$archivalProfileAccesses = $this->sdoFactory->find('organization/archivalProfileAccess', "orgId=['". \laabs\implode("','" , $descendantServices)."']");
foreach ($archivalProfileAccesses as $archivalProfileAccess) {
if (!empty($descendantArchivalProfiles[$archivalProfileAccess->archivalProfileReference])){
continue;
}
$descendantArchivalProfiles[$archivalProfileAccess->archivalProfileReference] = $this->getByReference($archivalProfileAccess->archivalProfileReference);
}
return $descendantArchivalProfiles;
}
}
......@@ -100,4 +100,11 @@ interface archivalProfileInterface
* @action recordsManagement/archivalProfile/getOrgUnitArchivalProfiles
*/
public function readOrgunitprofiles($orgRegNumber, $originatorAccess=false);
/**
* Get descendant profiles
*
* @action recordsManagement/archivalProfile/getdescendantArchivalProfiles
*/
public function readDescendantprofiles();
}
......@@ -85,7 +85,14 @@ class welcome
$archivalProfileController = \laabs::newController("recordsManagement/archivalProfile");
if (!empty($currentOrganization->registrationNumber)) {
$archivalProfiles = \laabs::callService('recordsManagement/archivalProfile/readOrgunitprofiles', $currentOrganization->registrationNumber);
try {
$archivalProfiles = \laabs::callService('recordsManagement/archivalProfile/readDescendantprofiles');
} catch (\Exception $exc) {
echo $exc->getTraceAsString();
exit;
}
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