diff --git a/controllers/actions/NewAction.php b/controllers/actions/NewAction.php index 767514fd0b7b29d656d6b4b2c8cef7fef85c6410..5ef27929c4a8124a7b0b8a7ffa9ce0ee9c00f6b2 100755 --- a/controllers/actions/NewAction.php +++ b/controllers/actions/NewAction.php @@ -43,7 +43,7 @@ class NewAction extends CAction "keys" => array($costum["slug"]), "insertOrign" => "costum") ; } - PHDB::insert( self::ANSWER_COLLECTION, $answer); + PHDB::insert( Form::ANSWER_COLLECTION, $answer); $res = array( "result" => true, "answer" => $answer ); } catch (CTKException $e){ diff --git a/views/tpls/forms/cplx/multiCheckboxPlus.php b/views/tpls/forms/cplx/multiCheckboxPlus.php index 64ee96b11491497c6b43edfd690b68ddb3d87226..fd0cfbca81d6cb87ae7242180fb640745855294a 100644 --- a/views/tpls/forms/cplx/multiCheckboxPlus.php +++ b/views/tpls/forms/cplx/multiCheckboxPlus.php @@ -109,7 +109,7 @@ $cle = $key ; $value = (!empty($answers)) ? " value='".$answers."' " : ""; $inpClass = " saveOneByOne"; -$editParamsBtn = ($canEditForm) ? " " : ""; +$editParamsBtn = ($canEditForm) ? " " : ""; @@ -239,7 +239,7 @@ if($mode == "r") { - echo " "; + echo " "; @@ -251,7 +251,7 @@ if($mode == "r") { if($value == "cplx") { - echo " "; + echo " "; } } } @@ -382,7 +382,7 @@ if($mode == "r") { - echo " "; + echo " "; @@ -394,7 +394,7 @@ if($mode == "r") { if($value == "cplx") { - echo " "; + echo " "; } } } diff --git a/views/tpls/forms/cplx/multitextvalidation.php b/views/tpls/forms/cplx/multitextvalidation.php index ae9dad24ab989e3fcdf05375689492d583034c32..11b3d60c8afdc81b365e048a0df7a0f25744c511 100644 --- a/views/tpls/forms/cplx/multitextvalidation.php +++ b/views/tpls/forms/cplx/multitextvalidation.php @@ -169,7 +169,7 @@ $paramsData = [ "text" => "texte", "number" => "Nombre", "email" => "adresse mail", - "unique" => [ "siret" ] + "unique" => "Siret" ] ]; @@ -213,7 +213,7 @@ if($mode == "r"){ ?> if($canEditForm){ - echo " "; + echo " "; } ?> @@ -297,13 +297,32 @@ if($mode == "r"){ ?> $(this).parent().addClass('true-validate'); } - answer.path = "answers."+$(this).data("form")+"."+$(this).data("id"); - answer.collection = "answers" ; - answer.id = ""; - answer.value = $(this).val(); - dataHelper.path2Value(answer , function(params) { - //toastr.success('saved'); - }); + if($(this).attr('type') == 'unique' ) { + ajaxPost(null, baseUrl+"/co2/search/globalautocomplete", {"searchType" : ["organizations"], "filters": { "siret" : [$(this).val()] }}, + function (data){ + if (Object.entries(data.results).length === 0){ + answer.path = "answers."+$(this).data("form")+"."+$(this).data("id"); + answer.collection = "answers" ; + answer.id = ""; + answer.value = $(this).val(); + dataHelper.path2Value(answer , function(params) { + //toastr.success('saved'); + }); + } else { + toastr.error('cette organisation existe déjà'); + } + } + ); + } else { + + answer.path = "answers."+$(this).data("form")+"."+$(this).data("id"); + answer.collection = "answers" ; + answer.id = ""; + answer.value = $(this).val(); + dataHelper.path2Value(answer , function(params) { + //toastr.success('saved'); + }); + } } }) }); @@ -339,8 +358,6 @@ if($mode == "r"){ ?> $(thisAlert).removeClass('alert-validate'); } - - diff --git a/views/tpls/forms/sommom/acteurEncadrement.php b/views/tpls/forms/sommom/acteurEncadrement.php index a87c3f7a5ba4f4c3fb2efab7ad110c9f4b3d33ad..ea083fa1c5226a140579284dc5dbcd9302faf0df 100644 --- a/views/tpls/forms/sommom/acteurEncadrement.php +++ b/views/tpls/forms/sommom/acteurEncadrement.php @@ -1,12 +1,11 @@
- - Ajouter une ligne " : ""; - $editParamsBtn = ($canEdit) ? " " : ""; + Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $a = []; @@ -97,9 +96,12 @@ ?> + + +
- @@ -115,7 +117,9 @@ echo ""; } } ?> - + + + @@ -152,19 +156,21 @@ } } ?> - + + + "; @@ -174,7 +180,77 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ +
+ +
+ + + + + + 0 ){ + foreach ($properties as $i => $inp) { + if (isset($inp["placeholder"])){ + echo ""; + } + } ?> + + + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + if($i == "location"){ + } else { + echo ""; + } + } + + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if($i == "pointGPS"){ + //$nameM = $a["localisation"]; + $lat = $a["pointGPS"]["latitude"]; + $lon = $a["pointGPS"]["longitude"]; + echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"]; + //echo implode(",", $a["pointGPS"]); + echo ''; + } + else if(is_array($a[$i])){ + echo implode(",", $a["port"]); + } + else{ + echo $a[$i]; + } + } + echo "
+ + + + + +
+ -CALENDAR works with existing answers"; -} ?> \ No newline at end of file + \ No newline at end of file diff --git a/views/tpls/forms/sommom/airemarineprotege.php b/views/tpls/forms/sommom/airemarineprotege.php index a846db19bf0b77ae852a447dbaad4661d8aaa430..68df316b363faf0430c73482e235f600625313d3 100644 --- a/views/tpls/forms/sommom/airemarineprotege.php +++ b/views/tpls/forms/sommom/airemarineprotege.php @@ -1,12 +1,11 @@
- + Ajouter une ligne Ajouter un organisme '" : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "statut" => [ @@ -114,10 +113,12 @@ } ?> + +
- @@ -135,7 +136,9 @@ } } } ?> - + + + @@ -175,19 +178,21 @@ } ?> - + + + "; @@ -197,7 +202,87 @@ ?>

">

+
" >

">

- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + 0 ){ ?> + + $inp) { + if(isset($inp["label"])){ + if(isset($inp["label"])){ + echo ""; + } + } + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + if($i == "location"){ + } else { + echo ""; + } + } + echo ""; + } + } + + ?> + +
".$inp["label"]."
"; + if(isset($a[$i])) { + if($i == "coord"){ + $lat = $a["coord"]["latitude"]; + $lon = $a["coord"]["longitude"]; + echo $a["coord"]["latitude"]." / ".$a["coord"]["longitude"]; + //echo implode(",", $a["coord"]); + echo ''; + } + else if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else if($i == "site") { + echo "".$a[$i].""; + } + else{ + echo $a[$i]; + } + } + echo "
+ + + + + + + + + +
+ -CALENDAR works with existing answers"; -} ?> \ No newline at end of file + \ No newline at end of file diff --git a/views/tpls/forms/sommom/az.json b/views/tpls/forms/sommom/az.json new file mode 100644 index 0000000000000000000000000000000000000000..800bd35af2554c3e52d59b3a4dbad3c02cf96021 --- /dev/null +++ b/views/tpls/forms/sommom/az.json @@ -0,0 +1,98 @@ +{ + "_id" : ObjectId("5e4fbf0041e01ff668c90f2f"), + "id" : "sommomForm1", + "type" : "openForm", + "name" : "TERRITOIRE – DESCRIPTION GENERALE", + "inputs" : { + "sommomForm120" : { + "label" : "Nom du territoire", + "placeholder" : "", + "info" : "Quel est le territoire décrit ? (territoire français d'outre-mer ou métropolitain)", + "type" : "tpls.forms.text", + "position" : "1" + }, + "sommomForm121" : { + "label" : "Nombre d'îles", + "placeholder" : "", + "info" : "Combien d'îles composent le territoire décrit ?", + "type" : "tpls.forms.text", + "position" : "2" + }, + "sommomForm128" : { + "label" : "Geeolocalisation du territoire", + "placeholder" : "", + "info" : "", + "type" : "tpls.forms.sommom.mapterritoire", + "position" : "3" + }, + "sommomForm19" : { + "label" : "Photo", + "placeholder" : "", + "info" : "", + "type" : "tpls.forms.uploader", + "uploader" : { + "docType" : "file", + "paste" : true, + "itemLimit" : 1 + }, + "position" : "4" + }, + "sommomForm122" : { + "label" : "Organisme de ce territoire", + "placeholder" : "", + "info" : "Organisme de ce territoire", + "type" : "tpls.forms.sommom.organisme", + "position" : "5" + }, + "sommomForm11" : { + "label" : "Espace géographique du territoire", + "placeholder" : "", + "info" : "Généralités", + "type" : "tpls.forms.sommom.geographie", + "position" : "6" + }, + "sommomForm12" : { + "label" : "Zones d’observation / d’activité", + "placeholder" : "", + "info" : "Zones d’observation / d’activité", + "type" : "tpls.forms.sommom.zone_obs_act", + "position" : "7" + }, + "sommomForm13" : { + "label" : "Espèces ciblées par l'activité d'observation", + "placeholder" : "", + "info" : "Ces champs permettent de renseigner les espèces présentes sur le territoire et leurs spécificités locales.", + "type" : "tpls.forms.sommom.especeObs", + "position" : "8" + }, + "sommomForm14" : { + "label" : "Plans de conservation", + "placeholder" : "", + "info" : "", + "type" : "tpls.forms.sommom.planConsevation", + "position" : "9" + }, + "sommomForm15" : { + "label" : "Les collaborations régionales et intergouvernementales", + "placeholder" : "", + "info" : "Ces champs permettent de renseigner des collaborations existantes entre le territoire et d’autres acteurs, pays, etc. de la région interagissant sur les mêmes populations de cétacés.", + "type" : "tpls.forms.sommom.collaboration", + "position" : "10" + }, + "sommomForm165" : { + "label" : "Aire marine Protégée", + "placeholder" : "", + "info" : "", + "type" : "tpls.forms.sommom.airemarineprotege", + "position" : "11" + }, + "sommomForm1654" : { + "label" : "Réglementation", + "placeholder" : "", + "info" : "", + "type" : "tpls.forms.sommom.reglementationesp", + "position" : "12" + } + }, + "updated" : NumberLong(1587121650) +} \ No newline at end of file diff --git a/views/tpls/forms/sommom/collaboration.php b/views/tpls/forms/sommom/collaboration.php index 98d86539bd24d9e01905e4633088fb2a97f75e9e..73d44e1197161002a24095bdc912177922e4c7b2 100644 --- a/views/tpls/forms/sommom/collaboration.php +++ b/views/tpls/forms/sommom/collaboration.php @@ -1,13 +1,12 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "nature" => [ @@ -112,9 +111,12 @@ ?> + + +
- @@ -128,7 +130,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -166,19 +170,21 @@ echo ""; } ?> - + + + "; @@ -188,7 +194,81 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } else { + if($i == "site") { + echo "".$a[$i].""; + } + 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]; + } + } + } + echo "
+ + + + + + + +
+ -CALENDAR works with existing answers"; -} ?> \ No newline at end of file + \ No newline at end of file diff --git a/views/tpls/forms/sommom/contribution.php b/views/tpls/forms/sommom/contribution.php index 139b6544ec44a570744540530fca0f8b8b9ee5bd..766b7152b045a96035d745a46c543c2bb45fd03b 100644 --- a/views/tpls/forms/sommom/contribution.php +++ b/views/tpls/forms/sommom/contribution.php @@ -1,12 +1,11 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "type" => [ @@ -81,9 +80,12 @@ ?> + + +
- @@ -97,7 +99,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -132,19 +136,21 @@ echo ""; } ?> - + + + "; @@ -154,7 +160,23 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/encadrementrec.php b/views/tpls/forms/sommom/encadrementrec.php index 2519da489cdbb988d7c46a4c3c1c1795d1acaf17..f42d9bfa9e91dcaae3e51adba2ace719c8c933a2 100644 --- a/views/tpls/forms/sommom/encadrementrec.php +++ b/views/tpls/forms/sommom/encadrementrec.php @@ -1,14 +1,12 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; - + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "paramsP" => [ "onText" => "oui", @@ -125,9 +123,12 @@ $actualNbr1 = 0; ?> + + +
- @@ -142,7 +143,9 @@ echo ""; } ?> - + + + @@ -176,19 +179,21 @@ echo ""; } ?> - + + + "; @@ -198,7 +203,75 @@ ?>

">

+
" >

">

".$inp["label"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + 0 ){ ?> + + + $inp) { + echo ""; + } + ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["label"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])) + { + echo implode(",", $a[$i]); + } + else { + if($a[$i] == "true"){ + echo "oui"; + }else if($a[$i] == "false"){ + echo "non"; + } + else { + echo $a[$i]; + } + } + } + echo "
+ + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/equipeDedie.php b/views/tpls/forms/sommom/equipeDedie.php index 3a518f776b626614b47a2faf2cc4d19e6025ad3b..7007f06b9955ef2ea7d7c44ed506a8473a412a27 100644 --- a/views/tpls/forms/sommom/equipeDedie.php +++ b/views/tpls/forms/sommom/equipeDedie.php @@ -1,12 +1,11 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "lieu" => [ @@ -80,9 +79,12 @@ ?> + + +
- @@ -96,7 +98,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -126,19 +130,21 @@ echo ""; } ?> - + + + "; @@ -148,7 +154,69 @@ ?>

">

+
" >

">

".$inp["label"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["label"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } else { + if($i == "site") { + echo "".$a[$i].""; + } + else { + echo $a[$i]; + } + } + } + echo "
+ + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/especeObs.php b/views/tpls/forms/sommom/especeObs.php index 211d47f3fa0867cc57df192c1da8f244c9833159..6f93ca93036f297bbe8aba57d49c265c03e8212f 100644 --- a/views/tpls/forms/sommom/especeObs.php +++ b/views/tpls/forms/sommom/especeObs.php @@ -1,11 +1,11 @@
- + Ajouter une ligne " : ""; - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; @@ -182,9 +182,13 @@ } ?> + + + +
- @@ -201,7 +205,9 @@ } } ?> - + + + @@ -259,19 +265,21 @@ } } ?> - + + + "; @@ -281,7 +289,104 @@ ?>

">

+
" >

">

- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + if(isset($inp["placeholder"])){ + echo ""; + } + + } ?> + + + + + $a) { + + echo ""; + $contr = 0; + foreach ($properties as $i => $inp) { + if($i == "location"){ + } else { + echo ""; + } + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])) { + + echo implode(",", $a[$i]); + + + } + else { + if (ctype_digit($a[$i]) && $contr == 0) { + foreach ($l['list'] as $k => $inp) { + if($k == $a[$i]){ + echo $inp["nomScientifique"]; + } + } + } else + if($a[$i] == "true"){ + echo "oui"; + }else if($a[$i] == "false"){ + echo "non"; + }else if($i == "frequenceOb" && isset($paramsData[$i][$a[$i]])){ + + echo $paramsData[$i][$a[$i]]; + } + else if($i == "dpPresence" && isset($paramsData["month"][$a[$i]])){ + echo($paramsData["month"][$a[$i]]); + } + else if($i == "pPresence" && isset($paramsData["month"][$a[$i]])){ + echo($paramsData["month"][$a[$i]]); + } + else { + echo $a[$i]; + } + } + + } + $contr++; + echo "
+ + + + + + + +
+ -CALENDAR works with existing answers"; -} ?> + diff --git a/views/tpls/forms/sommom/evntdedie.php b/views/tpls/forms/sommom/evntdedie.php index f9713fa7ee7592b12bc7197de6dfb4ef4f4f200a..611aacee71b749ecef6cb343a306ac6b3f2c1f94 100644 --- a/views/tpls/forms/sommom/evntdedie.php +++ b/views/tpls/forms/sommom/evntdedie.php @@ -1,12 +1,11 @@
- + Ajouter une ligne " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ @@ -78,9 +77,12 @@ ?> + + +
- @@ -94,7 +96,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -129,19 +133,21 @@ echo ""; } ?> - + + + "; @@ -151,7 +157,77 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else { + + + if($i == "site") + { + echo "".$a[$i].""; + } + else + { + echo $a[$i]; + } + } + } + echo "
+ + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/formdedie.php b/views/tpls/forms/sommom/formdedie.php index 5fd60dcef22e93a837bb080c34fc253456a481e8..87cd1c86ccc8847c7abaa0bebb7958e298a4e3bf 100644 --- a/views/tpls/forms/sommom/formdedie.php +++ b/views/tpls/forms/sommom/formdedie.php @@ -1,12 +1,11 @@ -
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = []; @@ -89,9 +88,12 @@ ?> + + +
- @@ -105,7 +107,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -140,19 +144,21 @@ echo ""; } ?> - + + + "; @@ -162,7 +168,76 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else { + + + if($i == "lien") + { + echo "".$a[$i].""; + } + else + { + echo $a[$i]; + } + } + } + echo "
+ + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/geographie.php b/views/tpls/forms/sommom/geographie.php index b79403515291539efc8853dfca24aa5775c9d1dc..897ed74e9a77dafee71fa0a77a7626add3a88448 100644 --- a/views/tpls/forms/sommom/geographie.php +++ b/views/tpls/forms/sommom/geographie.php @@ -1,12 +1,11 @@
- + Ajouter une ligne " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "ocean" => [ @@ -84,9 +83,12 @@ ?> + + +
- @@ -102,7 +104,9 @@ echo ""; } } ?> - + + + @@ -138,19 +142,21 @@ } } ?> - + + + "; @@ -160,7 +166,78 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + if (isset($inp["placeholder"])){ + echo ""; + } + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + if($i == "location"){ + } else { + echo ""; + } + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if($i == "coord"){ + $lat = $a["coord"]["latitude"]; + $lon = $a["coord"]["longitude"]; + echo $a["coord"]["latitude"]." / ".$a["coord"]["longitude"]; + //echo implode(",", $a["coord"]); + echo ''; + } + else if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else{ + echo $a[$i]; + } + } + echo "
+ + + + + +
+ -CALENDAR works with existing answers"; -} ?> \ No newline at end of file + \ No newline at end of file diff --git a/views/tpls/forms/sommom/label.php b/views/tpls/forms/sommom/label.php index d23b8db5ce70c0f4829052b58d6d36d38b1a682e..5829a640399cb69955ac065a7be4a1247fefc443 100644 --- a/views/tpls/forms/sommom/label.php +++ b/views/tpls/forms/sommom/label.php @@ -1,12 +1,11 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "paramsP" => [ @@ -137,9 +136,12 @@ } ?> + + +
- @@ -155,7 +157,9 @@ echo ""; } ?> - + + + @@ -197,19 +201,21 @@ echo ""; } ?> - + + + "; @@ -218,7 +224,81 @@ ?>

">

+
" >

">

".$inp["label"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + 0 ){ ?> + + + $inp) { + echo ""; + } + ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } +?> + +
".$inp["label"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else + if($i == "site") + { + echo "".$a[$i].""; + } + else if($i == "type" && isset($paramsData[$i][$a[$i]])){ + + echo $paramsData[$i][$a[$i]]; + } + else { + if($a[$i] == "true"){ + echo "oui"; + }else if($a[$i] == "false"){ + echo "non"; + } + else { + echo $a[$i]; + } + } + } + echo "
+ + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/mapterritoire.php b/views/tpls/forms/sommom/mapterritoire.php index 8fd9fcbafacb152678d09311c9436ace18135fad..1096a8e730f3ed79651a85de4d1a146fd9361fc2 100644 --- a/views/tpls/forms/sommom/mapterritoire.php +++ b/views/tpls/forms/sommom/mapterritoire.php @@ -1,11 +1,10 @@
- - + Ajouter une ligne " : ""; - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = (!isset($answers) and $canEdit) ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm) ? " " : ""; $paramsData = []; @@ -45,84 +44,132 @@ ?> - - - - - 0 ){ ?> - - - +

">

- -
+ + + + + $inp) { - if (isset($inp["label"])){ - echo ""; - } - } ?> - - - - - - - $a) { - - echo ""; - foreach ($properties as $i => $inp) { - if($i == "location"){ - } else { - echo " + + $inp) { + if (isset($inp["label"])){ + echo ""; + } + } ?> + + + + + + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + if($i == "location"){ + } else { + echo ""; + } } - else if(is_array($a[$i])){ - echo implode(",", $a[$i]); + ?> + + + + "; } - else{ - echo $a[$i]; + } + + ?> + +
" >

">

+ +
".$inp["label"]."
"; - if(isset($a[$i])) { - if($i == "coord"){ - //$nameM = $a["localisation"]; - $lat = $a["coord"]["latitude"]; - $lon = $a["coord"]["longitude"]; - echo $a["coord"]["latitude"]." / ".$a["coord"]["longitude"]; - //echo implode(",", $a["coord"]); - echo ''; + if( count($answers)>0 ){ ?> +
".$inp["label"]."
"; + if(isset($a[$i])) { + if($i == "coord"){ + //$nameM = $a["localisation"]; + $lat = $a["coord"]["latitude"]; + $lon = $a["coord"]["longitude"]; + echo $a["coord"]["latitude"]." / ".$a["coord"]["longitude"]; + //echo implode(",", $a["coord"]); + echo ''; + } + else if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else{ + echo $a[$i]; + } + } + echo " + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + + +
+ + +
+ $a) { + + foreach ($properties as $i => $inp) { + if($i == "location"){ + } else { + if(isset($a[$i])) { + if($i == "coord"){ + //$nameM = $a["localisation"]; + $lat = $a["coord"]["latitude"]; + $lon = $a["coord"]["longitude"]; + echo $a["coord"]["latitude"]." / ".$a["coord"]["longitude"]; + //echo implode(",", $a["coord"]); + } + else if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else{ + echo $a[$i]; + } + } + } + } + } } - echo ""; - } - } - ?> - - renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - - "; - } - } - ?> - - + ?> +
+
+ +
+ -CALENDAR works with existing answers"; -} ?> \ No newline at end of file + \ No newline at end of file diff --git a/views/tpls/forms/sommom/nomterritoire.php b/views/tpls/forms/sommom/nomterritoire.php new file mode 100644 index 0000000000000000000000000000000000000000..cd4f7ba8e23dcbddf8ba731b054c9cd414dcd0bb --- /dev/null +++ b/views/tpls/forms/sommom/nomterritoire.php @@ -0,0 +1,36 @@ + +
+
+ +
+ +
+ +
> + + + +
+ + + + + + \ No newline at end of file diff --git a/views/tpls/forms/sommom/organisme.php b/views/tpls/forms/sommom/organisme.php index 30dade0ce62aebbb235a8499dc6a9fc7b9a201d2..7d96ff2d5707fa692e3e7f37009acc20f5e13737 100644 --- a/views/tpls/forms/sommom/organisme.php +++ b/views/tpls/forms/sommom/organisme.php @@ -1,60 +1,54 @@
- - - Ajouter une ligne " : ""; - $editParamsBtn = ($canEdit) ? " " : ""; - - $a = []; - if(isset($answer["answers"]["sommomForm1"])){ - - if(is_array($answer["answers"]["sommomForm1"])){ - foreach ($answer["answers"]["sommomForm1"] as $i => $inp) { + Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; + + $a = []; + if(isset($answer["answers"]["sommomForm1"])){ + if(is_array($answer["answers"]["sommomForm1"])){ + foreach ($answer["answers"]["sommomForm1"] as $i => $inp) { if(is_array($inp)){ foreach ($inp as $line) { - - if(isset($line["portName"])){ - $a += array($line["portName"] => $line["portName"]); - } - + if(isset($line["portName"])){ + $a += array($line["portName"] => $line["portName"]); + } } } } - - } } + } - $paramsData = [ - "role" => [ + $paramsData = [ + "role" => [ "Organisme impliqué dans le suivi, l’encadrement de l’activité d’observation" => "Organisme impliqué dans le suivi, l’encadrement de l’activité d’observation", "Organisme impliqué dans la pratique de l’activité d’observation : Opérateur en mer, opérateur aérien" => "Organisme impliqué dans la pratique de l’activité d’observation : Opérateur en mer, opérateur aérien", "Organisme impliqué dans la science et la recherche sur l’activité d’observation" => "Organisme impliqué dans la science et la recherche sur l’activité d’observation", "Organisme impliqué dans l’éducation et la sensibilisation sur l’activité d’observation" => "Organisme impliqué dans l’éducation et la sensibilisation sur l’activité d’observation", "Organisme impliqué dans la protection de l’environnement et la conservation des espèces" => "Organisme impliqué dans la protection de l’environnement et la conservation des espèces" - ], - - "statut" => [ - "Service représentant de l’Etat" => "Service représentant de l’Etat", - "Collectivité" => "Collectivité", - "Syndicat, fédération, représentant d’acteurs de la mer" => "Syndicat, fédération, représentant d’acteurs de la mer", - "Structure privée commerciale" => "Structure privée commerciale", - "Association de sport et loisir" => "Association de sport et loisir", - "Association environnementale" => "Association environnementale", - "Institut de recherche" => "Institut de recherche", - "Autre" => "Autre" - ] - ]; - - if( isset($parentForm["params"][$kunik]["statut"]) ) - $paramsData["statut"] = $parentForm["params"][$kunik]["statut"]; + ], + + "statut" => [ + "Service représentant de l’Etat" => "Service représentant de l’Etat", + "Collectivité" => "Collectivité", + "Syndicat, fédération, représentant d’acteurs de la mer" => "Syndicat, fédération, représentant d’acteurs de la mer", + "Structure privée commerciale" => "Structure privée commerciale", + "Association de sport et loisir" => "Association de sport et loisir", + "Association environnementale" => "Association environnementale", + "Institut de recherche" => "Institut de recherche", + "Autre" => "Autre" + ] + ]; + + if( isset($parentForm["params"][$kunik]["statut"]) ) + $paramsData["statut"] = $parentForm["params"][$kunik]["statut"]; $properties = [ "intitule" => [ - "label" => "Nom de l’organisme", + "label" => "Nom", "placeholder" => "Intitulé", "inputType" => "text", "rules" => [ "required" => true ] @@ -112,120 +106,242 @@ ?> - - - - - + +

">

- -
+ + + + + + + + 0 ){ ?> + + 0 ){ ?> - - + foreach ($properties as $i => $inp) { + if (isset($inp["label"])){ + echo ""; + } + } + ?> + + + + $a) { + echo ""; + foreach ($properties as $i => $inp) { + if($i != "location" && $i != "file"){ + echo ""; + } + } - foreach ($properties as $i => $inp) { - if (isset($inp["label"])){ - echo ""; - } - } ?> - - - - - - - "; - if(isset($answers)){ - foreach ($answers as $q => $a) { + $initAnswerFiles=Document::getListDocumentsWhere(array( + "id"=>(string)$answer["_id"], + "type"=>'answers', + "subKey"=>$answerPath.$q), "file"); - echo ""; - foreach ($properties as $i => $inp) { - if($i != "location" && $i != "file"){ - echo " + + + "; } - echo ""; } - } - echo " +
" >

">

+ +
".$inp["label"]."
"; + if(isset($a[$i])) { + if($i == "pointGPS"){ + //$nameM = $a["localisation"]; + $lat = $a["pointGPS"]["latitude"]; + $lon = $a["pointGPS"]["longitude"]; + echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"]; + //echo implode(",", $a["pointGPS"]); + echo ''; + } + + else if($i == "contact"){ + if($canEdit){ + echo $a[$i]; + } + } + else if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else{ + echo $a[$i]; + } + } + echo "".$inp["label"]."
"; - if(isset($a[$i])) { - if($i == "pointGPS"){ - //$nameM = $a["localisation"]; - $lat = $a["pointGPS"]["latitude"]; - $lon = $a["pointGPS"]["longitude"]; - echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"]; - //echo implode(",", $a["pointGPS"]); - echo ''; - } - else if($i == "contact"){ - if($canEdit){ - echo $a[$i]; - } - } - else if(is_array($a[$i])){ - echo implode(",", $a[$i]); - } - else{ - echo $a[$i]; + if(!empty($initAnswerFiles)){ + $answers[$q]["files"] = $initAnswerFiles; + foreach ($initAnswerFiles as $key => $d) { + ?> + +
+ " class="img-responsive"> + + + + +
+ + +
+ getAssetsUrl()."/images/thumbnail-default.jpg"; ?>" class="img-responsive"> +
+ "; + ?> + + +
+ renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> + "; - $initAnswerFiles=Document::getListDocumentsWhere(array( - "id"=>(string)$answer["_id"], - "type"=>'answers', - "subKey"=>$answerPath.$q), "file"); + ?> +
+ +
+ +
+ + + + + 0 ){ ?> + + renderPartial("co2.views.pod.docsList",array("edit"=>false, "documents"=>$initAnswerFiles,"docType"=>"image") ); - if(!empty($initAnswerFiles)){ - $answers[$q]["files"] = $initAnswerFiles; - foreach ($initAnswerFiles as $key => $d) { + foreach ($properties as $i => $inp) { + if (isset($inp["label"])){ + echo ""; + } + } ?> + + + + + + + $a) { + echo ""; + foreach ($properties as $i => $inp) { + if($i != "location" && $i != "file"){ + echo ""; + } + } -
- " class="img-responsive"> - - - - -
- + echo ""; + ?> - - "; - } - } + +
".$inp["label"]."
"; + if(isset($a[$i])) { + if($i == "pointGPS"){ + //$nameM = $a["localisation"]; + $lat = $a["pointGPS"]["latitude"]; + $lon = $a["pointGPS"]["longitude"]; + echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"]; + //echo implode(",", $a["pointGPS"]); + echo ''; + } + + else if($i == "contact"){ + if($canEdit){ + echo $a[$i]; + } + } + else if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else{ + echo $a[$i]; + } + } + echo ""; + + $initAnswerFiles=Document::getListDocumentsWhere(array( + "id"=>(string)$answer["_id"], + "type"=>'answers', + "subKey"=>$answerPath.$q), "file"); + + + if(!empty($initAnswerFiles)){ + $answers[$q]["files"] = $initAnswerFiles; + foreach ($initAnswerFiles as $key => $d) { + ?> + +
+ " class="img-responsive"> + + + + +
+ +
getAssetsUrl()."/images/thumbnail-default.jpg"; ?>" class="img-responsive">
- "; + ?> + + "; + } } - - echo "
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> -
+ + - -
+ + -CALENDAR works with existing answers"; -} ?> \ No newline at end of file + \ No newline at end of file diff --git a/views/tpls/forms/sommom/outilsPed.php b/views/tpls/forms/sommom/outilsPed.php index 3a8b3aa76570ea0b4267dbe671f25582db49cb2e..58a8dbb5e679aed47bfebe8ccb562870e597e757 100644 --- a/views/tpls/forms/sommom/outilsPed.php +++ b/views/tpls/forms/sommom/outilsPed.php @@ -1,12 +1,11 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ @@ -94,9 +93,12 @@ ?> + + +
- @@ -110,7 +112,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -150,19 +154,21 @@ echo ""; } ?> - + + + "; @@ -172,7 +178,81 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else { + + + if($i == "lien") + { + echo "".$a[$i].""; + } + else if($i == "type" && isset($paramsData[$i][$a[$i]])){ + + echo $paramsData[$i][$a[$i]]; + } + + else + { + echo $a[$i]; + } + } + } + echo "
+ + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/pgmrech.php b/views/tpls/forms/sommom/pgmrech.php index dbaaf534a20b25e13be3db7885220445044632e0..c38dbb911047aab0f5e1fa68752070cddcfb09c4 100644 --- a/views/tpls/forms/sommom/pgmrech.php +++ b/views/tpls/forms/sommom/pgmrech.php @@ -1,12 +1,11 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = []; @@ -76,9 +75,12 @@ ?> + + +
- @@ -92,7 +94,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -116,19 +120,21 @@ echo ""; } ?> - + + + "; @@ -138,7 +144,64 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])) + echo implode(",", $a[$i]); + else + echo $a[$i]; + } + echo "
+ + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/pgmsci.php b/views/tpls/forms/sommom/pgmsci.php index bf5fe5b3cdf3a6478844079603bc5b7ec5886101..90f703877855e3879fd258e11baee5d2d8d22210 100644 --- a/views/tpls/forms/sommom/pgmsci.php +++ b/views/tpls/forms/sommom/pgmsci.php @@ -1,12 +1,11 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = []; $a=[]; @@ -75,9 +74,12 @@ ?> + + +
- @@ -91,7 +93,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -115,19 +119,21 @@ echo ""; } ?> - + + + "; @@ -137,7 +143,64 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])) + echo implode(",", $a[$i]); + else + echo $a[$i]; + } + echo "
+ + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/planConsevation.php b/views/tpls/forms/sommom/planConsevation.php index 90e0d866c2e3af30e3bb9a774d7dfa8328c34663..bba701eb87f25a4c1ab059876db64373da514225 100644 --- a/views/tpls/forms/sommom/planConsevation.php +++ b/views/tpls/forms/sommom/planConsevation.php @@ -1,12 +1,12 @@
- + Ajouter une ligne Ajouter un organisme '" : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = []; $l = PHDB::findOne(Lists::COLLECTION, array('name' => 'cetaces')); @@ -92,9 +92,12 @@ ?> + + +
- @@ -108,7 +111,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -138,19 +143,21 @@ echo ""; } ?> - + + + "; @@ -160,7 +167,73 @@ ?>

">

+
" >

">

".$inp["label"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + + +
+ +
+ + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["label"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",",$a[$i]); + } else { + if($i == "site") { + echo "".$a[$i].""; + } + else { + echo $a[$i]; + } + } + } + echo "
+ + + + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/publact.php b/views/tpls/forms/sommom/publact.php index 06b16f06e0e1d0013a8f8905e8303a7df806a94c..22cda7c630e250717ab1889ae5cf7a6f47d42a8a 100644 --- a/views/tpls/forms/sommom/publact.php +++ b/views/tpls/forms/sommom/publact.php @@ -1,12 +1,12 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "type" => [ @@ -89,9 +89,12 @@ ?> + + +
- @@ -105,7 +108,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -140,19 +145,21 @@ echo ""; } ?> - + + + "; @@ -162,7 +169,75 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else { + + + if($i == "lien") + { + echo "".$a[$i].""; + } + else + { + echo $a[$i]; + } + } + } + echo "
+ + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/recommendation.php b/views/tpls/forms/sommom/recommendation.php index 2c07c559f5cd85837bcee33919f489005f7f1373..62d8504d3a8c61005d280904bcf04982fd5b0874 100644 --- a/views/tpls/forms/sommom/recommendation.php +++ b/views/tpls/forms/sommom/recommendation.php @@ -1,8 +1,7 @@
- - + Ajouter Réglementation " : ""; + $editBtnReg = ($canEdit) ? " Ajouter Réglementation " : ""; } if ($cr == ""){ - $editBtnCrt = ($canAnswer) ? " Ajouter Charte " : ""; + $editBtnCrt = ($canEdit) ? " Ajouter Charte " : ""; } if ($lb == ""){ - $editBtnLbl = ($canAnswer) ? " Ajouter Label " : ""; + $editBtnLbl = ($canEdit) ? " Ajouter Label " : ""; } $editParamsBtn = ($canEdit) ? " " : ""; @@ -338,6 +337,9 @@ $editBtnLbl = ""; } ?> + + +

">

@@ -810,7 +812,7 @@ $editBtnLbl = ""; renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), + "canEdit"=>($canEdit || $canEdit), "id" => $answer["_id"], "collection" => Form::ANSWER_COLLECTION, "q" => $q, @@ -837,7 +839,7 @@ $editBtnLbl = ""; renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), + "canEdit"=>($canEdit || $canEdit), "id" => $answer["_id"], "collection" => Form::ANSWER_COLLECTION, "q" => $q, @@ -863,7 +865,7 @@ $editBtnLbl = ""; renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), + "canEdit"=>($canEdit || $canEdit), "id" => $answer["_id"], "collection" => Form::ANSWER_COLLECTION, "q" => $q, @@ -888,7 +890,22 @@ $editBtnLbl = "";
+ + +
+ +
+ + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/recommendationnage.php b/views/tpls/forms/sommom/recommendationnage.php index c07a9ceb743783545e32afbf7126615cb3087a88..b600e2bc760316792bfd8eddcf73c87d389022eb 100644 --- a/views/tpls/forms/sommom/recommendationnage.php +++ b/views/tpls/forms/sommom/recommendationnage.php @@ -1,7 +1,7 @@
- + Ajouter Réglementation " : ""; + $editBtnReg = ($canEdit) ? " Ajouter Réglementation " : ""; } if ($cr == ""){ - $editBtnCrt = ($canAnswer) ? " Ajouter Charte " : ""; + $editBtnCrt = ($canEdit) ? " Ajouter Charte " : ""; } if ($lb == ""){ - $editBtnLbl = ($canAnswer) ? " Ajouter Label " : ""; + $editBtnLbl = ($canEdit) ? " Ajouter Label " : ""; } $editParamsBtn = ($canEdit) ? " " : ""; @@ -403,6 +403,9 @@ $editBtnLbl = ""; $actualNbr1 = 0; ?> + + +

">

@@ -1058,7 +1061,7 @@ $actualNbr1 = 0; renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), + "canEdit"=>($canEdit || $canEdit), "id" => $answer["_id"], "collection" => Form::ANSWER_COLLECTION, "q" => $q, @@ -1085,7 +1088,7 @@ $actualNbr1 = 0; renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), + "canEdit"=>($canEdit || $canEdit), "id" => $answer["_id"], "collection" => Form::ANSWER_COLLECTION, "q" => $q, @@ -1111,7 +1114,7 @@ $actualNbr1 = 0; renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), + "canEdit"=>($canEdit || $canEdit), "id" => $answer["_id"], "collection" => Form::ANSWER_COLLECTION, "q" => $q, @@ -1134,7 +1137,23 @@ $actualNbr1 = 0;
+ + +
+ +
+ + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/reglementation.php b/views/tpls/forms/sommom/reglementation.php index 7a893fa1245d93fcf3cae4a2866344659e8edb5f..21c773efbfca476b97a8a00ad673e54a16facbc7 100644 --- a/views/tpls/forms/sommom/reglementation.php +++ b/views/tpls/forms/sommom/reglementation.php @@ -1,13 +1,12 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "type" => [ @@ -143,9 +142,12 @@ $actualNbr1 = 0; ?> + + +
- @@ -160,7 +162,9 @@ echo ""; } ?> - + + + @@ -200,19 +204,21 @@ echo ""; } ?> - + + + "; @@ -223,7 +229,21 @@

">

+
" >

">

