Skip to content
Snippets Groups Projects
Commit 91ad0a02 authored by Alexandre Morin's avatar Alexandre Morin
Browse files

Merge branch 'hotfix/7011-controlAuthority' into 'develop'

add organization without service

See merge request !76
parents 4a4dfba8 12d1c32e
No related branches found
No related tags found
4 merge requests!100Develop,!84Release/2.2,!82Release/2.2,!76add organization without service
......@@ -59,15 +59,16 @@ class organization
*/
public function todisplay()
{
$currentOrg = \laabs::getToken("ORGANIZATION");
$orgList = [];
if (isset($currentOrg)) {
$orgUnitList = $this->getOwnerOriginatorsOrgs($currentOrg);
} else {
if (in_array('owner',$currentOrg->orgRoleCodes)) {
$owner = $this->getOrgsByRole('owner')[0];
$orgUnitList = $this->getOwnerOriginatorsOrgs($owner);
} else {
$orgUnitList = $this->getOwnerOriginatorsOrgs($currentOrg);
}
foreach ($orgUnitList as $org) {
......@@ -85,20 +86,10 @@ class organization
}
}
$organizations = $this->sdoFactory->index("organization/organization", array("orgId", "displayName", "isOrgUnit", "parentOrgId"), 'isOrgUnit = false');
if(isset($owner)){
$organizations = $this->sdoFactory->index("organization/organization", array("orgId", "displayName", "isOrgUnit", "parentOrgId","ownerOrgId"), 'isOrgUnit = false');
foreach ($orgList as $orgUnit) {
foreach ($organizations as $org) {
if(isset($orgUnit->parentOrgId)){
if($orgUnit->parentOrgId == $org->orgId){
$organization = \laabs::newInstance('organization/organization');
$organization->displayName = $org->displayName ;
$organization->orgId = $org->orgId ;
$organization->parentOrgId = $org->parentOrgId ;
$orgList[] = $organization;
}
}
}
$orgList = array_merge($orgList,$organizations);
}
foreach ($orgList as $org){
......@@ -132,7 +123,6 @@ class organization
$organizations = $this->getOwnerOriginatorsOrgs($owner);
}
foreach ($organizations as $org) {
foreach ($org->originators as $orgUnit) {
......@@ -1125,6 +1115,7 @@ class organization
}
}
$orgIdsSecurity = ($orgIdsSecurity) ? $orgIdsSecurity: [];
foreach ($userServices as $userService) {
foreach ($originators as $originator) {
if ($owner
......
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