Commit 09c9956f authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

repaired orgs

parent 3d147fd3
......@@ -57,20 +57,18 @@ $orgs = [];
foreach ($organizations as $id => $or) {
$roles = null;
if(!empty($or["links"]) &&
!empty($or["links"]["memberOf"]) &&
!empty($or["links"]["memberOf"][$this->costum["contextId"]]) &&
!empty($or["links"]["memberOf"][$this->costum["contextId"]]["roles"]) )
$roles = $or["links"]["memberOf"][$this->costum["contextId"]]["roles"];
if( $paramsData["limitRoles"] && !empty($roles))
if( isset( $communityLinks[$id]["roles"] ) )
$roles = $communityLinks[$id]["roles"];
if( $paramsData["limitRoles"] && !empty($roles) )
{
foreach ($roles as $i => $r)
{
foreach ($roles as $i => $r) {
if( in_array($r, $paramsData["limitRoles"]) )
$orgs[$id] = $or["name"];
}
}
}
//var_dump($orgs);exit;
//var_dump($orgs); exit;
$listLabels = array_merge(Ctenat::$financerTypeList,$orgs);
$properties = [
......
......@@ -72,11 +72,13 @@ $organizations = Link::groupFindByType( Organization::COLLECTION,$communityLinks
$orgs = [];
foreach ($organizations as $id => $or) {
if( isset($or["links"]["memberOf"][$this->costum["contextId"]]["roles"]) )
$roles = $or["links"]["memberOf"][ $this->costum["contextId"] ]["roles"];
if( $paramsData["limitRoles"] && !empty($roles))
$roles = null;
if( isset( $communityLinks[$id]["roles"] ) )
$roles = $communityLinks[$id]["roles"];
if( $paramsData["limitRoles"] && !empty($roles) )
{
foreach ($roles as $i => $r)
{
foreach ($roles as $i => $r) {
if( in_array($r, $paramsData["limitRoles"]) )
$orgs[$id] = $or["name"];
}
......@@ -395,9 +397,12 @@ echo "<h4 style='color:".(($titleColor) ? $titleColor : "black")."'>Suivi des d
</div>
<div class="form-worker" style="display:none;">
<select id="worker" style="width:100%;">
<option>Choisir un maitre d'oeuvre</option>
<?php foreach ($orgs as $v => $f) {
<?php
foreach ($orgs as $v => $f) {
echo "<option value='".$v."'>".$f."</option>";
} ?>
</select>
......
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