Commit 7d3737b4 authored by Anatole Rakotoson's avatar Anatole Rakotoson

sommom

parent 85ab2a40
......@@ -21,41 +21,34 @@
}
if (isset($el["_id"])) {
$communityLinks = Organization::getById((string)$el["_id"]);
}
$partenaire = false;
if (isset($communityLinks["links"]["members"])) {
foreach ($communityLinks["links"]["members"] as $memberId => $memberValue) {
if(isset(Yii::app()->session["userId"])){
if($memberId != ""){
if($memberId == Yii::app()->session["userId"]){
if(isset($memberValue["roles"])){
foreach ($memberValue["roles"] as $rolesId => $rolesValue) {
if($rolesValue == "Partenaire"){
$partenaire = true;
}
$communityLinks = Element::getCommunityByTypeAndId( Organization::COLLECTION, (string)$el["_id"]);
$partenaire = false;
$isAdm = false;
foreach ($communityLinks as $memberId => $memberValue) {
if(isset(Yii::app()->session["userId"])){
if($memberId != ""){
if($memberId == (string)Yii::app()->session["userId"]){
if (isset($memberValue["isAdmin"]) && $memberValue["isAdmin"] == true) {
$isAdm = true;
}else{
if(isset($memberValue["roles"])){
foreach ($memberValue["roles"] as $rolesId => $rolesValue) {
if($rolesValue == "Partenaire"){
$partenaire = true;
}
}
}
}
}
}
}
}
}
}
}
}
}
$adminStatus = false;
if (isset($this->costum["admins"])) {
if(is_array($this->costum["admins"])){
foreach ($this->costum["admins"] as $key => $value) {
if($key == Yii::app()->session["userId"]){
$adminStatus = true;
}
}
}
}
}
$paramsData = [
"role" => [
"Organisme impliqué dans le suivi, l’encadrement de l’activité d’observation" => "Organisme impliqué dans le suivi, l’encadrement de l’activité d’observation",
......@@ -161,7 +154,7 @@
foreach ($properties as $i => $inp) {
if (isset($inp["label"])){
if ($inp["label"] == "contact") {
if($adminStatus or $partenaire){
if($isAdm or $partenaire){
echo "<th>".$inp["label"]."</th>";
}
} else {
......@@ -182,7 +175,7 @@
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($i == "contact"){
if($adminStatus || $partenaire){
if($isAdm || $partenaire){
echo "<th>".$a[$i]."</th>";
}
}
......@@ -284,7 +277,7 @@
foreach ($properties as $i => $inp) {
if (isset($inp["label"])){
if ($inp["label"] == "contact") {
if($canEdit or $partenaire){
if($isAdm or $partenaire){
echo "<th>".$inp["label"]."</th>";
}
} else {
......@@ -308,7 +301,7 @@
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($i == "contact"){
if($canEdit or $partenaire){
if($isAdm or $partenaire){
echo "<td>".$a[$i]."</td>";
}
}
......
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