Commit e6d17bcc authored by Raph El's avatar Raph El

TEST pdf + correction PDF + hotfix mode FA

parent d1c0e3fb
......@@ -28,7 +28,7 @@ class IndexAction extends CAction
//Rest::json($params); exit;
$params = Form::getDataForAnswer($params);
//var_dump(Yii::app()->session["budgetInputList"]); exit;
//Rest::json($params); exit;
$params["answer"] = $answer;
// TODO améliorer getdataForAnser pour soit viré la création de lanswers soit charger la bonne answer
......
......@@ -698,8 +698,11 @@ class Form {
//var_dump(Yii::app()->session['costum']);exit;
//WARNING
$costum = CacheHelper::getCostum();
if(isset($costum["contextType"]) && isset($costum["contextId"]))
$params["el"] = Element::getByTypeAndId($costum["contextType"], $costum["contextId"] );
if(isset($costum["contextType"]) && isset($costum["contextId"])){
$params["el"] = Element::getByTypeAndId($costum["contextType"], $costum["contextId"] );
$params["el"]["id"] = $costum["contextId"];
}
if(isset($costum["hasOpenForm"])){
......
......@@ -200,7 +200,7 @@ $(document).ready(function() {
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#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){
} else if( isset($answer["answers"][$copyF][$budgetKey]) && count($answer["answers"][$copyF][$budgetKey])>0 )
$answers = $answer["answers"][$copyF][$kunik];
} else {
if($budgetKey)
if(!empty($budgetKey) && !empty($answer["answers"][$budgetKey]) )
$answers = $answer["answers"][$budgetKey];
else if(isset($answer["answers"][$kunik]))
$answers = $answer["answers"][$kunik];
......@@ -27,7 +27,7 @@ if($wizard){
$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){
} else if( isset($answer["answers"][$copyF][$budgetKey]) && count($answer["answers"][$copyF][$budgetKey])>0 )
$answers = $answer["answers"][$copyF][$kunik];
} else {
if($budgetKey)
if(!empty($budgetKey) && !empty($answer["answers"][$budgetKey]))
$answers = $answer["answers"][$budgetKey];
else if(isset($answer["answers"][$kunik]))
$answers = $answer["answers"][$kunik];
......@@ -49,7 +49,7 @@ if($answer){
$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 = [
......
......@@ -106,6 +106,7 @@ if( isset( $form["inputs"] ) ){ ?>
"kunik" => $kunik,
"mode" => $mode,
"canEdit" => $canEdit,
"canEditForm" => @$canEditForm,
"editQuestionBtn" => @$editQuestionBtn,
"saveOneByOne" => $saveOneByOne,
"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