Commit 222760aa authored by Clément Damiens's avatar Clément Damiens
Browse files

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

parents a932b070 e6d17bcc
...@@ -28,7 +28,7 @@ class IndexAction extends CAction ...@@ -28,7 +28,7 @@ class IndexAction extends CAction
//Rest::json($params); exit; //Rest::json($params); exit;
$params = Form::getDataForAnswer($params); $params = Form::getDataForAnswer($params);
//var_dump(Yii::app()->session["budgetInputList"]); exit; //Rest::json($params); exit;
$params["answer"] = $answer; $params["answer"] = $answer;
// TODO améliorer getdataForAnser pour soit viré la création de lanswers soit charger la bonne answer // TODO améliorer getdataForAnser pour soit viré la création de lanswers soit charger la bonne answer
......
...@@ -698,8 +698,11 @@ class Form { ...@@ -698,8 +698,11 @@ class Form {
//var_dump(Yii::app()->session['costum']);exit; //var_dump(Yii::app()->session['costum']);exit;
//WARNING //WARNING
$costum = CacheHelper::getCostum(); $costum = CacheHelper::getCostum();
if(isset($costum["contextType"]) && isset($costum["contextId"])) if(isset($costum["contextType"]) && isset($costum["contextId"])){
$params["el"] = Element::getByTypeAndId($costum["contextType"], $costum["contextId"] ); $params["el"] = Element::getByTypeAndId($costum["contextType"], $costum["contextId"] );
$params["el"]["id"] = $costum["contextId"];
}
if(isset($costum["hasOpenForm"])){ if(isset($costum["hasOpenForm"])){
......
...@@ -200,7 +200,7 @@ $(document).ready(function() { ...@@ -200,7 +200,7 @@ $(document).ready(function() {
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>"); $("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash); //urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -19,7 +19,7 @@ if($wizard){ ...@@ -19,7 +19,7 @@ if($wizard){
} else if( isset($answer["answers"][$copyF][$budgetKey]) && count($answer["answers"][$copyF][$budgetKey])>0 ) } else if( isset($answer["answers"][$copyF][$budgetKey]) && count($answer["answers"][$copyF][$budgetKey])>0 )
$answers = $answer["answers"][$copyF][$kunik]; $answers = $answer["answers"][$copyF][$kunik];
} else { } else {
if($budgetKey) if(!empty($budgetKey) && !empty($answer["answers"][$budgetKey]) )
$answers = $answer["answers"][$budgetKey]; $answers = $answer["answers"][$budgetKey];
else if(isset($answer["answers"][$kunik])) else if(isset($answer["answers"][$kunik]))
$answers = $answer["answers"][$kunik]; $answers = $answer["answers"][$kunik];
...@@ -27,7 +27,7 @@ if($wizard){ ...@@ -27,7 +27,7 @@ if($wizard){
$editBtnL = ""; $editBtnL = "";
$editParamsBtn = ($canEdit) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".$this->costum["contextType"]."' data-path='costum.form.params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : ""; $editParamsBtn = ($canEditForm) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".$this->costum["contextType"]."' data-path='costum.form.params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : "";
......
...@@ -41,7 +41,7 @@ if($answer){ ...@@ -41,7 +41,7 @@ if($answer){
} else if( isset($answer["answers"][$copyF][$budgetKey]) && count($answer["answers"][$copyF][$budgetKey])>0 ) } else if( isset($answer["answers"][$copyF][$budgetKey]) && count($answer["answers"][$copyF][$budgetKey])>0 )
$answers = $answer["answers"][$copyF][$kunik]; $answers = $answer["answers"][$copyF][$kunik];
} else { } else {
if($budgetKey) if(!empty($budgetKey) && !empty($answer["answers"][$budgetKey]))
$answers = $answer["answers"][$budgetKey]; $answers = $answer["answers"][$budgetKey];
else if(isset($answer["answers"][$kunik])) else if(isset($answer["answers"][$kunik]))
$answers = $answer["answers"][$kunik]; $answers = $answer["answers"][$kunik];
...@@ -49,7 +49,7 @@ if($answer){ ...@@ -49,7 +49,7 @@ if($answer){
$editBtnL = ""; $editBtnL = "";
$editParamsBtn = ($canEdit) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".$this->costum["contextType"]."' data-path='costum.form.params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : ""; $editParamsBtn = ($canEditForm) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".$this->costum["contextType"]."' data-path='costum.form.params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : "";
$paramsData = [ $paramsData = [
......
...@@ -106,6 +106,7 @@ if( isset( $form["inputs"] ) ){ ?> ...@@ -106,6 +106,7 @@ if( isset( $form["inputs"] ) ){ ?>
"kunik" => $kunik, "kunik" => $kunik,
"mode" => $mode, "mode" => $mode,
"canEdit" => $canEdit, "canEdit" => $canEdit,
"canEditForm" => @$canEditForm,
"editQuestionBtn" => @$editQuestionBtn, "editQuestionBtn" => @$editQuestionBtn,
"saveOneByOne" => $saveOneByOne, "saveOneByOne" => $saveOneByOne,
"wizard" => (isset($wizard) && $wizard == true) , "wizard" => (isset($wizard) && $wizard == 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