Commit be16962b authored by Anatole Rakotoson's avatar Anatole Rakotoson
Browse files

sommom

parent cd840c5a
......@@ -88,7 +88,7 @@ if( isset( $form["inputs"] ) ){ ?>
}
}
// var_dump($answerPath);
//var_dump($answerPath);
// var_dump($answers);
$p = [
"input" => $input,
......
......@@ -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);
......
......@@ -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"){
......
......@@ -107,7 +107,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -168,7 +168,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
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