Commit a20284cd authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

tweak

parent 8cf35477
......@@ -693,7 +693,7 @@ class Form {
{
//si ya qu'une réponse et on la charge directe
if(count($myAnswers) == 1 )
/*if(count($myAnswers) == 1 )
$answer = $myAnswers[ array_keys($myAnswers)[0] ];
else {
//sinon on cherche la reponse incomplete
......@@ -704,7 +704,7 @@ class Form {
if(!isset( $ans["answers"]) && $answer == null )
$answer = $ans;
}
}
}*/
if( $answer == null && count( $myAnswers ) > 1 && !$params["canEdit"] )
$showForm = false;
......@@ -757,9 +757,10 @@ class Form {
$params["answer"] = $answer;
$params["showForm"] = $showForm;
$params["allAnswers"] = PHDB::find( Form::ANSWER_COLLECTION,[
$allAnswers = PHDB::find( Form::ANSWER_COLLECTION,[
"formId" => $params["formId"],
"parentSlug" => $params["el"]["slug"] ] );
"parentSlug" => $params["el"]["slug"] ] ) ;
$params["allAnswers"] = (!isset($allAnswers)) ? [] : $allAnswers ;
//var_dump($params["el"]["slug"]);exit;
//var_dump($params["allAnswers"]);exit;
} else {
......
Supports Markdown
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