Commit 9a041781 authored by Anatole Rakotoson's avatar Anatole Rakotoson

sommom

parent 1af5652b
......@@ -54,12 +54,17 @@ class IndexAction extends CAction
$canSeeAnswer = Answer::canAccess($params["answer"], $form, Yii::app()->session['userId'], @$parentForm);
else
$canSeeAnswer = true;
if (isset($params["form"]["anyOnewithLinkCanAnswer"]) && $params["form"]["anyOnewithLinkCanAnswer"] == 'true') {
$canEditAnswer = true;
$canSeeAnswer = true;
}
}
if( $mode == "w" && $canEditAnswer === false && $canAdminAnswer === false )
$mode = "r";
if($canSeeAnswer === true){
if($canSeeAnswer === true ){
$params["canEditForm"] = $canEditForm;
$params["canAdminAnswer"] = $canAdminAnswer;
$params["canEdit"] = $canEditAnswer;
......@@ -69,15 +74,15 @@ class IndexAction extends CAction
echo $this->getController()->renderPartial($tpl,$params );
} else {
if(Yii::app()->request->isAjaxRequest)
echo $this->getController()->renderPartial("co2.views.default.unTpl",array("msg"=>Yii::t("common", "You are not allow to access to this answer"),"icon"=>"fa-lock"));
echo $this->getController()->renderPartial("co2.views.default.unTpl",array("msg"=>Yii::t("common", "You are not allowed to access to this answer"),"icon"=>"fa-lock"));
else
$this->getController()->render("co2.views.default.unTpl",array("msg"=>Yii::t("common", "You are not allow to access to this answer"),"icon"=>"fa-lock"));
$this->getController()->render("co2.views.default.unTpl",array("msg"=>Yii::t("common", "You are not allowed to access to this answer"),"icon"=>"fa-lock"));
}
} else {
if(Yii::app()->request->isAjaxRequest)
echo $this->getController()->renderPartial("co2.views.default.unTpl",array("msg"=>Yii::t("common", "You are not allow to access to this answer"),"icon"=>"fa-lock"));
echo $this->getController()->renderPartial("co2.views.default.unTpl",array("msg"=>Yii::t("common", "You are not allowed to access to this answer"),"icon"=>"fa-lock"));
else
$this->getController()->render("co2.views.default.unTpl",array("msg"=>Yii::t("common", "You are not allow to access to this answer"),"icon"=>"fa-lock"));
$this->getController()->render("co2.views.default.unTpl",array("msg"=>Yii::t("common", "You are not allowed to access to this answer"),"icon"=>"fa-lock"));
}
......
......@@ -35,7 +35,9 @@
}else{
if(isset($memberValue["roles"])){
if(in_array("Partenaire", $memberValue["roles"])){
$partenaire = true;
if (in_array($answer["answers"]["sommomForm1"]["sommomForm120"], $memberValue["roles"])) {
$partenaire = true;
}
}
}
}
......
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