Commit 447dfac5 by Alexandre Morin

Fix : No default organization

parent e4551df7
......@@ -59,6 +59,8 @@ abstract class abstractPosition
$positions = $this->listPositions();
$currentOrg = \laabs::getToken("ORGANIZATION");
$organizations = [];
$setToken = false;
foreach ($positions as $position) {
$organization = $this->sdoFactory->read('organization/organization', $position->orgId);
......@@ -67,9 +69,14 @@ abstract class abstractPosition
if ($position->default && !$currentOrg) {
\laabs::setToken("ORGANIZATION", $organization, 86400);
$setToken = true;
}
$organizations[] = $organization;
}
if (!$setToken && !$currentOrg) {
\laabs::setToken("ORGANIZATION", $organizations[0], 86400);
}
return $positions;
}
......
Markdown is supported
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