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

repaired orgs

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