...
 
Commits (32)
This diff is collapsed.
<style type="text/css">
.rdo-grp label {
cursor: pointer;
-webkit-tap-highlight-color: transparent;
padding: 6px 8px;
border-radius: 20px;
float: left;
transition: all 0.2s ease;
}
.input-grp label span:first-child {
position: relative;
display: inline-block;
vertical-align: middle;
width: 20px;
height: 20px;
background: #e8eaed;
/*background: rgba(125,100,247,0.06);*/
border-radius: 50%;
transition: all 0.2s ease;
margin-right: 8px;
}
.input-grp :hover {
background: rgba(125,100,247,0.06);
}
.effect-2{border: 0; padding: 7px 0; border-bottom: 2px solid #ccc;}
.effect-2 ~ .focus-border{position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: #3399FF; transition: 0.4s;}
.effect-2:focus ~ .focus-border{width: 100%; transition: 0.4s;}
.paramsonebtn , .paramsonebtnP {
font-size: 17px;
display: none;
padding: 5px;
}
.paramsonebtn:hover {
color: red;
}
.paramsonebtnP:hover {
color: blue;
}
.thradio:hover .paramsonebtn, .thradio:hover .paramsonebtnP {
display: inline-block;
}
.effect-2:focus {
outline: none !important;
}
</style>
<?php
$value = (!empty($answers)) ? " value='".$answers."' " : "";
$inpClass = "form-control";
if($saveOneByOne)
$inpClass .= " saveOneByOne";
if($mode == "r"){ ?>
<div class="col-xs-12" id="<?php echo $kunik ?>">
<label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label>
<?php echo $answers; ?>
</div>
<?php
}else{
?>
<div class="input-grp" style="position: relative; padding-top: 30px;">
<label for="<?php echo $key ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label.$editQuestionBtn ?></h4></label>
<br/>
<!-- <input type="" class="<?php echo $inpClass ?> effect-2 " id="<?php echo $key ?>" aria-describedby="<?php echo $key ?>Help" placeholder="<?php echo (isset($placeholder)) ? $placeholder : '' ?>" data-form='<?php echo $form["id"] ?>' <?php echo $value ?> >
<?php if(!empty($info)){ ?>
<small id="<?php echo $key ?>Help" class="form-text text-muted"><?php echo $info ?></small>
<?php } ?> -->
<input class="effect-2" type="text" placeholder="Placeholder Text" style="position: relative; width: 100%;">
<span class="focus-border"></span>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
mylog.log("render form input","/modules/costum/views/tpls/forms/text.php");
});
</script>
<?php } ?>
\ No newline at end of file
......@@ -88,7 +88,7 @@ if( isset( $form["inputs"] ) ){ ?>
}
}
// var_dump($answerPath);
//var_dump($answerPath);
// var_dump($answers);
$p = [
"input" => $input,
......
......@@ -9,8 +9,11 @@ $paramsData = [ "options" => [ ] ];
if( isset(Yii::app()->session["costum"]["form"]["params"][$key]) )
$paramsData = Yii::app()->session["costum"]["form"]["params"][$key];
if(!isset($options))
$options = Yii::app()->session["costum"]["form"]["params"][$key]['options'];
if(!isset($options)){
if(isset(Yii::app()->session["costum"]["form"]["params"][$key]['options'])){
$options = Yii::app()->session["costum"]["form"]["params"][$key]['options'];
}
}
if($mode == "r"){ ?>
<div class="col-xs-12" id="<?php echo $kunik ?>">
......
......@@ -12,8 +12,8 @@
"statut" => [
"Parc national" => "Parc national",
"Parc naturel régional" => "Parc naturel régional",
"Réserve naturelle," => "Réserve naturelle,",
"Aires de protection de biotope" => "Aires de protection de biotope",
"Réserve naturelle" => "Réserve naturelle",
"Aires de protection de biotope" => "Aire de protection de biotope",
"Site Natura 2000" => "Site Natura 2000",
"Parc naturel marin" => "Parc naturel marin",
"Autre" => "Autre"
......@@ -68,7 +68,7 @@
"inputType" => "text",
"rules" => [ "required" => false ]
],
"localisation" => [
"coord" => [
"label" => "Localisation",
"placeholder" => "Point GPS",
"inputType" => "formLocality",
......@@ -128,7 +128,11 @@
<?php
foreach ($properties as $i => $inp) {
echo "<th>".$inp["label"]."</th>";
if(isset($inp["label"])){
if(isset($inp["label"])){
echo "<th>".$inp["label"]."</th>";
}
}
} ?>
<th></th>
</tr>
......@@ -144,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["especeCible"]);
} 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
......@@ -204,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")
......@@ -245,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);
......
......@@ -10,13 +10,13 @@
$paramsData = [
"nature" => [
"accord" => "accord",
"convention" => "convention",
"reseau" => "réseau"
"accord" => "Accord",
"convention" => "Convention",
"reseau" => "Réseau"
],
"type" => [
"regionale" => "régionale",
"intergouv" => "intérgouvernemental"
"regionale" => "Régional",
"intergouv" => "Intér-gouvernemental"
]
];
......@@ -145,11 +145,19 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
echo implode(",", $a[$i]);
} else {
if($i == "site") {
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else if($i == "type" && isset($paramsData[$i][$a[$i]])){
echo $paramsData[$i][$a[$i]];
}
else if($i == "nature" && isset($paramsData[$i][$a[$i]])){
echo $paramsData[$i][$a[$i]];
}
else {
echo $a[$i];
}
......
......@@ -116,7 +116,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
echo implode(",", $a[$i]);
}
else {
......
......@@ -52,13 +52,13 @@
"date" => [
"label" => "Date de création",
"placeholder" => "Date de création",
"inputType" => "date",
"inputType" => "text",
"rules" => [ "required" => false ]
],
"maj" => [
"label" => "dernière mise à jour ",
"placeholder" => "dernière mise à jour ",
"inputType" => "date",
"inputType" => "text",
"rules" => [ "required" => false ]
],
......@@ -132,15 +132,14 @@
<?php
if( count($answers)>0 ){ ?>
<tr>
<tr style="font-size: 14px;">
</th>
<?php
foreach ($properties as $i => $inp) {
if($actualNbr1 < 6){
echo "<th>".$inp["placeholder"]."</th>";
}
$actualNbr1++;
echo "<th>".$inp["label"]."</th>";
}
?>
<th></th>
......@@ -157,12 +156,12 @@
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($actualNbr2 < 6){
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i]))
{
echo implode(",", $a["ocean"]);
echo implode(",", $a[$i]);
}
else {
if($a[$i] == "true"){
......@@ -176,8 +175,7 @@
}
}
echo "</td>";
}
$actualNbr2++;
}
?>
<td style="white-space: normal;">
......@@ -201,66 +199,6 @@
?>
<?php if(isset($answers)){ ?>
<tr>
</th>
<?php
$actualNbr3 = 0;
foreach ($properties as $i => $inp) {
if($actualNbr3 > 5){
echo "<th>".$inp["placeholder"]."</th>";
}
$actualNbr3++;
}
?>
<th></th><th></th>
</tr>
<?php
}
$ct = 0;
$actualNbr4 = 0;
if(isset($answers)){
foreach ($answers as $q => $a) {
//var_dump($actualNbr4);
//if($actualNbr4 > 4){
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($actualNbr4 > 5){
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
}
else {
if($a[$i] == "true"){
echo "oui";
}else if($a[$i] == "false"){
echo "non";
}
else {
echo $a[$i];
}
}
}
echo "</td>";
}
$actualNbr4++;
}
?>
<td></td><td></td>
<?php
$ct++;
echo "</tr>";
//}
}
}
?>
</tbody>
</table>
</div>
......
......@@ -114,7 +114,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
echo implode(",", $a[$i]);
} else {
if($i == "site") {
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
......
This diff is collapsed.
......@@ -109,7 +109,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
echo implode(",", $a[$i]);
}
else {
......
......@@ -123,7 +123,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["partenaire"]);
echo implode(",", $a[$i]);
}
else {
......
......@@ -10,16 +10,16 @@
$paramsData = [
"ocean" => [
// "indien" => "indien",
// "pacifique" => "pacifique",
// "Atlantique" => "Atlantique",
// "Arctique" => "Arctique",
// "Australe" => "Australe",
"indien",
"pacifique",
"Atlantique",
"Arctique",
"Australe",
"Indien" => "Indien",
"Pacifique" => "Pacifique",
"Atlantique" => "Atlantique",
"Arctique" => "Arctique",
"Australe" => "Australe"
// "indien",
// "pacifique",
// "Atlantique",
// "Arctique",
// "Australe",
]];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["ocean"]) )
$paramsData["ocean"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["ocean"];
......@@ -53,13 +53,13 @@
"label" => "Superficie du territoire terrestre",
"placeholder" => "Superficie du territoire terrestre",
"inputType" => "text",
"rules" => [ "required" => true ]
"rules" => [ "required" => false ]
],
"supMaritime" => [
"label" => "Superficie du territoire Maritime",
"placeholder" => "Superficie du territoire Maritime",
"inputType" => "text",
"rules" => [ "required" => true ]
"rules" => [ "required" => false ]
]
];
......@@ -128,7 +128,7 @@
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["ocean"]);
echo implode(",", $a[$i]);
}
else{
echo $a[$i];
......
......@@ -17,9 +17,10 @@
"labelText" => "Concerne les cétacés"
],
"statut" => [
"Marque Collective simple " => "Marque Collective simple ",
"Marque Collective simple " => "Marque collective simple ",
"Marque collective de certification" => "Marque collective de certification",
"Label Officiel ministériel" => "Label Officiel ministériel"
"Label Officiel ministériel" => "Label officiel ministériel",
"autre" => "Autre"
]
];
......@@ -146,15 +147,14 @@ $actualNbr1 = 0;
<?php
if( count($answers)>0 ){ ?>
<tr>
<tr style="font-size: 14px;">
</th>
<?php
foreach ($properties as $i => $inp) {
if($actualNbr1 < 6){
echo "<th>".$inp["placeholder"]."</th>";
}
$actualNbr1++;
echo "<th>".$inp["label"]."</th>";
}
?>
<th></th>
......@@ -171,15 +171,20 @@ $actualNbr1 = 0;
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($actualNbr2 < 6){
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i]))
echo implode(",", $a["ocean"]);
if(is_array($a[$i])){
echo implode(",", $a[$i]);
}
else
if($i == "site")
{
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else if($i == "type" && isset($paramsData[$i][$a[$i]])){
echo $paramsData[$i][$a[$i]];
}
else {
if($a[$i] == "true"){
......@@ -193,8 +198,7 @@ $actualNbr1 = 0;
}
}
echo "</td>";
}
$actualNbr2++;
}
?>
<td style="white-space: normal;">
......@@ -215,64 +219,7 @@ $actualNbr1 = 0;
echo "</tr>";
}
}
if(isset($answers)){
?>
<tr>
</th>
<?php
$actualNbr3 = 0;
foreach ($properties as $i => $inp) {
if($actualNbr3 > 5){
echo "<th>".$inp["placeholder"]."</th>";
}
$actualNbr3++;
}
?>
<th></th>
</tr>
<?php
}
$ct = 0;
$actualNbr4 = 0;
if(isset($answers)){
foreach ($answers as $q => $a) {
//var_dump($actualNbr4);
//if($actualNbr4 > 4){
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($actualNbr4 > 5){
echo "<td>";
if(isset($a[$i])) {
if($i == "site")
{
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else
{
echo $a[$i];
}
}
echo "</td>";
}
$actualNbr4++;
}
?>
<td></td>
<?php
$ct++;
echo "</tr>";
//}
}
}
?>
?>
</tbody>
</table>
</div>
......
......@@ -12,7 +12,7 @@
$properties = [
"pointGPS" => [
"coord" => [
"label" => "Point GPS",
"placeholder" => "Point GPS",
"inputType" => "formLocality",
......@@ -81,12 +81,12 @@
} else {
echo "<td>";
if(isset($a[$i])) {
if($i == "pointGPS"){
if($i == "coord"){
//$nameM = $a["localisation"];
$lat = $a["pointGPS"]["latitude"];
$lon = $a["pointGPS"]["longitude"];
echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"];
//echo implode(",", $a["pointGPS"]);
$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])){
......@@ -107,7 +107,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......@@ -154,6 +154,16 @@
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);
......@@ -205,7 +215,7 @@
});
if(typeof formData != "undefined" && typeof formData.geo != "undefined"){
tplCtx.value["pointGPS"] = formData.geo;
tplCtx.value["coord"] = formData.geo;
tplCtx.value["address"] = formData.address;
tplCtx.value["geo"] = formData.geo;
tplCtx.value["geoPosition"] = formData.geoPosition;
......
......@@ -63,7 +63,7 @@
],
"role" => [
"label" => "Rôles",
"placeholder" => "Choisir parmis les rôles de la liste",
"placeholder" => "Choisir parmi les rôles de la liste",
"inputType" => "selectMultiple",
"noOrder" => true,
"options" => $paramsData["role"],
......@@ -81,7 +81,14 @@
"label" => "contact",
"placeholder" => "Adresse mail",
"inputType" => "text",
"rules" => [ "required" => true ]
"rules" => [ "required" => false ]
],
"file" => [
"label" => "logo",
"placeholder" => "logo",
"inputType" => "uploader",
"rules" => [ "required" => false ],
"docType" => "file"
]
];
......@@ -137,9 +144,14 @@
foreach ($answers as $q => $a) {
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($i == "location"){
} else {
} else if($i == "file"){
}
else {
echo "<td>";
if(isset($a[$i])) {
if($i == "pointGPS"){
......@@ -150,6 +162,11 @@
//echo implode(",", $a["pointGPS"]);
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($i == "contact"){
if($canEdit){
echo $a[$i];
}
}
else if(is_array($a[$i])){
echo implode(",", $a[$i]);
}
......@@ -160,7 +177,39 @@
echo "</td>";
}
}
echo "<td>";
$initAnswerFiles=Document::getListDocumentsWhere(array(
"id"=>(string)$answer["_id"],
"type"=>'answers',
"subKey"=>$answerPath.$q), "file");
//echo $this->renderPartial("co2.views.pod.docsList",array("edit"=>false, "documents"=>$initAnswerFiles,"docType"=>"image") );
if(!empty($initAnswerFiles)){
$answers[$q]["files"] = $initAnswerFiles;
foreach ($initAnswerFiles as $key => $d) {
?>
<div style="width: 100%;" class=' padding-5 margin-top-5 margin-bottom-5' id='<?php echo $key ?>'>
<img src="<?php echo $d["docPath"] ?>" class="img-responsive">
<!-- <span class="col-xs-12 elipsis"><?php //echo $d["name"] ?></span> -->
<?php if($canEdit) { ?>
<!-- <a href='javascript:;' class='pull-right text-red btn-remove-document' data-id='<?php //echo $key ?>'><i class='fa fa-trash'></i> <?php //echo Yii::t("common","Delete") ?></a> -->
<?php } ?>
</div>
<?php
}
}else {
?>
<div style="width: 100%;" class='col-xs-12 col-sm-4 padding-5 shadow2 margin-top-5 margin-bottom-5' >
<img src="<?php echo Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl()."/images/thumbnail-default.jpg"; ?>" class="img-responsive">
</div>
<?php
}
echo "</td>";
?>
<td style="white-space: normal;">
<?php
$this->renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [
......@@ -168,7 +217,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......@@ -201,6 +250,9 @@
"icon" : "fa-globe",
"text" : "Décrire ici les principaux postes de dépenses : à quoi correspondent les coûts ? <br/>Préciser ce qui relève des dépenses de fonctionnement et des dépenses d’investissement.<br/>Les coûts doivent être en <b>hors taxe</b>.",
"properties" : <?php echo json_encode( $properties ); ?>,
beforeBuild : function(){
uploadObj.set("answers",answerObj._id.$id, "file", null, null, "/subKey/"+tplCtx.path);
},
save : function () {
var today = new Date();
tplCtx.value = { date : today.getDate() + '/' + (today.getMonth()+1) + '/' + today.getFullYear() };
......@@ -222,8 +274,21 @@
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
location.reload();
// $("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
dyFObj.commonAfterSave(null, function(){
// tplCtx.path = tplCtx.path + ".img";
// tplCtx.value = "answers/"+answerObj._id.$id+ ;
// dataHelper.path2Value( tplCtx, function(params) {
if(dyFObj.closeForm()){
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
location.reload();
}else{
location.reload();
}
// } );
});
} );
}
......
......@@ -127,7 +127,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["organisme"]);
echo implode(",", $a[$i]);
}
else {
......@@ -136,6 +136,10 @@
{
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else if($i == "type" && isset($paramsData[$i][$a[$i]])){
echo $paramsData[$i][$a[$i]];
}
else
{
echo $a[$i];
......
......@@ -110,7 +110,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i]))
echo implode(",", $a["partenaire"]);
echo implode(",", $a[$i]);
else
echo $a[$i];
}
......
......@@ -110,7 +110,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i]))
echo implode(",", $a["partenaire"]);
echo implode(",", $a[$i]);
else
echo $a[$i];
}
......
......@@ -13,13 +13,11 @@
$cetacesArray = [];
$i=0;
foreach ($l['list'] as $in => $inp) {
if(isset($inp["nomVernaculaire"])){
$cetacesArray += [$inp["nomVernaculaire"] => $inp["nomVernaculaire"]];
} else {
$cetacesArray += [$inp["nomValide"] => $inp["nomValide"]];
}
$i++;
$cetacesArray = [];
foreach ($l['list'] as $i => $inp) {
// $cetacesArray[$i] = $inp["nomScientifique"];
// $i++;
$cetacesArray += array($inp["nomScientifique"] => $inp["nomScientifique"]);
}
$a=[];
......@@ -46,13 +44,13 @@
"startDate" => [
"label" => "Année de creation",
"placeholder" => "Année de creation",
"inputType" => "date",
"inputType" => "text",
"rules" => [ "required" => true ]
],
"endDate" => [
"label" => "Année de fin",
"placeholder" => "Année de fin",
"inputType" => "date",
"inputType" => "text",
"rules" => [ "required" => true ]
],
"Gestion" => [
......@@ -132,7 +130,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",",$a["especeCible"]);
echo implode(",",$a[$i]);
} else {
if($i == "site") {
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
......
......@@ -125,7 +125,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
echo implode(",", $a[$i]);
}
else {
......
......@@ -83,18 +83,18 @@
"inputType" => "text",
"rules" => [ "required" => false ]
],
"dateP" => [
"label" => "Date de mise à jour",
"placeholder" => "Date de mise à jour",
"inputType" => "date",
"rules" => [ "required" => false ]
],
"dateM" => [
"label" => "Date de mise en application",
"placeholder" => "Date de mise en application",
"inputType" => "date",
"rules" => [ "required" => false ]
],
"dateP" => [
"label" => "Date de mise à jour",
"placeholder" => "Date de mise à jour",
"inputType" => "date",
"rules" => [ "required" => false ]
],
"organisme" => [
"label" => "Organisme associé",
"placeholder" => "Sélectionner l’organisme de gestion",
......@@ -107,15 +107,15 @@
"placeholder" => "Site de référence pour consultation",
"inputType" => "text",
"rules" => [ "required" => false ]
],
"natureP" => [
"label" => "Nature",
"placeholder" => "Nature",
"inputType" => "select",
"noOrder" => true,
"options" => $paramsData["nature"],
"rules" => [ "required" => false ]
]
// "natureP" => [
// "label" => "Nature",
// "placeholder" => "Nature",
// "inputType" => "select",
// "noOrder" => true,
// "options" => $paramsData["nature"],
// "rules" => [ "required" => false ]
// ]
];
......@@ -155,10 +155,9 @@
<?php
foreach ($properties as $i => $inp) {
if($actualNbr1 < 6){
echo "<th>".$inp["label"]."</th>";
}
$actualNbr1++;
}
?>
<th></th>
......@@ -169,31 +168,28 @@
<tbody class="directoryLines">
<?php
$ct = 0;
$actualNbr2 = 0;
if(isset($answers)){
foreach ($answers as $q => $a) {
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($actualNbr2 < 6){
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
$j = 0;
foreach ($a[$i] as $value) {
foreach ($l['list'] as $il => $inp) {
if($value == $il){
echo $inp["nomVernaculaire"];
if($j < count($a[$i]) - 1){
echo ',';
}
}
}
$j++;
}
echo implode(",", $a[$i]);
}
else if($i == "site") {
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else if($i == "nature" && isset($paramsData["natureP"][$a[$i]])){
echo $paramsData[$i][$a[$i]];
}
else {
if($a[$i] == "true"){
echo "oui";
......@@ -207,8 +203,8 @@
}
echo "</td>";
}
$actualNbr2++;
}
?>
<td style="white-space: normal;">
<?php
......@@ -231,72 +227,6 @@
?>
<?php if(isset($answers)){ ?>
<tr>
</th>
<?php
$actualNbr3 = 0;
foreach ($properties as $i => $inp) {
if($actualNbr3 > 5){
echo "<th>".$inp["placeholder"]."</th>";
}
$actualNbr3++;
}
?>
<th></th><th></th>
</tr>
<?php } ?>
<?php
$ct = 0;
$actualNbr4 = 0;
if(isset($answers)){
foreach ($answers as $q => $a) {
//var_dump($actualNbr4);
//if($actualNbr4 > 4){
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($actualNbr4 > 5){
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
}
else {
if($i == "site")
{
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else
{
if ($i == "siteP")
{
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else
{
echo $a[$i];
}
}
}
}
echo "</td>";
}
$actualNbr4++;
}
?>
<td></td><td></td>
<?php
$ct++;
echo "</tr>";
//}
}
}
?>
</tbody>
</table>
......
This diff is collapsed.
......@@ -97,7 +97,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
echo implode(",", $a[$i]);
}
else {
......
......@@ -120,7 +120,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
echo implode(",", $a[$i]);
}
else {
if($a[$i] == "true"){
......
......@@ -12,7 +12,7 @@
"type" => [
"Transport de passagers" => "Transport de passagers",
"Club de plongée" => "Club de plongée",
"Location de Navire" => "Location de Navire",
"Location" => "Location de navires",
"Autre" => "Autre"
],
......@@ -29,7 +29,8 @@
],
"pratique" => [
"Embarquée" => "Embarquée",
"Nage avec" => "Nage avec"
"Nage avec" => "Nage avec",
"deux" => "Les deux"
],
"paramsP" => [
"onText" => "oui",
......@@ -92,14 +93,14 @@
"options" => $paramsData["type"],
"rules" => [ "required" => false ]
],
"statut" => [
"label" => "Statut",
"placeholder" => "Statut",
"inputType" => "select",
"noOrder" => true,
"options" => $paramsData["statut"],
"rules" => [ "required" => false ]
],
// "statut" => [
// "label" => "Statut",
// "placeholder" => "Statut",
// "inputType" => "select",
// "noOrder" => true,
// "options" => $paramsData["statut"],
// "rules" => [ "required" => false ]
// ],
"nbrNav" => [
"label" => "Nombre de navires ou appareils",
"placeholder" => "Nombre de navires ou appareils",
......@@ -172,7 +173,7 @@
<?php
foreach ($properties as $i => $inp) {
echo "<th>".$inp["placeholder"]."</th>";
echo "<th>".$inp["label"]."</th>";
} ?>
<th></th>
</tr>
......@@ -191,13 +192,20 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["portExp"]);
echo implode(",", $a[$i]);
}
else {
if($a[$i] == "true"){
echo "oui";
}else if($a[$i] == "false"){
echo "non";
}else if($i == "pratique" && isset($paramsData[$i][$a[$i]])){
echo $paramsData[$i][$a[$i]];
}
else if($i == "typeStruct" && isset($paramsData["type"][$a[$i]])){
echo $paramsData["type"][$a[$i]];
}
else {
echo $a[$i];
......
......@@ -43,14 +43,14 @@
$properties = [
"organisme" => [
"label" => "Exploitant du site",
"placeholder" => "Exploitant du site",
"label" => "Nom de l’organisme",
"placeholder" => "Sélectionner l’organisme",
"inputType" => "selectMultiple",
"options" => $a,
"rules" => [ "required" => false ]
],
"pointGps" => [
"coord" => [
"label" => "Point d’observation terrestre",
"placeholder" => "Point d’observation terrestre",
"inputType" => "formLocality",
......@@ -143,12 +143,12 @@
} else {
echo "<td>";
if(isset($a[$i])) {
if($i == "pointGPS"){
if($i == "coord"){
//$nameM = $a["localisation"];
$lat = $a["pointGPS"]["latitude"];
$lon = $a["pointGPS"]["longitude"];
echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"];
//echo implode(",", $a["pointGPS"]);
$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])){
......@@ -214,9 +214,26 @@
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();
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")
toastr.error('value cannot be empty!');
......
......@@ -158,7 +158,7 @@
echo "<td>";
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a["ocean"]);
echo implode(",", $a[$i]);
}
else {
if($a[$i] == "true"){
......
......@@ -103,7 +103,7 @@
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["ocean"]);
echo implode(",", $a[$i]);
}
else{
echo $a[$i];
......
<?php
$defaultColor = "#354C57";
$structField = "structags";
$keyTpl = "wizard";
$paramsData = [ "title" => "",
"color" => "",
"background" => "",
"nbList" => 2,
"defaultcolor" => "#354C57",
"tags" => "structags"
];
if( isset(Yii::app()->session["costum"]["tpls"][$keyTpl]) ) {
foreach ($paramsData as $i => $v) {
if( isset(Yii::app()->session["costum"]["tpls"][$keyTpl][$i]) )
$paramsData[$i] = Yii::app()->session["costum"]["tpls"][$keyTpl][$i];
}
}
?>
<div class="col-xs-12 margin-top-20">
<div id="<?php echo $wizid ?>" class="swMain">
<style type="text/css">
.swMain ul li > a.done .stepNumber {
border-color: <?php echo ( @$color1 ) ? $color1 : $defaultColor ?>;
background-color: <?php echo ( @$color1 ) ? $color1 : $defaultColor ?>;
}
swMain > ul li > a.selected .stepDesc, .swMain li > a.done .stepDesc {
color: <?php echo ( @$color1 ) ? $color1 : $defaultColor ?>;
font-weight: bolder;
}
.swMain > ul li > a.selected::before, .swMain li > a.done::before{
border-color: <?php echo ( @$color1 ) ? $color1 : $defaultColor ?>;
}
</style>
<ul id="wizardLinks">
<?php
// var_dump($listSteps); exit;
$activeStep = 0;
$nextStepValid =true;
foreach ($formList as $k => $v) {
$n = "todo";
$p = null;
$form = PHDB::findOne( Form::COLLECTION,[ "id"=>$v ] );
if( !empty($form) )
$n = $form["name"];
echo "<li>";
$d = '';
$lbl = "?";
// if(isset(Yii::app()->session["costum"]["form"]["hasStepValidations"]) )
// $lbl = "";
if( (!isset($answer["step"]) && !isset(Yii::app()->session["costum"]["form"]["hasStepValidations"])) ||
$k == 0 ||
(isset($answer["step"]) && $answer["step"] == "all" ) ||
(isset(Yii::app()->session["costum"]["form"]["hasStepValidations"]) && isset($answer["step"]) && $k <= array_search($answer["step"], $formList) ) ||
( isset(Yii::app()->session["costum"]["form"]["hasStepValidations"]) && !isset($answer["step"]) && $k <= Yii::app()->session["costum"]["form"]["hasStepValidations"] ) )
{
$d = 'class="done"';
$lbl = $k;
$l = 'showStepForm(\'#'.$v.'\')' ;
$activeStep = $k;
}
echo '<a onclick="'.$l.'" href="javascript:;" '.$d.' >';
echo '<div class="stepNumber">'.$lbl.'</div>';
echo '<span class="stepDesc">'.$n.'</span></a>';
echo "</li>";
}
?>
</ul>
<?php
foreach ($formList as $k => $v) {
$hide = ($k==$activeStep) ? "" : "hide";
?>
<div id='<?php echo $v ?>' class='align-self-center col-sm-10 sectionStep <?php echo $hide ?>' style="padding-bottom:40px">
<?php
$form = PHDB::findOne( Form::COLLECTION,[ "id"=>$v ] );
?>
<script type=