Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Pixel Humain
survey
Commits
2e68bb95
Commit
2e68bb95
authored
Jun 26, 2020
by
Raph El
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hotfix
parent
fff33c76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
models/Answer.php
models/Answer.php
+6
-4
No files found.
models/Answer.php
View file @
2e68bb95
...
...
@@ -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"
]))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment