Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
survey
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pixel Humain
survey
Commits
8235754a
Commit
8235754a
authored
Jul 09, 2020
by
Clément Damiens
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'qa'
parents
bac03c2a
0d0ef292
Changes
35
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
2908 additions
and
795 deletions
+2908
-795
controllers/actions/NewAction.php
controllers/actions/NewAction.php
+1
-1
views/tpls/forms/cplx/multiCheckboxPlus.php
views/tpls/forms/cplx/multiCheckboxPlus.php
+5
-5
views/tpls/forms/cplx/multitextvalidation.php
views/tpls/forms/cplx/multitextvalidation.php
+28
-11
views/tpls/forms/sommom/acteurEncadrement.php
views/tpls/forms/sommom/acteurEncadrement.php
+96
-22
views/tpls/forms/sommom/airemarineprotege.php
views/tpls/forms/sommom/airemarineprotege.php
+105
-22
views/tpls/forms/sommom/az.json
views/tpls/forms/sommom/az.json
+98
-0
views/tpls/forms/sommom/collaboration.php
views/tpls/forms/sommom/collaboration.php
+100
-22
views/tpls/forms/sommom/contribution.php
views/tpls/forms/sommom/contribution.php
+42
-21
views/tpls/forms/sommom/encadrementrec.php
views/tpls/forms/sommom/encadrementrec.php
+94
-22
views/tpls/forms/sommom/equipeDedie.php
views/tpls/forms/sommom/equipeDedie.php
+88
-21
views/tpls/forms/sommom/especeObs.php
views/tpls/forms/sommom/especeObs.php
+124
-21
views/tpls/forms/sommom/evntdedie.php
views/tpls/forms/sommom/evntdedie.php
+96
-21
views/tpls/forms/sommom/formdedie.php
views/tpls/forms/sommom/formdedie.php
+96
-22
views/tpls/forms/sommom/geographie.php
views/tpls/forms/sommom/geographie.php
+97
-22
views/tpls/forms/sommom/label.php
views/tpls/forms/sommom/label.php
+100
-21
views/tpls/forms/sommom/mapterritoire.php
views/tpls/forms/sommom/mapterritoire.php
+123
-78
views/tpls/forms/sommom/nomterritoire.php
views/tpls/forms/sommom/nomterritoire.php
+36
-0
views/tpls/forms/sommom/organisme.php
views/tpls/forms/sommom/organisme.php
+247
-133
views/tpls/forms/sommom/outilsPed.php
views/tpls/forms/sommom/outilsPed.php
+100
-21
views/tpls/forms/sommom/pgmrech.php
views/tpls/forms/sommom/pgmrech.php
+83
-21
views/tpls/forms/sommom/pgmsci.php
views/tpls/forms/sommom/pgmsci.php
+83
-21
views/tpls/forms/sommom/planConsevation.php
views/tpls/forms/sommom/planConsevation.php
+93
-21
views/tpls/forms/sommom/publact.php
views/tpls/forms/sommom/publact.php
+95
-21
views/tpls/forms/sommom/recommendation.php
views/tpls/forms/sommom/recommendation.php
+26
-10
views/tpls/forms/sommom/recommendationnage.php
views/tpls/forms/sommom/recommendationnage.php
+27
-9
views/tpls/forms/sommom/reglementation.php
views/tpls/forms/sommom/reglementation.php
+40
-21
views/tpls/forms/sommom/reglementationesp.php
views/tpls/forms/sommom/reglementationesp.php
+120
-29
views/tpls/forms/sommom/sitededie.php
views/tpls/forms/sommom/sitededie.php
+89
-21
views/tpls/forms/sommom/structureaer.php
views/tpls/forms/sommom/structureaer.php
+93
-21
views/tpls/forms/sommom/structureop.php
views/tpls/forms/sommom/structureop.php
+97
-21
views/tpls/forms/sommom/structuresite.php
views/tpls/forms/sommom/structuresite.php
+107
-21
views/tpls/forms/sommom/surveillanceControle.php
views/tpls/forms/sommom/surveillanceControle.php
+89
-21
views/tpls/forms/sommom/territoire.php
views/tpls/forms/sommom/territoire.php
+42
-20
views/tpls/forms/sommom/wizard.php
views/tpls/forms/sommom/wizard.php
+9
-9
views/tpls/forms/sommom/zone_obs_act.php
views/tpls/forms/sommom/zone_obs_act.php
+139
-22
No files found.
controllers/actions/NewAction.php
View file @
8235754a
...
@@ -43,7 +43,7 @@ class NewAction extends CAction
...
@@ -43,7 +43,7 @@ class NewAction extends CAction
"keys"
=>
array
(
$costum
[
"slug"
]),
"keys"
=>
array
(
$costum
[
"slug"
]),
"insertOrign"
=>
"costum"
)
;
"insertOrign"
=>
"costum"
)
;
}
}
PHDB
::
insert
(
self
::
ANSWER_COLLECTION
,
$answer
);
PHDB
::
insert
(
Form
::
ANSWER_COLLECTION
,
$answer
);
$res
=
array
(
"result"
=>
true
,
$res
=
array
(
"result"
=>
true
,
"answer"
=>
$answer
);
"answer"
=>
$answer
);
}
catch
(
CTKException
$e
){
}
catch
(
CTKException
$e
){
...
...
views/tpls/forms/cplx/multiCheckboxPlus.php
View file @
8235754a
...
@@ -109,7 +109,7 @@ $cle = $key ;
...
@@ -109,7 +109,7 @@ $cle = $key ;
$value
=
(
!
empty
(
$answers
))
?
" value='"
.
$answers
.
"' "
:
""
;
$value
=
(
!
empty
(
$answers
))
?
" value='"
.
$answers
.
"' "
:
""
;
$inpClass
=
" saveOneByOne"
;
$inpClass
=
" saveOneByOne"
;
$editParamsBtn
=
(
$canEditForm
)
?
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='
costum.form.
params."
.
$kunik
.
"' class='previewTpl edit"
.
$kunik
.
"Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>"
:
""
;
$editParamsBtn
=
(
$canEditForm
)
?
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl edit"
.
$kunik
.
"Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>"
:
""
;
...
@@ -239,7 +239,7 @@ if($mode == "r")
...
@@ -239,7 +239,7 @@ if($mode == "r")
{
{
echo
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='
costum.form.
params."
.
$kunik
.
"' class='previewTpl paramsonebtn editone"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-cog'></i> </a>"
;
echo
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl paramsonebtn editone"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-cog'></i> </a>"
;
...
@@ -251,7 +251,7 @@ if($mode == "r")
...
@@ -251,7 +251,7 @@ if($mode == "r")
{
{
if
(
$value
==
"cplx"
)
if
(
$value
==
"cplx"
)
{
{
echo
" <a alt='placeholder' href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='
costum.form.
params."
.
$kunik
.
"' class='previewTpl paramsonebtnP editonep"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-pencil'></i> </a>"
;
echo
" <a alt='placeholder' href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl paramsonebtnP editonep"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-pencil'></i> </a>"
;
}
}
}
}
}
}
...
@@ -382,7 +382,7 @@ if($mode == "r")
...
@@ -382,7 +382,7 @@ if($mode == "r")
{
{
echo
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='
costum.form.
params."
.
$kunik
.
"' class='previewTpl paramsonebtn editone"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-cog'></i> </a>"
;
echo
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl paramsonebtn editone"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-cog'></i> </a>"
;
...
@@ -394,7 +394,7 @@ if($mode == "r")
...
@@ -394,7 +394,7 @@ if($mode == "r")
{
{
if
(
$value
==
"cplx"
)
if
(
$value
==
"cplx"
)
{
{
echo
" <a alt='placeholder' href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='
costum.form.
params."
.
$kunik
.
"' class='previewTpl paramsonebtnP editonep"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-pencil'></i> </a>"
;
echo
" <a alt='placeholder' href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl paramsonebtnP editonep"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-pencil'></i> </a>"
;
}
}
}
}
}
}
...
...
views/tpls/forms/cplx/multitextvalidation.php
View file @
8235754a
...
@@ -169,7 +169,7 @@ $paramsData = [
...
@@ -169,7 +169,7 @@ $paramsData = [
"text"
=>
"texte"
,
"text"
=>
"texte"
,
"number"
=>
"Nombre"
,
"number"
=>
"Nombre"
,
"email"
=>
"adresse mail"
,
"email"
=>
"adresse mail"
,
"unique"
=>
[
"siret"
]
"unique"
=>
"Siret"
]
]
];
];
...
@@ -213,7 +213,7 @@ if($mode == "r"){ ?>
...
@@ -213,7 +213,7 @@ if($mode == "r"){ ?>
if
(
$canEditForm
){
if
(
$canEditForm
){
echo
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='
costum.form.
params."
.
$kunik
.
"' class='previewTpl paramsonebtn edit"
.
$kunik
.
"ParamsMt '><i class='fa fa-cog' style='padding: 4px;'></i> </a>"
;
echo
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl paramsonebtn edit"
.
$kunik
.
"ParamsMt '><i class='fa fa-cog' style='padding: 4px;'></i> </a>"
;
}
}
?>
?>
...
@@ -297,13 +297,32 @@ if($mode == "r"){ ?>
...
@@ -297,13 +297,32 @@ if($mode == "r"){ ?>
$(this).parent().addClass('true-validate');
$(this).parent().addClass('true-validate');
}
}
answer.path =
"
answers
.
"
+$(this).data(
"
form
"
)+
"
.
"
+$(this).data(
"
id
"
);
if($(this).attr('type') == 'unique' ) {
answer.collection =
"
answers
"
;
ajaxPost(null, baseUrl+
"
/
co2
/
search
/
globalautocomplete
"
, {
"
searchType
"
: [
"
organizations
"
],
"
filters
"
: {
"
siret
"
: [$(this).val()] }},
answer.id =
"
<?php
echo
$answer
[
"_id"
];
?>
"
;
function (data){
answer.value = $(this).val();
if (Object.entries(data.results).length === 0){
dataHelper.path2Value(answer , function(params) {
answer.path =
"
answers
.
"
+$(this).data(
"
form
"
)+
"
.
"
+$(this).data(
"
id
"
);
//toastr.success('saved');
answer.collection =
"
answers
"
;
});
answer.id =
"
<?php
echo
$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 =
"
<?php
echo
$answer
[
"_id"
];
?>
"
;
answer.value = $(this).val();
dataHelper.path2Value(answer , function(params) {
//toastr.success('saved');
});
}
}
}
})
})
});
});
...
@@ -339,8 +358,6 @@ if($mode == "r"){ ?>
...
@@ -339,8 +358,6 @@ if($mode == "r"){ ?>
$(thisAlert).removeClass('alert-validate');
$(thisAlert).removeClass('alert-validate');
}
}
</script>
</script>
<?php
}
?>
<?php
}
?>
...
...
views/tpls/forms/sommom/acteurEncadrement.php
View file @
8235754a
<?php
if
(
$answer
){
<?php
if
(
$answer
){
?>
?>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<table
class=
"table table-bordered table-hover directoryTable"
id=
"
<?php
echo
$kunik
?>
"
>
<?php
$editBtnL
=
(
$canAnswer
)
?
" <a href='javascript:;' data-id='"
.
$answer
[
"_id"
]
.
"' data-collection='"
.
Form
::
ANSWER_COLLECTION
.
"' data-path='"
.
$answerPath
.
"' class='add"
.
$kunik
.
" btn btn-default'><i class='fa fa-plus'></i> Ajouter une ligne </a>"
:
""
;
$editParamsBtn
=
(
$canEdit
)
?
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl edit"
.
$kunik
.
"Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>"
:
""
;
<?php
$editBtnL
=
(
$canEdit
and
$mode
!=
"r"
and
$mode
!=
"pdf"
)
?
" <a href='javascript:;' data-id='"
.
$answer
[
"_id"
]
.
"' data-collection='"
.
Form
::
ANSWER_COLLECTION
.
"' data-path='"
.
$answerPath
.
"' class='add"
.
$kunik
.
" btn btn-default'><i class='fa fa-plus'></i> Ajouter une ligne </a>"
:
""
;
$editParamsBtn
=
(
$canEditForm
and
$mode
!=
"r"
||
$mode
!=
"pdf"
)
?
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl edit"
.
$kunik
.
"Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>"
:
""
;
$a
=
[];
$a
=
[];
...
@@ -97,9 +96,12 @@
...
@@ -97,9 +96,12 @@
?>
?>
<?php
if
(
$mode
!=
"pdf"
){
?>
<table
class=
"table table-bordered table-hover directoryTable"
id=
"
<?php
echo
$kunik
?>
"
>
<thead>
<thead>
<tr>
<tr>
<td
colspan=
'
<?php
echo
count
(
$properties
)
+
2
?>
'
><h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
.
$editQuestionBtn
.
$editParamsBtn
.
$editBtnL
?>
</h4>
<td
colspan=
"
<?php
if
(
$mode
!=
"r"
){
echo
count
(
$properties
)
+
2
;
}
else
{
echo
count
(
$properties
)
;}
?>
"
><h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
.
$editQuestionBtn
.
$editParamsBtn
.
$editBtnL
?>
</h4>
<?php
echo
$info
?>
<?php
echo
$info
?>
</td>
</td>
</tr>
</tr>
...
@@ -115,7 +117,9 @@
...
@@ -115,7 +117,9 @@
echo
"<th>"
.
$inp
[
"placeholder"
]
.
"</th>"
;
echo
"<th>"
.
$inp
[
"placeholder"
]
.
"</th>"
;
}
}
}
?>
}
?>
<th></th>
<?php
if
(
$mode
!=
"r"
){
?>
<th></th>
<?php
}
?>
</tr>
</tr>
<tr></tr>
<tr></tr>
<?php
}
?>
<?php
}
?>
...
@@ -152,19 +156,21 @@
...
@@ -152,19 +156,21 @@
}
}
}
}
?>
?>
<td
style=
"white-space: normal;"
>
<?php
if
(
$mode
!=
"r"
){
?>
<?php
<td
style=
"white-space: normal;"
>
$this
->
renderPartial
(
"survey.views.tpls.forms.cplx.editDeleteLineBtn"
,
[
<?php
"canEdit"
=>
(
$canEdit
||
$canAnswer
),
$this
->
renderPartial
(
"survey.views.tpls.forms.cplx.editDeleteLineBtn"
,
[
"id"
=>
$answer
[
"_id"
],
"canEdit"
=>
(
$canEdit
),
"collection"
=>
Form
::
ANSWER_COLLECTION
,
"id"
=>
$answer
[
"_id"
],
"q"
=>
$q
,
"collection"
=>
Form
::
ANSWER_COLLECTION
,
"path"
=>
$answerPath
.
$q
,
"q"
=>
$q
,
"keyTpl"
=>
$kunik
"path"
=>
$answerPath
.
$q
,
]
);
?>
"keyTpl"
=>
$kunik
]
);
?>
<a
href=
"javascript:;"
class=
"btn btn-xs btn-primary openAnswersComment"
onclick=
"commentObj.openPreview('answers','
<?php
echo
$answer
[
"_id"
]
?>
','
<?php
echo
$answer
[
"_id"
]
.
$key
.
$q
?>
', '
<?php
echo
@
$a
[
'step'
]
?>
')"
>
<?php
echo
PHDB
::
count
(
Comment
::
COLLECTION
,
array
(
"contextId"
=>
$answer
[
"_id"
],
"contextType"
=>
"answers"
,
"path"
=>
$answer
[
"_id"
]
.
$key
.
$q
))
?>
<i
class=
'fa fa-commenting'
></i></a>
</td>
<a
href=
"javascript:;"
class=
"btn btn-xs btn-primary openAnswersComment"
onclick=
"commentObj.openPreview('answers','
<?php
echo
$answer
[
"_id"
]
?>
','
<?php
echo
$answer
[
"_id"
]
.
$key
.
$q
?>
', '
<?php
echo
@
$a
[
'step'
]
?>
')"
>
<?php
echo
PHDB
::
count
(
Comment
::
COLLECTION
,
array
(
"contextId"
=>
$answer
[
"_id"
],
"contextType"
=>
"answers"
,
"path"
=>
$answer
[
"_id"
]
.
$key
.
$q
))
?>
<i
class=
'fa fa-commenting'
></i></a>
</td>
<?php
}
?>
<?php
<?php
$ct
++
;
$ct
++
;
echo
"</tr>"
;
echo
"</tr>"
;
...
@@ -174,7 +180,77 @@
...
@@ -174,7 +180,77 @@
?>
?>
</tbody>
</tbody>
</table>
</table>
<?php
}
else
{
?>
<div>
<label>
<h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
.
$editQuestionBtn
.
$editParamsBtn
.
$editBtnL
?>
</h4>
<?php
echo
$info
?>
</label>
</div>
<table
class=
"table table-bordered table-hover directoryTable"
id=
"
<?php
echo
$kunik
?>
"
>
<thead>
<tr>
<?php
if
(
count
(
$answers
)
>
0
){
foreach
(
$properties
as
$i
=>
$inp
)
{
if
(
isset
(
$inp
[
"placeholder"
])){
echo
"<th>"
.
$inp
[
"placeholder"
]
.
"</th>"
;
}
}
?>
<?php
}
?>
</tr>
</thead>
<tbody
class=
"directoryLines"
>
<?php
if
(
isset
(
$answers
)){
foreach
(
$answers
as
$q
=>
$a
)
{
echo
"<tr id='"
.
$kunik
.
$q
.
"' class='"
.
$kunik
.
"Line'>"
;
foreach
(
$properties
as
$i
=>
$inp
)
{
if
(
$i
==
"location"
){
}
else
{
echo
"<td>"
;
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
'<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
[
"port"
]);
}
else
{
echo
$a
[
$i
];
}
}
echo
"</td>"
;
}
}
echo
"</tr>"
;
}
}
?>
</tbody>
</table>
<?php
}
?>
</div>
</div>
<?php
if
(
$mode
!=
"pdf"
){
?>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
<?php
echo
$kunik
?>
Data
=
<?php
echo
json_encode
(
(
isset
(
$answers
))
?
$answers
:
null
);
?>
;
var
<?php
echo
$kunik
?>
Data
=
<?php
echo
json_encode
(
(
isset
(
$answers
))
?
$answers
:
null
);
?>
;
...
@@ -317,6 +393,4 @@
...
@@ -317,6 +393,4 @@
});
});
</script>
</script>
<?php
}
else
{
<?php
}
}
?>
//echo "<h4 class='text-red'>CALENDAR works with existing answers</h4>";
\ No newline at end of file
}
?>
\ No newline at end of file
views/tpls/forms/sommom/airemarineprotege.php
View file @
8235754a
<?php
if
(
$answer
){
<?php
if
(
$answer
){
?>
?>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<table
class=
"table table-bordered table-hover directoryTable"
id=
"
<?php
echo
$kunik
?>
"
>
<?php
<?php
$editBtnL
=
(
$canAnswer
)
?
" <a href='javascript:;' data-id='"
.
$answer
[
"_id"
]
.
"' data-collection='"
.
Form
::
ANSWER_COLLECTION
.
"' data-path='"
.
$answerPath
.
"' class='add"
.
$kunik
.
" btn btn-default'><i class='fa fa-plus'></i> Ajouter une ligne </a> <a href='javascript:;' data-id='"
.
$answer
[
"_id"
]
.
"' data-collection='answers' data-path='answers.sommomForm1.sommomForm122.' class='addorganismesommomForm122 btn btn-default'><i class='fa fa-plus'></i> Ajouter un organisme </a>'"
:
""
;
$editBtnL
=
(
$canEdit
and
$mode
!=
"r"
and
$mode
!=
"pdf"
)
?
" <a href='javascript:;' data-id='"
.
$answer
[
"_id"
]
.
"' data-collection='"
.
Form
::
ANSWER_COLLECTION
.
"' data-path='"
.
$answerPath
.
"' class='add"
.
$kunik
.
" btn btn-default'><i class='fa fa-plus'></i> Ajouter une ligne </a>"
:
""
;
$editParamsBtn
=
(
$canEditForm
and
$mode
!=
"r"
||
$mode
!=
"pdf"
)
?
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl edit"
.
$kunik
.
"Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>"
:
""
;
$editParamsBtn
=
(
$canEdit
)
?
" <a href='javascript:;' data-id='"
.
$parentForm
[
"_id"
]
.
"' data-collection='"
.
Form
::
COLLECTION
.
"' data-path='params."
.
$kunik
.
"' class='previewTpl edit"
.
$kunik
.
"Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>"
:
""
;
$paramsData
=
[
$paramsData
=
[
"statut"
=>
[
"statut"
=>
[
...
@@ -114,10 +113,12 @@
...
@@ -114,10 +113,12 @@
}
}
?>
?>
<?php
if
(
$mode
!=
"pdf"
){
?>
<table
class=
"table table-bordered table-hover directoryTable"
id=
"
<?php
echo
$kunik
?>
"
>
<thead>
<thead>
<tr>
<tr>
<td
colspan=
'
<?php
echo
count
(
$properties
)
+
2
?>
'
><h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
.
$editQuestionBtn
.
$editParamsBtn
.
$editBtnL
?>
</h4>
<td
colspan=
"
<?php
if
(
$mode
!=
"r"
){
echo
count
(
$properties
)
+
2
;
}
else
{
echo
count
(
$properties
)
;}
?>
"
><h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
.
$editQuestionBtn
.
$editParamsBtn
.
$editBtnL
?>
</h4>
<?php
echo
$info
?>
<?php
echo
$info
?>
</td>
</td>
</tr>
</tr>
...
@@ -135,7 +136,9 @@
...
@@ -135,7 +136,9 @@
}
}
}
}
}
?>
}
?>
<th></th>
<?php
if
(
$mode
!=
"r"
){
?>
<th></th>
<?php
}
?>
</tr>
</tr>
<tr></tr>
<tr></tr>
<?php
}
?>
<?php
}
?>
...
@@ -175,19 +178,21 @@
...
@@ -175,19 +178,21 @@
}
}
?>
?>
<td
style=
"white-space: normal;"
>
<?php
if
(
$mode
!=
"r"
){
?>
<?php
<td
style=
"white-space: normal;"
>
$this
->
renderPartial
(
"survey.views.tpls.forms.cplx.editDeleteLineBtn"
,
[
<?php
"canEdit"
=>
(
$canEdit
||
$canAnswer
),
$this
->
renderPartial
(
"survey.views.tpls.forms.cplx.editDeleteLineBtn"
,
[
"id"
=>
$answer
[
"_id"
],
"canEdit"
=>
(
$canEdit
),
"collection"
=>
Form
::
ANSWER_COLLECTION
,
"id"
=>
$answer
[
"_id"
],
"q"
=>
$q
,
"collection"
=>
Form
::
ANSWER_COLLECTION
,
"path"
=>
$answerPath
.
$q
,
"q"
=>
$q
,
"keyTpl"
=>
$kunik
"path"
=>
$answerPath
.
$q
,
]
);
?>
"keyTpl"
=>
$kunik
]
);
?>
<a
href=
"javascript:;"
class=
"btn btn-xs btn-primary openAnswersComment"
onclick=
"commentObj.openPreview('answers','
<?php
echo
$answer
[
"_id"
]
?>
','
<?php
echo
$answer
[
"_id"
]
.
$key
.
$q
?>
', '
<?php
echo
@
$a
[
'step'
]
?>
')"
>
<?php
echo
PHDB
::
count
(
Comment
::
COLLECTION
,
array
(
"contextId"
=>
$answer
[
"_id"
],
"contextType"
=>
"answers"
,
"path"
=>
$answer
[
"_id"
]
.
$key
.
$q
))
?>
<i
class=
'fa fa-commenting'
></i></a>
</td>
<a
href=
"javascript:;"
class=
"btn btn-xs btn-primary openAnswersComment"
onclick=
"commentObj.openPreview('answers','
<?php
echo
$answer
[
"_id"
]
?>
','
<?php
echo
$answer
[
"_id"
]
.
$key
.
$q
?>
', '
<?php
echo
@
$a
[
'step'
]
?>
')"
>
<?php
echo
PHDB
::
count
(
Comment
::
COLLECTION
,
array
(
"contextId"
=>
$answer
[
"_id"
],
"contextType"
=>
"answers"
,
"path"
=>
$answer
[
"_id"
]
.
$key
.
$q
))
?>
<i
class=
'fa fa-commenting'
></i></a>
</td>
<?php
}
?>
<?php
<?php
$ct
++
;
$ct
++
;
echo
"</tr>"
;
echo
"</tr>"
;
...
@@ -197,7 +202,87 @@
...
@@ -197,7 +202,87 @@
?>
?>
</tbody>
</tbody>
</table>
</table>
<?php
}
else
{
?>
<div>
<label>
<h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
.
$editQuestionBtn
.
$editParamsBtn
.
$editBtnL
?>
</h4>
<?php
echo
$info
?>
</label>
</div>
<table
class=
"table table-bordered table-hover directoryTable"
id=
"
<?php
echo
$kunik
?>
"
>
<thead>
<?php
if
(
count
(
$answers
)
>
0
){
?>
<tr>
<?php
foreach
(
$properties
as
$i
=>
$inp
)
{
if
(
isset
(
$inp
[
"label"
])){
if
(
isset
(
$inp
[
"label"
])){
echo
"<th>"
.
$inp
[
"label"
]
.
"</th>"
;
}
}
}
?>
</tr>
<?php
}
?>
</thead>
<tbody
class=
"directoryLines"
>
<?php
$ct
=
0
;
if
(
isset
(
$answers
)){
foreach
(
$answers
as
$q
=>
$a
)
{
echo
"<tr id='"
.
$kunik
.
$q
.
"' class='"
.
$kunik
.
"Line'>"
;
foreach
(
$properties
as
$i
=>
$inp
)
{
if
(
$i
==
"location"
){
}
else
{
echo
"<td>"
;
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
'<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
];
}
}
echo
"</td>"
;
}
}
echo
"</tr>"
;
}
}
?>
</tbody>
</table>
<?php
}
?>
</div>
</div>
<?php
if
(
$mode
!=
"pdf"
){
?>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
<?php
echo
$kunik
?>
Data
=
<?php
echo
json_encode
(
(
isset
(
$answers
))
?
$answers
:
null
);
?>
;
var
<?php
echo
$kunik
?>
Data
=
<?php
echo
json_encode
(
(
isset
(
$answers
))
?
$answers
:
null
);
?>
;
...
@@ -333,6 +418,4 @@
...
@@ -333,6 +418,4 @@
});
});
</script>
</script>
<?php
}
else
{
<?php
}
}
?>
//echo "<h4 class='text-red'>CALENDAR works with existing answers</h4>";
\ No newline at end of file
}
?>
\ No newline at end of file
views/tpls/forms/sommom/az.json
0 → 100644
View file @
8235754a
{
"_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"
,