".$inp["label"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + + + + + + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/reglementationesp.php b/views/tpls/forms/sommom/reglementationesp.php index 6d1c44f664deca7bedc59cd177d39668cabf0798..05b705e36634e04f54b7a8dbca82358bdac78e1f 100644 --- a/views/tpls/forms/sommom/reglementationesp.php +++ b/views/tpls/forms/sommom/reglementationesp.php @@ -1,12 +1,10 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "type" => [ @@ -52,8 +50,8 @@ } } - if( isset($this->costum["form"]["params"][$kunik]["ocean"]) ) - $paramsData["ocean"] = $this->costum["form"]["params"][$kunik]["ocean"]; + if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["ocean"]) ) + $paramsData["ocean"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["ocean"]; $l = PHDB::findOne(Lists::COLLECTION, array('name' => 'cetaces')); $i=1; @@ -121,14 +119,14 @@ foreach ($properties as $k => $v) { if( isset($v["label"])){ - if( isset($this->costum["form"]["params"][$kunik]["labels"][$k]) ) - $properties[$k]["label"] = $this->costum["form"]["params"][$kunik]["labels"][$k]; + if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["labels"][$k]) ) + $properties[$k]["label"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["labels"][$k]; $propertiesParams["labels"][$k] = $properties[$k]["label"]; } if( isset($v["placeholder"])){ - if(isset($this->costum["form"]["params"][$kunik]["placeholders"][$k]) ) - $properties[$k]["placeholder"] = $this->costum["form"]["params"][$kunik]["placeholders"][$k]; + if(isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["placeholders"][$k]) ) + $properties[$k]["placeholder"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["placeholders"][$k]; $propertiesParams["placeholders"][$k] = $properties[$k]["placeholder"]; } } @@ -136,9 +134,12 @@ $actualNbr1 = 0; ?> + + +
- @@ -155,7 +156,9 @@ } ?> - + + + @@ -200,19 +203,21 @@ } } ?> - + + + "; @@ -223,7 +228,95 @@

">

+
" >

">

- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + + + +
+ +
+ + + + + + 0 ){ ?> + + $inp) { + + echo ""; + + } + ?> + + + + + $a) { + + echo ""; + + foreach ($properties as $i => $inp) { + if($i == "location"){ + } else { + echo ""; + } + } + echo ""; + } + } + + ?> + + +
".$inp["label"]."
"; + if(isset($a[$i])) { + if($i == "coord"){ + //$nameM = $a["localisation"]; + $lat = $a["coord"]["latitude"]; + $lon = $a["coord"]["longitude"]; + echo $a["coord"]["latitude"]." / ".$a["coord"]["longitude"]; + //echo implode(",", $a["coord"]); + echo ''; + } + else if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else{ + if($a[$i] == "true"){ + echo "oui"; + }else if($a[$i] == "false"){ + echo "non"; + } + else { + echo $a[$i]; + } + } + } + echo "
+ + + + +
+ + -CALENDAR works with existing answers"; -} ?> \ No newline at end of file + diff --git a/views/tpls/forms/sommom/sitededie.php b/views/tpls/forms/sommom/sitededie.php index c257b7457e754a397b2c87c1b6ca53a820459e16..5ebcff4d45ec3e4d87f7313ccb4e40a4bb773598 100644 --- a/views/tpls/forms/sommom/sitededie.php +++ b/views/tpls/forms/sommom/sitededie.php @@ -1,12 +1,11 @@
- + Ajouter une ligne " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ ]; @@ -60,9 +59,12 @@ ?> + + +
- @@ -76,7 +78,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -105,19 +109,21 @@ echo ""; } ?> - + + + "; @@ -127,7 +133,70 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + }else { + if($i == "lien"){ + echo "".$a[$i].""; + }else{ + echo $a[$i]; + } + } + } + echo "
+ + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/structureaer.php b/views/tpls/forms/sommom/structureaer.php index a535df66d1e928d93cbc60cc27b77ff164bba592..95fbf51dfeadc1f5aab34c61626c826979b18696 100644 --- a/views/tpls/forms/sommom/structureaer.php +++ b/views/tpls/forms/sommom/structureaer.php @@ -1,12 +1,11 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "paramsP" => [ @@ -85,10 +84,12 @@ } ?> + +
- @@ -102,7 +103,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -135,19 +138,21 @@ echo ""; } ?> - + + + "; @@ -157,7 +162,75 @@ ?>

">

+
" >

">

".$inp["label"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["label"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else { + if($a[$i] == "true"){ + echo "oui"; + }else if($a[$i] == "false"){ + echo "non"; + } + else { + echo $a[$i]; + } + } + } + echo "
+ + + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/structureop.php b/views/tpls/forms/sommom/structureop.php index 129f06ccb0054247603cdbf0f1421fabc17d3d4c..168e2c429ddc6f2666ea7cc0626dfec552544b02 100644 --- a/views/tpls/forms/sommom/structureop.php +++ b/views/tpls/forms/sommom/structureop.php @@ -1,13 +1,12 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "type" => [ @@ -158,9 +157,12 @@ ?> + + +
- @@ -174,7 +176,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -212,19 +216,21 @@ echo ""; } ?> - + + + "; @@ -234,7 +240,78 @@ ?>

">

+
" >

">

".$inp["label"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["label"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + 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]; + } + } + } + echo "
+ + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/structuresite.php b/views/tpls/forms/sommom/structuresite.php index 18a0eda89435837f7e96a99e675ac9c82e88805f..d56eb76574c8d990a4fe3a2b2eca2065704187b8 100644 --- a/views/tpls/forms/sommom/structuresite.php +++ b/views/tpls/forms/sommom/structuresite.php @@ -1,13 +1,12 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ @@ -108,9 +107,12 @@ ?> + + +
- @@ -127,7 +129,9 @@ } ?> - + + + @@ -171,19 +175,21 @@ } } ?> - + + + "; @@ -193,7 +199,88 @@ ?>

">

+
" >

">

- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + if(isset($inp["placeholder"])){ + echo ""; + } + + + } ?> + + + + + $a) { + + echo ""; + + foreach ($properties as $i => $inp) { + if($i != "location"){ + echo ""; + } + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if($i == "coord"){ + //$nameM = $a["localisation"]; + $lat = $a["coord"]["latitude"]; + $lon = $a["coord"]["longitude"]; + echo $a["coord"]["latitude"]." / ".$a["coord"]["longitude"]; + //echo implode(",", $a["coord"]); + echo ''; + } + else if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } + else{ + if($a[$i] == "true"){ + echo "oui"; + }else if($a[$i] == "false"){ + echo "non"; + } + else { + echo $a[$i]; + } + } + } + echo "
+ + + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/surveillanceControle.php b/views/tpls/forms/sommom/surveillanceControle.php index c451546fc40cc8017d35257421f6f34257fc2c92..370dec03c8192f248a46f612a6009762632f4386 100644 --- a/views/tpls/forms/sommom/surveillanceControle.php +++ b/views/tpls/forms/sommom/surveillanceControle.php @@ -1,13 +1,12 @@
- + Ajouter une ligne Ajouter un organisme " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "paramsP" => [ @@ -129,9 +128,12 @@ ?> + + +
- @@ -145,7 +147,9 @@ foreach ($properties as $i => $inp) { echo ""; } ?> - + + + @@ -177,19 +181,21 @@ echo ""; } ?> - + + + "; @@ -199,7 +205,70 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit || $canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + 0 ){ ?> + + $inp) { + echo ""; + } ?> + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + echo ""; + } + echo ""; + } + } + + ?> + +
".$inp["placeholder"]."
"; + if(isset($a[$i])) { + if(is_array($a[$i])){ + echo implode(",", $a[$i]); + } else { + if($a[$i] == "true"){ + echo "oui"; + }else if($a[$i] == "false"){ + echo "non"; + } + else { + echo $a[$i]; + } + } + } + echo "
+ + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/territoire.php b/views/tpls/forms/sommom/territoire.php index e51a13bebf7f19c624f727526dc8da35a72a57d5..0a3463ad4552610e294d7bdbb5209fab93ae0866 100644 --- a/views/tpls/forms/sommom/territoire.php +++ b/views/tpls/forms/sommom/territoire.php @@ -1,11 +1,11 @@
- + session["userId"] == $answer["user"]) ? " Ajouter une ligne " : ""; - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ @@ -63,9 +63,12 @@ ?> + + +
- @@ -81,7 +84,9 @@ echo ""; } } ?> - + + + @@ -114,19 +119,21 @@ } } ?> - + + + "; @@ -136,7 +143,23 @@ ?>

">

+
" >

">

".$inp["placeholder"]."
- renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit||Yii::app()->session["userId"] == $answer["user"]), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + +
+ -CALENDAR works with existing answers"; + \ No newline at end of file diff --git a/views/tpls/forms/sommom/wizard.php b/views/tpls/forms/sommom/wizard.php index 50e614d8527caa28f97e3a96dab2ff9e700af8b7..c8ad0c1cd5e5bb25d13f38c6b2cc8d3bf787728c 100644 --- a/views/tpls/forms/sommom/wizard.php +++ b/views/tpls/forms/sommom/wizard.php @@ -12,10 +12,10 @@ $paramsData = [ "title" => "", "tags" => "structags" ]; -if( isset($this->costum["tpls"][$keyTpl]) ) { +if( isset(Yii::app()->session["costum"]["tpls"][$keyTpl]) ) { foreach ($paramsData as $i => $v) { - if( isset($this->costum["tpls"][$keyTpl][$i]) ) - $paramsData[$i] = $this->costum["tpls"][$keyTpl][$i]; + if( isset(Yii::app()->session["costum"]["tpls"][$keyTpl][$i]) ) + $paramsData[$i] = Yii::app()->session["costum"]["tpls"][$keyTpl][$i]; } } @@ -56,15 +56,15 @@ if( isset($this->costum["tpls"][$keyTpl]) ) { $d = ''; $lbl = "?"; - // if(isset($this->costum["form"]["hasStepValidations"]) ) + // if(isset(Yii::app()->session["costum"]["form"]["hasStepValidations"]) ) // $lbl = ""; - if( (!isset($answer["step"]) && !isset($this->costum["form"]["hasStepValidations"])) || + if( (!isset($answer["step"]) && !isset(Yii::app()->session["costum"]["form"]["hasStepValidations"])) || $k == 0 || (isset($answer["step"]) && $answer["step"] == "all" ) || - (isset($this->costum["form"]["hasStepValidations"]) && isset($answer["step"]) && $k <= array_search($answer["step"], $formList) ) || - ( isset($this->costum["form"]["hasStepValidations"]) && !isset($answer["step"]) && $k <= $this->costum["form"]["hasStepValidations"] ) ) + (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; @@ -101,8 +101,8 @@ var formInputsHere = formInputs; { echo '

'.@$form["name"].'

'; echo "
"; - if(isset($this->costum["cms"][$form["id"]."desc"])) - echo htmlentities($this->costum["cms"][$form["id"]."desc"]); + if(isset(Yii::app()->session["costum"]["cms"][$form["id"]."desc"])) + echo htmlentities(Yii::app()->session["costum"]["cms"][$form["id"]."desc"]); else echo "* section description"; if($canEdit) diff --git a/views/tpls/forms/sommom/zone_obs_act.php b/views/tpls/forms/sommom/zone_obs_act.php index c6e99b64ebdaf71e99b21812710fdc9f3b91a8ed..151c49483cdefb536cc1486a53f5893995e76cdc 100644 --- a/views/tpls/forms/sommom/zone_obs_act.php +++ b/views/tpls/forms/sommom/zone_obs_act.php @@ -1,12 +1,11 @@
- + Ajouter une ligne " : ""; - - $editParamsBtn = ($canEdit) ? " " : ""; + $editBtnL = ($canEdit and $mode != "r" and $mode != "pdf") ? " Ajouter une ligne " : ""; + $editParamsBtn = ($canEditForm and $mode != "r" || $mode != "pdf") ? " " : ""; $paramsData = [ "month" => [ @@ -92,10 +91,13 @@ ?> + + +
- @@ -104,7 +106,10 @@ - + + + + + + + "; @@ -203,7 +210,119 @@ ?>

">

+
" >

">

$v) { if( $mn < 1) { echo $v["label"]; $mn++ ;} } ?> Port de départ Période de pratique
- - renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ - "canEdit"=>($canEdit||$canAnswer), - "id" => $answer["_id"], - "collection" => Form::ANSWER_COLLECTION, - "q" => $q, - "path" => $answerPath.$q, - "keyTpl"=>$kunik - ] ); ?> - - ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> - + renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ + "canEdit"=>($canEdit), + "id" => $answer["_id"], + "collection" => Form::ANSWER_COLLECTION, + "q" => $q, + "path" => $answerPath.$q, + "keyTpl"=>$kunik + ] ); ?> + + ','', '')">$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> +
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + $a) { + + echo ""; + foreach ($properties as $i => $inp) { + if($i == "location"){ + } else { + echo ""; + } + + } + echo ""; + } + } + + ?> + +
$v) { if( $mn < 1) { echo $v["label"]; $mn++ ;} } ?>Port de départPériode de pratique
$v) { + if( $mn ==2) { + echo $v["label"]; + } + $mn++ ; + } ?> $v) { + if( $mn ==3) { + echo $v["label"]; + } + $mn++ ; + } ?> $v) { + if( $mn ==5) { + echo $v["label"]; + } + $mn++ ; + } ?> $v) { + if( $mn ==6) { + echo $v["label"]; + } + $mn++ ; + } ?> $v) { + if( $mn ==7) { + echo $v["label"]; + } + $mn++ ; + } ?>
"; + if(isset($a[$i])) { + if($i == "pointGPS"){ + $nameM = $a["localisation"]; + $lat = $a["pointGPS"]["latitude"]; + $lon = $a["pointGPS"]["longitude"]; + echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"]; + //echo implode(",", $a["pointGPS"]); + echo ''; + + } + else{ + echo $a[$i]; + } + } + echo "
+ + + + + + + + + + +
+ -CALENDAR works with existing answers"; -} ?> \ No newline at end of file + \ No newline at end of file