Commit 7fc7828f authored by Clément Damiens's avatar Clément Damiens
Browse files

Up proprio & operator demo & acces & market & right

parent 495f1c84
var answerObject={
delete : function(id, callB){
getAjax("",baseUrl+"/survey/co/delete/id/"+id,function(){
if(notNull(callB))
callB();
else{
toastr.success("La candidature a été supprimée avec succès");
$("#allAnswersList .ansline"+id).remove();
}
},"html");
}
}
\ No newline at end of file
......@@ -417,11 +417,8 @@ class Form {
public static function canSeeAnswer($userId, $answer, $form, $parentForm){
if(self::canEditAnswer($userId, $answer, $form, $parentForm))
return true;
// else if(Costum::sameFunction("canSeeAnswer", array("answer"=>$answer))){
// return true;
// }
else if(Costum::isSameFunction("canEditAnswer", array("answer"=>$answer)))
return Costum::sameFunction("canEditAnswer", array("answer"=>$answer));
else if(Costum::isSameFunction("canSeeAnswer", array("answer"=>$answer)))
return Costum::sameFunction("canSeeAnswer", array("answer"=>$answer));
return false;
}
public static function canEditAnswer($userId, $answer, $form, $parentForm){
......
......@@ -3,7 +3,7 @@
#allAnswersList li{ padding:5px; border-bottom: 1px solid #ccc; }
</style>
<div class="col-xs-12 text-center">
<div class="col-xs-12 text-center dash-answers">
<a href="javascript:;" class='btn btn- btn-default' id="showAnswerBtn<?php echo @$viewDom ?>"><i class="fa fa-bars"></i> Les <?php echo $what ?></a>
<a href="#dashboard" class='lbh btn btn-default'><i class="fa fa-area-chart"></i> Observatoire Global</a>
<a href="#community" class='lbh btn btn-default'><i class="fa fa-group"></i> Communauté</a>
......
<?php
//check show btn use cases
// role is financer or operater
if( Form::canFormAccess( ['roles'=>["Financeur","opérateur"] ]))
if( Form::canFormAccess( ['roles'=>["Financeur","Opérateur"] ]))
{
if( isset($form['id']) )
{ ?>
......@@ -86,8 +87,21 @@ if( Form::canFormAccess( ['roles'=>["Financeur","opérateur"] ]))
</tbody>
</table>
<?php
} ?>
}} else { ?>
<div class="col-xs-12 text-center margin-top-50 well">
<?php if(@$answer["step"] && $answer["step"]=="deal1"){ ?>
<span style="font-size: 22px;font-weight: 800;">Vous avez soumis votre dossier pour qu'un opérateur se positionne dessus.<br/>Il est en cours de validation.
Cette étape sera validé par un opérateur et les financeurs.</span>
<?php }else{ ?>
<span class="text-center" style="font-size: 22px;font-weight: 800;">
Une fois votre dossier estimé rempli, vous pouvez le valider afin qu'il soit mis sous étude des opérateurs et des financeurs<br/><br/>
<a href="javascript:;" class="validateForSubmit btn btn-success">
Soumettre votre dossier
</a>
</span>
<?php } ?>
</div>
<?php } ?>
......@@ -125,7 +139,17 @@ $(document).ready(function() {
} );
} );
});
$('.validateForSubmit').off().on("click", function() {
ctxTpl = {
id : "<?php echo $answer['_id'] ?>",
collection : "answers",
path : "step",
value : "deal1"
};
dataHelper.path2Value( ctxTpl, function(params) {
urlCtrl.loadByHash(location.hash);
});
} );
$('.intentOperator').off().on("click", function() {
var oid = $(this).data("oid");
ctxTpl = {
......@@ -143,8 +167,3 @@ $(document).ready(function() {
});
</script>
<?php } else {?>
<div class="col-xs-12">
Cette étape sera validé par un opérateur et les financeurs.
</div>
<?php } ?>
\ No newline at end of file
<div class="text-center">
<h3 style="color:red"><?php echo $label.$editQuestionBtn ?></h3>
<div class="col-xs-12 no-padding text-center margin-top-20 margin-bottom-20">
<h2 class="padding-bottom-20" style="border-bottom: 1px solid gray"><?php echo $label.$editQuestionBtn ?></h2>
<?php if(!empty($info)){ ?>
<small id="<?php echo $key ?>Help" class="form-text text-muted"><?php echo $info ?></small>
<?php } ?>
......
......@@ -94,6 +94,24 @@ if( isset($this->costum["tpls"][$keyTpl]) ) {
<script type="text/javascript">
formInputs["<?php echo $v ?>"] = <?php echo json_encode( $form['inputs'] ); ?>;
var formInputsHere = formInputs;
jQuery(document).ready(function() {
mylog.log("render","survey.views.tpls.forms.wizard");
$.each($(".markdown"), function(k,v){
descHtml = dataHelper.markdownToHtml($(v).html());
$(v).html(descHtml);
});
// Todo BUG en nav private
if( localStorage !== null && localStorage.wizardStep !== null)
showStepForm(localStorage.wizardStep);
});
function showStepForm(id){
mylog.log("showStepForm", id);
$(".sectionStep").addClass("hide");
$(id).removeClass("hide");
localStorage.setItem("wizardStep",id);
}
</script>
<?php
......@@ -116,7 +134,7 @@ var formInputsHere = formInputs;
"form" => $form,
"wizard" => true,
"answer"=>$answer,
"mode" => $mode,
"mode" => @$mode,
"showForm" => $showForm,
"canEdit" => $canEdit,
"el" => $el ] ,true );
......@@ -135,24 +153,7 @@ var formInputsHere = formInputs;
?>
<script type="text/javascript">
jQuery(document).ready(function() {
mylog.log("render","survey.views.tpls.forms.wizard");
$.each($(".markdown"), function(k,v){
descHtml = dataHelper.markdownToHtml($(v).html());
$(v).html(descHtml);
});
// Todo BUG en nav private
if( localStorage !== null && localStorage.wizardStep !== null)
showStepForm(localStorage.wizardStep);
});
function showStepForm(id){
mylog.log("showStepForm", id);
$(".sectionStep").addClass("hide");
$(id).removeClass("hide");
localStorage.setItem("wizardStep",id);
}
</script>
......
......@@ -171,7 +171,7 @@ if(isset($this->costum["cms"]["color1"]))
} else {
echo "<h4 class='text-center' style='color:".$color1."'><i class='fa fa-warning'></i> Une seul réponse n'est possible.</h4>";
echo "<a class='btn btn-primary' href='/costum/co/index/slug/".$el["slug"]."/answer/".$myAnswers[0]."'>Votre réponse</a>";
echo "<a class='btn btn-primary' href='/costum/co/index/slug/".$el["slug"]."/answer/".@$myAnswers[0]."'>Votre réponse</a>";
}
?>
......
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