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

Hotfix

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