Commit 3e8d40fd authored by Raph El's avatar Raph El
Browse files

Modif

parent e227b42a
<?php
class IndexAction extends CAction
{
public function run($id=null, $answer=null, $tpl=null)
public function run($id=null, $answer=null, $tpl=null, $mode=null)
{
$this->getController()->layout = "//layouts/empty";
$params = ["canEdit" => true];
// if( isset($test) ){
// $params["tpl"]=$id;
//}
if(!empty($id)){
$params["answerId"]=$id;
}
$params["mode"] = (!empty($mode) ? $mode : "r");
//echo $params["mode"] ; exit;
$params = Form::getDataForAnswer($params);
$tpl=(!empty($tpl)) ? $tpl : "survey.views.tpls.forms.formWizard";
//$tpl=(!empty($tpl)) ? $tpl : "survey.views.tpls.forms.formWizard";
$tpl=(!empty($tpl)) ? $tpl : "survey.views.tpls.views.index";
echo $this->getController()->renderPartial($tpl,$params );
}
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -12,9 +12,18 @@ if(!empty($answer) && isset($answer["answers"][$form["id"]][$kunik]))
else if(!empty($answer) && isset($answer["answers"][$kunik]))
$value = $answer["answers"][$kunik];
$inpClass = "form-control";
//var_dump($value);
// if($saveOneByOne)
// $inpClass .= " saveOneByOne";
echo $mode ;
if($mode == "r"){ ?>
<div class="col-xs-12" id="<?php echo $kunik ?>">
<label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label>
<?php
foreach ($value as $keyAdd => $valAdd) {
echo $valAdd["name"];
}
?>
</div>
<?php
}else{
?>
<div class="form-group" id="<?php echo $kunik ?>">
<label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label.$editQuestionBtn ?></h4></label>
......@@ -25,7 +34,6 @@ $inpClass = "form-control";
<small id="<?php echo $kunik ?>Help" class="form-text text-muted"><?php echo $info ?></small>
<?php } ?>
</div>
<script type="text/javascript">
// 137 rue des villages, Cangey
var cplxAddObj ={};
......@@ -70,21 +78,23 @@ jQuery(document).ready(function() {
// allMaps.maps[keyAdd].saveAuto = function(data){
// var answer = {
// collection : "answers",
// id : answerObj._id.$id,
// path : "answers."+keyAdd
// };
// var answer = {
// collection : "answers",
// id : answerObj._id.$id,
// path : "answers."+keyAdd
// };
// answer.value = allMaps.maps[keyAdd].result;
// answer.value = allMaps.maps[keyAdd].result;
// mylog.log("addressObj.saveAuto", answer );
// mylog.log("addressObj.saveAuto", answer );
// dataHelper.path2Value( answer , function(params) {
// toastr.success('saved');
// } );
// };
// dataHelper.path2Value( answer , function(params) {
// toastr.success('saved');
// } );
// };
});
</script>
<?php } ?>
......@@ -21,6 +21,7 @@ if( !isset(Yii::app()->session["costum"]["form"]["startDate"]) ||
$params =[ "formId" => $formId,
"form" => $form,
"answer" => $answer,
"mode" => $mode,
"canEdit" => $canEdit,
"el" => $el ];
if( isset($wizard) ){
......
......@@ -103,8 +103,9 @@ if( isset( $form["inputs"] ) ){ ?>
"form" => $form,
"key" => $key,
"kunik" => $kunik,
"mode" => $mode,
"canEdit" => $canEdit,
"editQuestionBtn" => $editQuestionBtn,
"editQuestionBtn" => @$editQuestionBtn,
"saveOneByOne" => $saveOneByOne,
"wizard" => (isset($wizard) && $wizard == true) ,
"el" => $el ];
......
......@@ -115,6 +115,7 @@ var formInputsHere = formInputs;
"form" => $form,
"wizard" => true,
"answer"=>$answer,
"mode" => $mode,
"showForm" => $showForm,
"canEdit" => $canEdit,
"el" => $el ] ,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