Commit 2e68bb95 authored by Raph El's avatar Raph El

Hotfix

parent fff33c76
...@@ -366,6 +366,7 @@ class Answer{ ...@@ -366,6 +366,7 @@ class Answer{
} }
public static function validate($params){ public static function validate($params){
//Rest::json($params); exit;
$costum = CacheHelper::getCostum(); $costum = CacheHelper::getCostum();
$set = array(); $set = array();
$res = array('result' => false, "msg" => "Erreur"); $res = array('result' => false, "msg" => "Erreur");
...@@ -373,18 +374,19 @@ class Answer{ ...@@ -373,18 +374,19 @@ class Answer{
$answer = PHDB::findOneById(Answer::COLLECTION, $params["answerId"]); $answer = PHDB::findOneById(Answer::COLLECTION, $params["answerId"]);
if(!empty($answer)){ if(!empty($answer)){
//Rest::json($answer); exit;
if(!empty($params["input"]["validated"]) && ( $params["input"]["validated"] === true || $params["input"]["validated"] === "true" ) ) if(!empty($params["input"]["validated"]) && ( $params["input"]["validated"] === true || $params["input"]["validated"] === "true" ) )
$set["validated"] = true; $set["validated"] = true;
if(!empty($params["input"]["generateElement"])){ if(!empty($params["input"]["generateElement"])){
$mapping = array(); $mapping = array();
$import = array( $import = array(
'file' => array(json_encode(array($params["answer"]))), 'file' => array(json_encode(array($answer))),
'nameFile' => "test", 'nameFile' => "test",
'typeFile' => 'json', 'typeFile' => 'json',
"warnings" => "false" "warnings" => "false"
); );
//Rest::json($import); exit;
foreach ($params["input"]["generateElement"] as $type => $map) { foreach ($params["input"]["generateElement"] as $type => $map) {
$mapping = array(); $mapping = array();
foreach ($map as $k => $v) { foreach ($map as $k => $v) {
...@@ -397,7 +399,7 @@ class Answer{ ...@@ -397,7 +399,7 @@ class Answer{
$import['typeElement'] = $type; $import['typeElement'] = $type;
//Rest::json($import); exit; //Rest::json($import); exit;
$resImport = Import::previewData($import, true, true, true); $resImport = Import::previewData($import, true, true, true);
//Rest::json($resImport); exit; Rest::json($resImport); exit;
foreach ($resImport["elementsObj"] as $keyElt => $elt) { foreach ($resImport["elementsObj"] as $keyElt => $elt) {
$elt = Import::checkElement($elt, $type); $elt = Import::checkElement($elt, $type);
if(!empty($elt["msgError"])) if(!empty($elt["msgError"]))
......
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