Commit 45fbbb5f authored by Kgneo's avatar Kgneo
Browse files

up espace CO

parent 152b127a
......@@ -29,21 +29,7 @@
<li class="submenucoop sub-rooms"><hr></li>
<?php if(@$access=="deny"){ ?>
<li class="padding-10 submenucoop sub-rooms">
<h5 class="padding-left-10 letter-red">
<i class="fa fa-ban"></i> Vous n'êtes pas autorisé à accéder à ce contenu
</h5>
<?php if(!isset(Yii::app()->session['userId'])){ ?>
<h5 class="padding-left-10">
<small class="letter-orange"><i class="fa fa-user-circle"></i> Vous n'êtes pas connecté</small>
</h5>
<?php } ?>
<h5 class="padding-left-10 letter-red">
<small>Devenez membre ou contributeur</small>
</h5>
</li>
<?php exit; } ?>
<?php if(@$access=="deny"){ exit; } ?>
<div id="coop-room-list" class="margin-bottom-50">
<?php $this->renderPartial('../cooperation/roomList', array("roomList"=>$menuCoopData["roomList"],
......@@ -76,15 +62,15 @@
foreach($allStatus as $status=>$tradStatus){ ?>
<li class="submenucoop sub-proposals">
<a href="javascript:" class="load-coop-data" data-type="proposal" data-status="<?php echo $status ?>">
<i class="fa fa-<?php echo Cooperation::getIconCoop($status); ?>"></i> <?php echo Yii::t("cooperation", $tradStatus) ?>
<span class="badge pull-right bg-<?php echo Cooperation::getColorCoop($status); ?> margin-right-10">
<?php echo @$menuCoopData["allCount"]["proposals"][$status]; ?>
</span>
</a>
</li>
<?php } ?>
<li class="submenucoop sub-proposals">
<a href="javascript:" class="load-coop-data" data-type="proposal" data-status="<?php echo $status ?>">
<i class="fa fa-<?php echo Cooperation::getIconCoop($status); ?>"></i> <?php echo Yii::t("cooperation", $tradStatus) ?>
<span class="badge pull-right bg-<?php echo Cooperation::getColorCoop($status); ?> margin-right-10">
<?php echo @$menuCoopData["allCount"]["proposals"][$status]; ?>
</span>
</a>
</li>
<?php } ?>
......@@ -96,30 +82,30 @@
</a>
</li>
<li class="submenucoop hidden sub-actions"><hr></li>
<li class="submenucoop hidden sub-actions"><hr></li>
<?php $allStatus = array("todo"=>"To do",
"disabled"=> "Disabled",
"done" => "Done");
if(Yii::app()->session['userId'])
$allStatus["mine"] = "My actions";
<?php $allStatus = array("todo"=>"To do",
"disabled"=> "Disabled",
"done" => "Done");
if(Yii::app()->session['userId'])
$allStatus["mine"] = "My actions";
foreach($allStatus as $status=>$tradStatus){ ?>
foreach($allStatus as $status=>$tradStatus){ ?>
<li class="submenucoop sub-actions">
<a href="javascript:" class="load-coop-data" data-type="action" data-status="<?php echo $status ?>">
<i class="fa fa-<?php echo Cooperation::getIconCoop($status); ?>"></i>
<?php echo Yii::t("cooperation", $tradStatus) ?>
<span class="badge pull-right bg-<?php echo Cooperation::getColorCoop($status); ?> margin-right-10">
<?php echo @$menuCoopData["allCount"]["actions"][$status]; ?>
</span>
</a>
</li>
<?php } ?>
<li class="submenucoop sub-actions">
<a href="javascript:" class="load-coop-data" data-type="action" data-status="<?php echo $status ?>">
<i class="fa fa-<?php echo Cooperation::getIconCoop($status); ?>"></i>
<?php echo Yii::t("cooperation", $tradStatus) ?>
<span class="badge pull-right bg-<?php echo Cooperation::getColorCoop($status); ?> margin-right-10">
<?php echo @$menuCoopData["allCount"]["actions"][$status]; ?>
</span>
</a>
</li>
<?php } ?>
<li class="submenucoop sub-rooms margin-top-50"></li>
<li class="submenucoop sub-rooms margin-top-50"></li>
<!-- ----------- RESOLUTION --------------- -->
<li class="hidden">
......
......@@ -35,8 +35,11 @@
if(isset(Yii::app()->session['userId'])){
$me = Element::getByTypeAndId("citoyens", Yii::app()->session['userId']);
$myRoles = @$me["links"]["memberOf"][@$parentId]["roles"] ?
@$me["links"]["memberOf"][@$parentId]["roles"] : array();
$link = "memberOf";
if($parentType == "projects") $link = "projects";
if($parentType == "organizations") $link = "memberOf";
$myRoles = @$me["links"][$link][@$parentId]["roles"] ?
@$me["links"][$link][@$parentId]["roles"] : array();
}else{
$myRoles = array();
}
......@@ -54,7 +57,7 @@
<div class="col-lg-12 col-md-12 col-sm-12 no-padding bg-white text-dark" id="coop-container">
<?php
<?php
if(isset($roomList) && empty(@$roomList)){ ?>
<div class="col-lg-12 col-md-12 col-sm-12" id="menu-room">
<?php $this->renderPartial('../cooperation/pod/home', array("type"=>$thisType)); ?>
......@@ -135,11 +138,15 @@
<?php echo Yii::t("cooperation", "You are not logged"); ?>
</small>
</h5>
<br>
<button class="btn btn-link bg-orange" data-toggle="modal" data-target="#modalLogin">
<i class="fa fa-sign-in"></i> <?php echo Yii::t("cooperation", "Login to enter in this space"); ?>
</button>
<?php }else{ ?>
<h5 class="padding-left-10 letter-red">
<small><?php echo Yii::t("cooperation", "You must be member or contributor"); ?></small>
</h5>
<?php } ?>
<h5 class="padding-left-10 letter-red">
<small><?php echo Yii::t("cooperation", "You must be member or contributor"); ?></small>
</h5>
</div>
<?php exit; } ?>
......@@ -155,10 +162,25 @@
else foreach (@$room["roles"] as $r) $rolesLabel .= $rolesLabel == "" ? $r : ", ".$r;
?>
<h5 class="padding-left-10 letter-red">
<small>
<?php echo Yii::t("cooperation", "This space is open only for this roles"); ?> :
<small class="letter-blue">
<b><?php echo Yii::t("cooperation", "This space is open only for this roles"); ?> : </b>
<?php echo Yii::t("cooperation", $rolesLabel); ?>
</small>
</small>
<br>
<small>
<b><?php echo Yii::t("cooperation", "My roles"); ?> : </b>
<?php if(!empty($myRoles))
foreach ($myRoles as $key => $role) { ?>
<?php echo $role; ?>
<?php }else{ ?>
<?php echo Yii::t("cooperation", "You have no role in"); ?>
<?php echo Yii::t("cooperation", "this ".$thisType); ?>
<br><br>
<i class="fa fa-info-circle"></i>
<?php echo Yii::t("cooperation", "Ask an admin to get the appropriated role to access this space"); ?>
<?php } ?>
</small>
</h5>
</div>
<?php exit; } ?>
......
......@@ -18,7 +18,7 @@
Yii::app()->createUrl('/'.@$element['profilThumbImageUrl'])
: $this->module->assetsUrl.'/images/thumbnail-default.jpg';
$slugParent = @$element["slug"] ? $element["slug"] : "#page.".$type.$data[$type]["parentType"].$element["_id"];
$slugParent = @$element["slug"] ? $element["slug"] : "#page.type.".$data[$type]["parentType"].".id.".$element["_id"];
$urlInCoSpace = "#".$slugParent.".view.coop.room.".$data[$type]["idParentRoom"].".".$type.".".$dataId;
?>
......
......@@ -15,16 +15,47 @@
if(isset(Yii::app()->session['userId'])){
$me = Element::getByTypeAndId("citoyens", Yii::app()->session['userId']);
$myRoles = @$me["links"]["memberOf"][@$proposal["parentId"]]["roles"] ?
@$me["links"]["memberOf"][@$proposal["parentId"]]["roles"] : array();
if($proposal["parentType"] == "projects") $link = "projects";
if($proposal["parentType"] == "organizations") $link = "memberOf";
$myRoles = @$me["links"][$link][@$proposal["parentId"]]["roles"] ?
@$me["links"][$link][@$proposal["parentId"]]["roles"] : array();
}else{
$myRoles = array();
}
?>
<?php
//lock access if the user doesnt have the good role
$accessRoom = @$parentRoom ? Room::getAccessByRole($parentRoom, $myRoles) : "";
if($accessRoom == "lock") exit;
if($accessRoom == "lock") {
?>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h4 class="letter-turq load-coop-data title-room"
data-type="room" data-dataid="<?php echo @$proposal["idParentRoom"]; ?>">
<i class="fa fa-connectdevelop"></i> <i class="fa fa-hashtag"></i> <?php echo @$parentRoom["name"]; ?>
</h4>
<h5 class="padding-left-10 letter-red">
<i class="fa fa-ban"></i> <?php echo Yii::t("cooperation","You are not allowed to access this content"); ?>
</h5>
<?php if(@$parentRoom["roles"] && @$parentRoom["roles"] != ""){ ?>
<?php
$roomRoles = @$parentRoom["roles"];
if(!is_array(@$parentRoom["roles"]))
$roomRoles = explode(",", @$parentRoom["roles"]);
?>
<h5 class="room-desc">
<small class="letter-blue">
<b><i class="fa fa-unlock-alt"></i> <?php echo Yii::t("cooperation","Access restricted only for"); ?> : </b>
<?php $r = ""; foreach ($roomRoles as $role) {
if($r!="") $r.=", "; $r.=$role;
} echo $r; ?>
</small>
</h5>
<?php } ?>
</div>
<?php exit; } ?>
<?php if(@$access=="deny"){ ?>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
......@@ -32,9 +63,9 @@
<i class="fa fa-ban"></i> <?php echo Yii::t("cooperation","You are not allowed to access this content"); ?>
</h5>
<h5 class="padding-left-10 letter-red">
<small><?php echo Yii::t("cooperation","You must be member or contributor"); ?></small>
<small><?php echo Yii::t("cooperation","You must be member or contributor to read and participate"); ?></small>
</h5>
</div>
</div>yes
<?php exit; } ?>
<?php if(@$proposal["idParentRoom"]){ ?>
......
......@@ -4,8 +4,11 @@
if(isset(Yii::app()->session['userId'])){
$me = Element::getByTypeAndId("citoyens", Yii::app()->session['userId']);
$myRoles = @$me["links"]["memberOf"][@$parentId]["roles"] ?
@$me["links"]["memberOf"][@$parentId]["roles"] : array();
$link = "memberOf";
if($parentType == "projects") $link = "projects";
if($parentType == "organizations") $link = "memberOf";
$myRoles = @$me["links"][$link][@$parentId]["roles"] ?
@$me["links"][$link][@$parentId]["roles"] : array();
}else{
$myRoles = array();
}
......
......@@ -90,7 +90,7 @@
#ajax-modal .modal-content,
#formContact .modal-content{
background-color: rgba(0,0,0,0.6);
/*background-color: rgba(0,0,0,0.6);*/
}
#ajax-modal .container,
#formContact .container{
......@@ -100,13 +100,13 @@
#ajax-modal.portfolio-modal,
#formContact.portfolio-modal {
background-color: transparent;
}
}/*
#ajax-modal .close-modal .lr,
#ajax-modal .close-modal .rl,
#formContact .close-modal .lr,
#formContact .close-modal .rl{
background-color: #fff;
}
}*/
#btn-show-activity-onmap{
width:100%;
......
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