Commit 86a39d62 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

Merge remote-tracking branch 'origin/development' into development

parents fbe8789d dd0b403c
<style type="text/css">
.toolsMenu{
box-shadow: 0px 1px 3px 0px #a3a3a3;
}
</style>
<script type="text/javascript">
var sectionDyf = {};
var formInputs = {};
var answerObj = <?php echo (!empty($element)) ? json_encode( $element ) : "null"; ?>;
</script>
<div id="preview-elt-<?php echo $type ?>-<?php echo (string)$element["_id"] ?>">
<div class="col-xs-12 padding-10 toolsMenu">
<button class="btn btn-default pull-right btn-close-preview">
<i class="fa fa-times"></i>
</button>
<a href="#answer.index.id.<?php echo (string)$element["_id"] ?>" class="lbh btn btn-primary pull-right margin-right-10"><?php echo Yii::t("common", "Open") ?></a>
</div>
<div class="col-xs-12 no-padding">
<div class="col-xs-12 no-padding container-preview">
<?php
$params = array("answer"=>$element ,
"page" => "page",
"type" => $type,
"form"=> PHDB::findOneById( Form::COLLECTION , $element["form"]),
"canEdit"=>@$canEdit,
"canEditForm"=>false,
"controller" => $controller);
$params = [
"form"=> PHDB::findOneById( Form::COLLECTION , $element["form"]),
"canEdit" => @$canEdit,
"answer"=>$element,
"mode" => (isset($_GET["mode"])) ? $_GET["mode"] : "r",
"showWizard"=>false,
"wizid"=> $element["form"],
"color1"=>"",
"color2"=>""
];
if(isset($params["form"]["subForms"]) && count($params["form"]["subForms"]) > 1)
$params["form"]["subForms"]=[$params["form"]["subForms"][0]];
$params = Form::getDataForm($params);
$params["mode"]=(isset($_GET["mode"])) ? $_GET["mode"] : "rplus";
echo $this->renderPartial('survey.views.tpls.forms.formWizard', $params );
?>
$params["parentForm"]=$params["form"];
$params["canEditForm"]=false;
echo $this->renderPartial("survey.views.tpls.forms.wizard",$params);
?>
</div>
</div>
\ No newline at end of file
......@@ -71,7 +71,7 @@ if( $mode != "pdf" ){
//if role operateurs
if(!$selectedOperator){
if($isOperator && !$alreadyCandidate && $answer["step"]!="deal12"){
if($isOperator && !$alreadyCandidate && @$answer["step"]!="deal12"){
?>
<tr>
<td colspan='2' class="text-center" >
......@@ -90,13 +90,13 @@ if( $mode != "pdf" ){
} ?>
</tbody>
</table>
<?php if($isFinanceur){ ?>
<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;">Ce dossier n'a pas encore d'opérateur rattaché. En tant que financeurs ou administrateur de la DEAL, veuillez valider un opérateur afin de passer ce dossier à l'étape suivant d'instruction.</span>
<?php } ?>
</div>
<?php }
<?php if($isFinanceur){
if(@$answer["step"] && $answer["step"]=="deal1"){ ?>
<div class="col-xs-12 text-center margin-top-50 well">
<span style="font-size: 22px;font-weight: 800;">Ce dossier n'a pas encore d'opérateur rattaché. En tant que financeurs ou administrateur de la DEAL, veuillez valider un opérateur afin de passer ce dossier à l'étape suivant d'instruction.</span>
</div>
<?php }
}
} else { ?>
<?php
if(@$answer["step"]){
......
......@@ -6,7 +6,7 @@ else if(!empty($answer) && isset($answer["answers"][$key]))
$value = $answer["answers"][$key];
if($mode == "r" || $mode == "pdf"){ ?>
<div class="col-xs-12" id="<?php echo $kunik ?>">
<div class="col-xs-12 no-padding" id="<?php echo $kunik ?>">
<label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label>
<?php
if(!empty($value)){
......
......@@ -36,11 +36,6 @@ if( !isset($parentForm["startDate"]) ||
} else if( count($myAnswers) == 0 ) {
echo "<h4>Bienvenue vous n'avez pas encore participer.</h4>";
// $countTotalAnswers = PHDB::count( Form::ANSWER_COLLECTION,[ "formId" => $formId,
// "parentSlug" => $el["slug"] ] );
// $countdistinctUsers = count(PHDB::distinct( Form::ANSWER_COLLECTION,"user",[ "formId" => $formId,
// "parentSlug" => $el["slug"] ] ));
$countTotalAnswers = PHDB::count( Answer::COLLECTION,[ "form" => (String)$form['_id'] ] );
$countdistinctUsers = count(PHDB::distinct( Answer::COLLECTION,"user",[ "form" => (String)$form['_id'] ] ));
if($countTotalAnswers == 0)
......@@ -50,10 +45,7 @@ if( !isset($parentForm["startDate"]) ||
echo "<a class='btn btn-primary' href='/costum/co/index/slug/".$el["slug"]."/new/true'>Participer</a>";
} else {
// echo "<h4>Vous avez deja participer, vous pouvez retoucher vos ".PHDB::count( Form::ANSWER_COLLECTION,[ "formId" => $formId,
// "parentSlug" => $el["slug"],
// "user" => Yii::app()->session["userId"] ] )." réponses dans la liste.</h4>";
echo "<h4>Vous avez deja participer, vous pouvez retoucher vos ".
PHDB::count( Form::ANSWER_COLLECTION,
[ "form" => (String)$form['_id'],
......
......@@ -184,6 +184,7 @@ if(isset($this->costum["cms"]["color1"]))
"answer"=>$answer,
"showForm" => $showForm,
"mode" => $mode,
"showWizard"=>true,
"wizid"=> $wizardUid
];
......
......@@ -53,7 +53,7 @@ if( isset( $form["inputs"] ) ){ ?>
//fin nouvelle repositionnement
//echo json_encode($form["inputs"]) ;
$dragNDrop = ($canEditForm) ? "dragNDrop" : "" ;
echo "<ul class='questionList ".$dragNDrop."'>";
echo "<ul class='questionList col-xs-12 ".$dragNDrop."'>";
foreach ( $form["inputs"] as $key => $input) {
$canAnswer = (Yii::app()->session["userId"] == $answer["user"] || !empty($parentForm["anyOnewithLinkCanAnswer"])) ? true :false;
$editQuestionBtn = ($canEditForm) ? " <a class='btn btn-xs btn-danger editQuestion' href='javascript:;' data-form='".$form["id"]."' data-id='".$form["_id"]."' data-collection='".Form::COLLECTION."' data-key='".$key."' data-path='inputs.".$key."'><i class='fa fa-pencil'></i></a>".
......
......@@ -12,7 +12,7 @@ if(!isset($options) && isset($parentForm["params"][$key]['options']))
$options = $parentForm["params"][$key]['options'];
if($mode == "r" || $mode == "pdf"){ ?>
<div class="col-xs-12" id="<?php echo $kunik ?>">
<div class="col-xs-12 no-padding" id="<?php echo $kunik ?>">
<label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label><br/>
<?php echo (!empty($options) && !empty($options[$answers])) ? $options[$answers] : "" ; ?>
</div>
......
......@@ -10,7 +10,7 @@ if($saveOneByOne)
$inpClass .= " saveOneByOne";
if($mode == "r" || $mode == "pdf"){ ?>
<div class="col-xs-12" id="<?php echo $kunik ?>">
<div class="col-xs-12 no-padding" id="<?php echo $kunik ?>">
<label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label><br/>
<?php echo $answers; ?>
</div>
......
......@@ -4,7 +4,7 @@ if($saveOneByOne)
$inpClass = " saveOneByOne";
if($mode == "r" || $mode == "pdf"){ ?>
<div class="col-xs-12" id="<?php echo $kunik ?>">
<div class="col-xs-12 no-padding" id="<?php echo $kunik ?>">
<label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label><br/>
<?php echo $answers; ?>
</div>
......
......@@ -40,51 +40,52 @@ if( isset($parentForm["subForms"]) && count($parentForm["subForms"]) > 1 ) {
border-color: <?php echo ( @$color2 ) ? $color2 : $defaultColor ?>;
}
</style>
<ul id="wizardLinks">
<?php
// var_dump($listSteps); exit;
$activeStep = 0;
$nextStepValid =true;
foreach ($parentForm["subForms"] as $k => $v) {
$n = "todo";
$p = null;
if( !empty($forms[$v]) )
$n = $forms[$v]["name"];
<?php if(!empty($showWizard)){ ?>
<ul id="wizardLinks">
<?php
// var_dump($listSteps); exit;
$activeStep = 0;
$nextStepValid =true;
echo "<li>";
foreach ($parentForm["subForms"] as $k => $v) {
$n = "todo";
$p = null;
$d = '';
$lbl = "?";
// if(isset($parentForm["hasStepValidations"]) )
// $lbl = "";
if( !empty($forms[$v]) )
$n = $forms[$v]["name"];
echo "<li>";
if( (!isset($answer["step"]) && !isset($parentForm["hasStepValidations"])) ||
$k == 0 ||
(isset($answer["step"]) && $answer["step"] == "all" ) ||
$d = '';
$lbl = "?";
// if(isset($parentForm["hasStepValidations"]) )
// $lbl = "";
(isset($parentForm["hasStepValidations"]) && isset($answer["step"]) && $k <= array_search($answer["step"], $parentForm["subForms"]) ) ||
( isset($parentForm["hasStepValidations"]) && !isset($answer["step"]) && $k <= $parentForm["hasStepValidations"] ) )
{
$d = 'class="done"';
$lbl = $k;
$l = 'showStepForm(\'#'.$v.'\')' ;
$activeStep = $k;
}
echo '<a onclick="'.$l.'" href="javascript:;" '.$d.' >';
echo '<div class="stepNumber">'.$lbl.'</div>';
echo '<span class="stepDesc">'.$n.'</span></a>';
if($canEditForm === true) {
echo '<div><a href="javascript:;" class="editFormBtn" data-id="'.$forms[$v]["_id"].'" data-formid="'.$v.'" ><i class="fa fa-pencil text-dark"></i></a> ';
echo '<a href="javascript:;" class="deleteFormBtn" data-id="'.$forms[$v]["_id"].'" data-formid="'.$v.'" ><i class="fa fa-trash text-red"></i></a></div> ' ;
}
echo "</li>";
}
?>
</ul>
if( (!isset($answer["step"]) && !isset($parentForm["hasStepValidations"])) ||
$k == 0 ||
(isset($answer["step"]) && $answer["step"] == "all" ) ||
(isset($parentForm["hasStepValidations"]) && isset($answer["step"]) && $k <= array_search($answer["step"], $parentForm["subForms"]) ) ||
( isset($parentForm["hasStepValidations"]) && !isset($answer["step"]) && $k <= $parentForm["hasStepValidations"] ) )
{
$d = 'class="done"';
$lbl = $k;
$l = 'showStepForm(\'#'.$v.'\')' ;
$activeStep = $k;
}
echo '<a onclick="'.$l.'" href="javascript:;" '.$d.' >';
echo '<div class="stepNumber">'.$lbl.'</div>';
echo '<span class="stepDesc">'.$n.'</span></a>';
if($canEditForm === true) {
echo '<div><a href="javascript:;" class="editFormBtn" data-id="'.$forms[$v]["_id"].'" data-formid="'.$v.'" ><i class="fa fa-pencil text-dark"></i></a> ';
echo '<a href="javascript:;" class="deleteFormBtn" data-id="'.$forms[$v]["_id"].'" data-formid="'.$v.'" ><i class="fa fa-trash text-red"></i></a></div> ' ;
}
echo "</li>";
}
?>
</ul>
<?php } ?>
<?php
......
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