Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pixel Humain
survey
Commits
be16962b
Commit
be16962b
authored
May 04, 2020
by
Anatole Rakotoson
Browse files
sommom
parent
cd840c5a
Changes
5
Hide whitespace changes
Inline
Side-by-side
views/tpls/forms/formbuilder.php
View file @
be16962b
...
...
@@ -88,7 +88,7 @@ if( isset( $form["inputs"] ) ){ ?>
}
}
//
var_dump($answerPath);
//var_dump($answerPath);
// var_dump($answers);
$p
=
[
"input"
=>
$input
,
...
...
views/tpls/forms/sommom/airemarineprotege.php
View file @
be16962b
...
...
@@ -68,7 +68,7 @@
"inputType"
=>
"text"
,
"rules"
=>
[
"required"
=>
false
]
],
"
localisation
"
=>
[
"
coord
"
=>
[
"label"
=>
"Localisation"
,
"placeholder"
=>
"Point GPS"
,
"inputType"
=>
"formLocality"
,
...
...
@@ -148,21 +148,31 @@
echo
"<tr id='"
.
$kunik
.
$q
.
"' class='"
.
$kunik
.
"Line'>"
;
foreach
(
$properties
as
$i
=>
$inp
)
{
if
(
$i
==
"location"
){
}
else
{
echo
"<td>"
;
if
(
isset
(
$a
[
$i
]))
{
if
(
is_array
(
$a
[
$i
])){
echo
implode
(
","
,
$a
[
$i
]);
}
else
{
if
(
$i
==
"site"
)
{
if
(
$i
==
"coord"
){
$lat
=
$a
[
"coord"
][
"latitude"
];
$lon
=
$a
[
"coord"
][
"longitude"
];
echo
$a
[
"coord"
][
"latitude"
]
.
" / "
.
$a
[
"coord"
][
"longitude"
];
//echo implode(",", $a["coord"]);
echo
'<span class="pull-right" style= "margin-right : 5px;"><a id="showActeurLocation" href="javascript:;" onclick=""><i class="fa fa-map-o" aria-hidden="true"></i></a></span>'
;
}
else
if
(
is_array
(
$a
[
$i
])){
echo
implode
(
","
,
$a
[
$i
]);
}
else
if
(
$i
==
"site"
)
{
echo
"<a href='"
.
$a
[
$i
]
.
"'>"
.
$a
[
$i
]
.
"</a>"
;
}
else
{
echo
$a
[
$i
];
}
}
else
{
echo
$a
[
$i
];
}
}
echo
"</td>"
;
}
}
?>
<td
style=
"white-space: normal;"
>
<?php
...
...
@@ -208,9 +218,27 @@
save
:
function
()
{
var
today
=
new
Date
();
tplCtx
.
value
=
{
date
:
today
.
getDate
()
+
'
/
'
+
(
today
.
getMonth
()
+
1
)
+
'
/
'
+
today
.
getFullYear
()
};
$
.
each
(
sectionDyf
.
<?php
echo
$kunik
?>
.
jsonSchema
.
properties
,
function
(
k
,
val
)
{
tplCtx
.
value
[
k
]
=
$
(
"
#
"
+
k
).
val
();
});
$
.
each
(
sectionDyf
.
<?php
echo
$kunik
?>
.
jsonSchema
.
properties
,
function
(
k
,
val
)
{
if
(
val
.
inputType
==
"
properties
"
)
tplCtx
.
value
[
k
]
=
getPairsObj
(
'
.
'
+
k
+
val
.
inputType
);
else
if
(
val
.
inputType
==
"
array
"
)
tplCtx
.
value
[
k
]
=
getArray
(
'
.
'
+
k
+
val
.
inputType
);
else
if
(
val
.
inputType
==
"
formLocality
"
)
tplCtx
.
value
[
k
]
=
getArray
(
'
.
'
+
k
+
val
.
inputType
);
else
tplCtx
.
value
[
k
]
=
$
(
"
#
"
+
k
).
val
();
});;
if
(
typeof
formData
!=
"
undefined
"
&&
typeof
formData
.
geo
!=
"
undefined
"
){
tplCtx
.
value
[
"
coord
"
]
=
formData
.
geo
;
tplCtx
.
value
[
"
address
"
]
=
formData
.
address
;
tplCtx
.
value
[
"
geo
"
]
=
formData
.
geo
;
tplCtx
.
value
[
"
geoPosition
"
]
=
formData
.
geoPosition
;
if
(
typeof
formData
.
addresses
!=
"
undefined
"
)
tplCtx
.
value
[
"
addresses
"
]
=
formData
.
addresses
;
}
mylog
.
log
(
"
save tplCtx
"
,
tplCtx
);
if
(
typeof
tplCtx
.
value
==
"
undefined
"
)
...
...
@@ -249,14 +277,15 @@
},
save
:
function
()
{
tplCtx
.
value
=
{};
$
.
each
(
sectionDyf
.
<?php
echo
$kunik
?>
Params
.
jsonSchema
.
properties
,
function
(
k
,
val
)
{
$
.
each
(
sectionDyf
.
<?php
echo
$kunik
?>
.
jsonSchema
.
properties
,
function
(
k
,
val
)
{
if
(
val
.
inputType
==
"
properties
"
)
tplCtx
.
value
[
k
]
=
getPairsObj
(
'
.
'
+
k
+
val
.
inputType
);
else
if
(
val
.
inputType
==
"
array
"
)
tplCtx
.
value
[
k
]
=
getArray
(
'
.
'
+
k
+
val
.
inputType
);
else
if
(
val
.
inputType
==
"
formLocality
"
)
tplCtx
.
value
[
k
]
=
getArray
(
'
.
'
+
k
+
val
.
inputType
);
else
tplCtx
.
value
[
k
]
=
$
(
"
#
"
+
k
).
val
();
mylog
.
log
(
"
value
"
,
'
.
'
+
k
+
val
.
inputType
,
tplCtx
.
value
[
k
]);
});
mylog
.
log
(
"
save tplCtx
"
,
tplCtx
);
...
...
views/tpls/forms/sommom/especeObs.php
View file @
be16962b
...
...
@@ -247,13 +247,14 @@
echo
"<tr id='"
.
$kunik
.
$q
.
"' class='"
.
$kunik
.
"Line'>"
;
$mycounter
=
0
;
foreach
(
$properties
as
$i
=>
$inp
)
{
if
(
$mycounter
==
3
){
echo
"<td>"
;
if
(
isset
(
$a
[
$i
]))
{
if
(
is_array
(
$a
[
$i
]))
{
echo
implode
(
","
,
$a
[
$i
]);
}
else
{
if
(
$a
[
$i
]
==
"Annuelle"
){
...
...
@@ -332,7 +333,7 @@
echo
"<td>"
;
if
(
isset
(
$a
[
$i
]))
{
if
(
is_array
(
$a
[
$i
]))
{
echo
implode
(
","
,
$a
[
$i
]);
}
else
{
if
(
$a
[
$i
]
==
"true"
){
...
...
views/tpls/forms/sommom/mapterritoire.php
View file @
be16962b
...
...
@@ -107,7 +107,7 @@
"id"
=>
$answer
[
"_id"
],
"collection"
=>
Form
::
ANSWER_COLLECTION
,
"q"
=>
$q
,
"path"
=>
"
answer
s."
.
$kunik
.
"."
.
$q
,
"path"
=>
$
answer
Path
.
$q
,
"keyTpl"
=>
$kunik
]
);
?>
...
...
views/tpls/forms/sommom/organisme.php
View file @
be16962b
...
...
@@ -168,7 +168,7 @@
"id"
=>
$answer
[
"_id"
],
"collection"
=>
Form
::
ANSWER_COLLECTION
,
"q"
=>
$q
,
"path"
=>
"
answer
s."
.
$kunik
.
"."
.
$q
,
"path"
=>
$
answer
Path
.
$q
,
"keyTpl"
=>
$kunik
]
);
?>
...
...
Write
Preview
Supports
Markdown
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