Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Pixel Humain
survey
Commits
30fad596
Commit
30fad596
authored
May 25, 2020
by
Anatole Rakotoson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sommom
parent
81d520b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
220 additions
and
14 deletions
+220
-14
views/tpls/forms/cplx/multiCheckboxPlus.php
views/tpls/forms/cplx/multiCheckboxPlus.php
+126
-6
views/tpls/forms/cplx/multiRadio.php
views/tpls/forms/cplx/multiRadio.php
+93
-7
views/tpls/forms/cplx/multitextvalidation.php
views/tpls/forms/cplx/multitextvalidation.php
+1
-1
No files found.
views/tpls/forms/cplx/multiCheckboxPlus.php
View file @
30fad596
...
...
@@ -93,6 +93,13 @@
outline
:
none
!important
;
}
.responsemulticheckboxplus
:before
{
content
:
'\f0a9'
;
margin-right
:
15px
;
font-family
:
FontAwesome
;
color
:
#d9534f
;
}
</style>
...
...
@@ -156,13 +163,126 @@ if( isset($answer["answers"][$form["id"]][$kunik]) ) {
$paramsData
[
"checked"
]
=
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
];
}
if
(
$mode
==
"r"
)
{
?>
<div
class=
"col-xs-12"
id=
"
<?php
echo
$kunik
?>
"
>
<label
for=
"
<?php
echo
$kunik
?>
"
><h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
?>
</h4></label>
<?php
echo
$answers
;
?>
</div>
<div
class=
""
style=
"padding-top: 50px; text-transform: unset;"
>
<label
class=
"form-check-label"
for=
"
<?php
echo
$key
?>
"
>
<h4
style=
"text-transform: unset; color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
;"
>
<?php
echo
$label
?>
</h4>
</label>
<?php
if
(
!
isset
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
"global"
][
'list'
])
)
{
echo
"<br/><span class='text-red text-center'><i class='fa fa-warning fa-2x'></i> THIS FIELD HAS TO BE CONFIGURED FIRST </span>"
;
}
else
{
?>
<div
class=
""
>
<table
style=
"width: 100%"
>
<tr
class=
""
><th
>
<div
class=
"col-md-12"
>
<?php
foreach
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
"global"
][
"list"
]
as
$ix
=>
$lbl
)
{
$ckd
=
""
;
$place
=
""
;
foreach
(
$paramsData
[
"checked"
]
as
$key
=>
$value
)
{
foreach
(
$value
as
$ke
=>
$va
)
{
if
(
$ke
==
$lbl
){
$ckd
=
"checked"
;
}
}
}
?>
<!-- <tr class="thckd"><theih > -->
<div
class=
"col-md-
<?php
echo
(
isset
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]))
?
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]
:
'12'
;
?>
col-xs-12 col-sm-12"
style=
"min-height: 70px;"
>
<div
class=
""
>
<label
for=
"
<?php
echo
$kunik
.
$ix
?>
"
class=
"responsemulticheckboxplus"
>
<span>
</span>
<span>
<?php
echo
$lbl
?>
<?php
if
(
count
(
$paramsData
[
"tofill"
])
!=
0
)
{
foreach
(
$paramsData
[
"tofill"
]
as
$key
=>
$value
)
{
if
(
$lbl
==
$key
&&
$value
==
"cplx"
)
{
?>
<?php
if
(
isset
(
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
0
][
$key
][
"textsup"
])
&&
isset
(
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
0
][
$key
][
"value"
])
&&
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
0
][
$key
][
"value"
]
==
$key
)
{
echo
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
0
][
$key
][
"textsup"
]
;
}
?>
<?php
}
}
}
?>
<?php
if
(
$canEdit
)
{
echo
" <a href='javascript:;' data-id='"
.
$el
[
"_id"
]
.
"' data-collection='"
.
Yii
::
app
()
->
session
[
"costum"
][
"contextType"
]
.
"' data-path='costum.form.params."
.
$kunik
.
"' class='previewTpl paramsonebtn editone"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-cog'></i> </a>"
;
if
(
count
(
$paramsData
[
"tofill"
])
!=
0
)
{
foreach
(
$paramsData
[
"tofill"
]
as
$key
=>
$value
)
{
if
(
$lbl
==
$key
)
{
if
(
$value
==
"cplx"
)
{
echo
" <a alt='placeholder' href='javascript:;' data-id='"
.
$el
[
"_id"
]
.
"' data-collection='"
.
Yii
::
app
()
->
session
[
"costum"
][
"contextType"
]
.
"' data-path='costum.form.params."
.
$kunik
.
"' class='previewTpl paramsonebtnP editonep"
.
$kunik
.
"Params"
.
$ix
.
" '><i class='fa fa-pencil'></i> </a>"
;
}
}
}
}
}
?>
</span>
</label>
</div>
</div>
<?php
}
?>
</div>
</th></tr>
</table>
</div>
<?php
}
?>
<?php
if
(
!
empty
(
$info
))
{
?>
<small
id=
"
<?php
echo
$key
?>
Help"
class=
"form-text text-muted"
>
<?php
echo
$info
?>
</small>
<?php
}
?>
</div>
<?php
}
else
...
...
@@ -204,7 +324,7 @@ if($mode == "r")
?>
<!-- <tr class="thckd"><theih > -->
<div
class=
"col-md-
<?php
echo
(
isset
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]))
?
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]
:
'12'
;
?>
col-xs-12 col-sm-12"
style=
"min-height:
5
0px;"
>
<div
class=
"col-md-
<?php
echo
(
isset
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]))
?
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]
:
'12'
;
?>
col-xs-12 col-sm-12"
style=
"min-height:
7
0px;"
>
<div
class=
"thckd"
>
<input
data-id=
"
<?php
echo
$kunik
?>
"
class=
" ckbCo "
id=
"
<?php
echo
$kunik
.
$ix
?>
"
data-form=
'
<?php
echo
$form
[
"id"
]
?>
'
<?php
echo
$ckd
?>
type=
"checkbox"
name=
"
<?php
echo
$kunik
?>
"
data-type=
"
<?php
...
...
@@ -322,7 +442,7 @@ jQuery(document).ready(function() {
answer
=
{};
$
(
'
.ckbCo
'
).
change
(
function
(){
var
allckd
=
[];
alert
(
'
<?php
echo
$kunik
?>
'
);
//
alert('
<?php
echo
$kunik
?>
'
);
$("input:checkbox[name=
'"
+$(this).attr(
"
name
"
)+
"'
]:checked").each(function(){
mylog.log("ckd", $(this).val());
var key = $(this).val();
...
...
views/tpls/forms/cplx/multiRadio.php
View file @
30fad596
...
...
@@ -81,6 +81,13 @@
outline
:
none
!important
;
}
.responsemultiradio
:before
{
content
:
'\f0a9'
;
margin-right
:
15px
;
font-family
:
FontAwesome
;
color
:
#d9534f
;
}
</style>
...
...
@@ -142,10 +149,89 @@ if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]) ) {
if
(
$mode
==
"r"
)
{
?>
<div
class=
"col-xs-12"
id=
"
<?php
echo
$kunik
?>
"
>
<label
for=
"
<?php
echo
$kunik
?>
"
><h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
?>
</h4></label>
<?php
echo
$answers
;
?>
</div>
<div
class=
""
style=
"padding-top: 50px; "
>
<label
class=
"form-check-label"
for=
"
<?php
echo
$key
?>
"
>
<h4
style=
"text-transform: unset; color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
;"
>
<?php
echo
$label
?>
</h4>
</label>
<?php
if
(
!
isset
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
"global"
][
"list"
])
)
{
echo
"<br/><span class='text-red text-center'><i class='fa fa-warning fa-2x'></i> THIS FIELD HAS TO BE CONFIGURED FIRST </span>"
;
}
else
{
?>
<div
class=
""
>
<table
style=
"width: 100%"
>
<tr
class=
""
><th
>
<div
class=
"col-md-12"
>
<?php
foreach
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
"global"
][
"list"
]
as
$ix
=>
$lbl
)
{
if
(
isset
(
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
"value"
])
&&
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
"value"
]
==
$lbl
)
{
?>
<!-- <tr class="thradio"><theih > -->
<div
class=
"col-md-
<?php
echo
(
isset
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]))
?
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]
:
'12'
;
?>
col-xs-12 col-sm-12"
style=
"min-height: 70px;"
>
<div
class=
""
>
<label
for=
"
<?php
echo
$kunik
.
$ix
?>
"
class=
"responsemultiradio"
>
<span>
</span>
<span>
<?php
echo
$lbl
?>
<?php
if
(
count
(
$paramsData
[
"tofill"
])
!=
0
)
{
foreach
(
$paramsData
[
"tofill"
]
as
$key
=>
$value
)
{
if
(
$lbl
==
$key
&&
$value
==
"cplx"
)
{
?>
<?php
if
(
isset
(
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
"textsup"
])
&&
isset
(
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
"value"
])
&&
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
"value"
]
==
$key
){
echo
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
][
"textsup"
]
;
}
?>
<?php
}
}
}
?>
</span>
</label>
</div>
</div>
<?php
}
}
?>
</div>
</th></tr>
</table>
</div>
<?php
}
?>
<?php
if
(
!
empty
(
$info
))
{
?>
<small
id=
"
<?php
echo
$key
?>
Help"
class=
"form-text text-muted"
>
<?php
echo
$info
?>
</small>
<?php
}
?>
</div>
<?php
}
else
...
...
@@ -183,7 +269,7 @@ if($mode == "r")
?>
<!-- <tr class="thradio"><theih > -->
<div
class=
"col-md-
<?php
echo
(
isset
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]))
?
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]
:
'12'
;
?>
col-xs-12 col-sm-12"
style=
"min-height:
5
0px;"
>
<div
class=
"col-md-
<?php
echo
(
isset
(
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]))
?
Yii
::
app
()
->
session
[
"costum"
][
"form"
][
"params"
][
$kunik
][
'global'
][
'width'
]
:
'12'
;
?>
col-xs-12 col-sm-12"
style=
"min-height:
7
0px;"
>
<div
class=
"thradio"
>
<input
data-id=
"
<?php
echo
$kunik
?>
"
class=
" radioCo "
id=
"
<?php
echo
$kunik
.
$ix
?>
"
data-form=
'
<?php
echo
$form
[
"id"
]
?>
'
<?php
echo
$ckd
?>
type=
"radio"
name=
"
<?php
echo
$kunik
?>
"
data-type=
"
<?php
...
...
@@ -305,7 +391,7 @@ jQuery(document).ready(function() {
answer
.
id
=
"
<?php
echo
$answer
[
"_id"
];
?>
"
;
answer
.
value
=
{
"
value
"
:
$
(
this
).
val
(),
"
type
"
:
"
simple
"
};
dataHelper
.
path2Value
(
answer
,
function
(
params
)
{
toastr
.
success
(
'
saved
'
);
//
toastr.success('saved');
}
);
}
else
if
(
$
(
this
).
data
(
"
type
"
)
==
"
cplx
"
){
answer
.
path
=
"
answers.
"
+
$
(
this
).
data
(
"
form
"
)
+
"
.
"
+
$
(
this
).
data
(
"
id
"
);
...
...
@@ -313,7 +399,7 @@ jQuery(document).ready(function() {
answer
.
id
=
"
<?php
echo
$answer
[
"_id"
];
?>
"
;
answer
.
value
=
{
"
value
"
:
$
(
this
).
val
(),
"
type
"
:
"
cplx
"
,
"
textsup
"
:
$
(
'
input[data-imp="
'
+
$
(
this
).
val
()
+
'
"]
'
).
val
()};
dataHelper
.
path2Value
(
answer
,
function
(
params
)
{
toastr
.
success
(
'
saved
'
);
//
toastr.success('saved');
}
);
}
});
...
...
views/tpls/forms/cplx/multitextvalidation.php
View file @
30fad596
...
...
@@ -172,7 +172,7 @@ if($saveOneByOne)
if
(
$mode
==
"r"
){
?>
<div
class=
"col-xs-12"
id=
"
<?php
echo
$kunik
?>
"
>
<label
for=
"
<?php
echo
$kunik
?>
"
><h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
?>
</h4></label>
<?php
echo
$answers
;
?>
<?php
echo
((
!
empty
(
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
]))
?
$answer
[
"answers"
][
$form
[
"id"
]][
$kunik
]
:
""
)
;
?>
</div>
<?php
}
else
{
...
...
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