Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Pixel Humain
survey
Commits
97bb4ace
Commit
97bb4ace
authored
Mar 18, 2020
by
Raph El
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modif et correction survey
parent
d22d38a9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
147 deletions
+2
-147
controllers/answer/IndexAction.php
controllers/answer/IndexAction.php
+0
-1
views/tpls/forms/cplx/budget.php
views/tpls/forms/cplx/budget.php
+1
-1
views/tpls/forms/cplx/budgetTable.php
views/tpls/forms/cplx/budgetTable.php
+0
-0
views/tpls/forms/cplx/tableViewSave.php
views/tpls/forms/cplx/tableViewSave.php
+0
-140
views/tpls/views/index.php
views/tpls/views/index.php
+1
-5
No files found.
controllers/answer/IndexAction.php
View file @
97bb4ace
...
...
@@ -7,7 +7,6 @@ class IndexAction extends CAction
$params
=
array
();
if
(
!
empty
(
$id
)){
if
(
$id
==
"new"
){
if
(
!
empty
(
Yii
::
app
()
->
session
[
"userId"
])){
$answer
=
Answer
::
generateAnswer
();
$params
[
"answerId"
]
=
$answer
[
"_id"
];
...
...
views/tpls/forms/cplx/budget.php
View file @
97bb4ace
...
...
@@ -72,7 +72,7 @@ $properties = [
?>
<?php
echo
$this
->
renderPartial
(
"survey.views.tpls.forms.cplx.
tableView
"
,
echo
$this
->
renderPartial
(
"survey.views.tpls.forms.cplx.
budgetTable
"
,
[
"form"
=>
$form
,
"wizard"
=>
true
,
...
...
views/tpls/forms/cplx/
tableView
.php
→
views/tpls/forms/cplx/
budgetTable
.php
View file @
97bb4ace
File moved
views/tpls/forms/cplx/tableViewSave.php
deleted
100644 → 0
View file @
d22d38a9
<?php
$totalMap
=
[];
foreach
(
$properties
as
$i
=>
$inp
)
{
if
(
isset
(
$inp
[
"propType"
])
&&
$inp
[
"propType"
]
==
"amount"
)
$totalMap
[
$i
]
=
0
;
}
?>
<div
class=
"form-group"
>
<table
class=
"table table-bordered table-hover directoryTable"
id=
"
<?php
echo
$kunik
?>
"
style=
"border: 1px solid black;"
>
<thead>
<tr>
<?php
if
(
$mode
==
"r"
){
?>
<td
colspan=
'
<?php
echo
count
(
$properties
)
+
2
?>
'
>
<h4
style=
"color:
<?php
echo
(
!
empty
(
$titleColor
)
?
$titleColor
:
"black"
);
?>
"
>
<?php
echo
$label
;
?>
</h4>
<?php
echo
$info
?>
</td>
<?php
}
else
{
?>
<td
colspan=
'
<?php
echo
count
(
$properties
)
+
2
?>
'
>
<h4
style=
"color:
<?php
echo
(
!
empty
(
$titleColor
)
?
$titleColor
:
"black"
);
?>
"
>
<?php
echo
$label
.
$editQuestionBtn
.
$editParamsBtn
.
$editBtnL
;
?>
</h4>
<?php
echo
$info
;
?>
</td>
<?php
}
?>
</tr>
<?php
if
(
count
(
$answers
)
>
0
){
?>
<tr>
<?php
foreach
(
$properties
as
$i
=>
$inp
)
{
echo
"<th>"
.
$inp
[
"placeholder"
]
.
"</th>"
;
}
?>
<th></th>
</tr>
<?php
}
?>
</thead>
<tbody
class=
"directoryLines"
>
<?php
$ct
=
0
;
if
(
isset
(
$answers
)){
foreach
(
$answers
as
$q
=>
$a
)
{
foreach
(
$totalMap
as
$i
=>
$tot
)
{
if
(
isset
(
$a
[
$i
]))
$totalMap
[
$i
]
=
$tot
+
$a
[
$i
];
}
$tds
=
""
;
foreach
(
$properties
as
$i
=>
$inp
)
{
$tds
.
=
"<td>"
;
if
(
$i
==
"price"
)
{
if
(
!
empty
(
$a
[
"price"
]))
$tds
.
=
"<span id='price"
.
$q
.
"'>"
.
$a
[
"price"
]
.
"€</span>"
;
if
(
$paramsData
[
"estimate"
]
)
{
// $tds .= "<a href='javascript:;' data-id='".$answer["_id"]."' data-key='".$key."' data-form='".$form["id"]."' data-pos='".$q."' class='btn btn-xs btn-primary btnEstimate margin-left-5 padding-10'><i class='fa fa-plus'></i></a>";
// if( isset($a["estimates"] ))
// {
// foreach ( $a["estimates"] as $uid => $esti )
// {
// $selected = ( isset($esti["selected"]) ) ? "success" : "default";
// $tds .= "<br/><a href='javascript:;' data-id='".$answer["_id"]."' data-uid='".$uid."' data-price='".$esti["price"]."' data-key='".$key."' data-form='".$form["id"]."' data-pos='".$q."' class='btn btn-xs btn-".$selected." btnEstimateSelected margin-left-5 padding-10'>".$esti["price"]."€ | ".$esti["days"]."j | ".$esti["name"]."</a>";
// }
// }
}
}
else
if
(
isset
(
$a
[
$i
]))
$tds
.
=
$a
[
$i
];
$tds
.
=
"</td>"
;
}
echo
"<tr id='"
.
$kunik
.
$q
.
"' class='"
.
$kunik
.
"Line'>"
;
echo
$tds
;
if
(
$mode
!=
"r"
){
?>
<td>
<?php
$this
->
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"
=>
"answers."
.
$kunik
.
"."
.
$q
,
"kunik"
=>
$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>
<?php
}
$ct
++
;
// echo "</tr>";
}
}
// if(isset($answers)){
// foreach ( $answers as $q => $a ) {
// foreach ($totalMap as $i => $tot) {
// if(isset($a[$i]))
// $totalMap[$i] = $tot + $a[$i];
// }
// }
// }
$total
=
0
;
foreach
(
$totalMap
as
$i
=>
$tot
)
{
if
(
$tot
!=
0
)
$total
=
$total
+
$tot
;
}
if
(
$total
>
0
){
echo
"<tr class='bold'>"
;
echo
"<td colspan="
.
(
count
(
$paramsData
[
"amounts"
]
)
+
2
)
.
" style='text-align:right'> TOTAL : </td>"
;
if
(
$mode
!=
"r"
)
echo
"<td >"
.
trim
(
strrev
(
chunk_split
(
strrev
(
$total
),
3
,
' '
)))
.
" €</td>"
;
else
echo
"<td colspan='2'>"
.
trim
(
strrev
(
chunk_split
(
strrev
(
$total
),
3
,
' '
)))
.
" €</td>"
;
echo
"</tr>"
;
Yii
::
app
()
->
session
[
"totalBudget"
]
=
$total
;
}
?>
</tbody>
</table>
</div>
\ No newline at end of file
views/tpls/views/index.php
View file @
97bb4ace
...
...
@@ -101,11 +101,7 @@ if(isset($this->costum["contextType"]) && isset($this->costum["contextId"])){
</style>
<script
type=
"text/javascript"
>
//contains all dynform definitions for complexe inputs
//it also carries sub dynforms, when an input needs extra parameters to
var
sectionDyf
=
{};
//var tplCtx = {};
var
sectionDyf
=
{};
</script>
<?php
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment