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
64c4cb37
Commit
64c4cb37
authored
Jun 17, 2020
by
Anatole Rakotoson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coform community
parent
642ab9c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
38 deletions
+46
-38
controllers/answer/mail/SendAction.php
controllers/answer/mail/SendAction.php
+17
-23
models/Answer.php
models/Answer.php
+4
-3
views/tpls/forms/costum/community/emailist.php
views/tpls/forms/costum/community/emailist.php
+12
-7
views/tpls/forms/cplx/select2.php
views/tpls/forms/cplx/select2.php
+13
-5
No files found.
controllers/answer/mail/SendAction.php
View file @
64c4cb37
...
...
@@ -4,30 +4,24 @@ class SendAction extends CAction {
public
function
run
(
$msg
=
""
,
$to
=
""
)
{
$controller
=
$this
->
getController
();
// $msg=null;
// $infos=array();
// if(isset($_POST["tpl"]))
// $tpl=$_POST["tpl"];
// if(isset($_POST["step"]))
// $step=$_POST["step"];
// // ALL infos
// if(isset($_POST["tplObject"]))
// $infos["tplObject"]=$_POST["tplObject"];
// if(isset($_POST["html"]))
// $infos["html"]=$_POST["html"];
// if(isset($_POST["msg"]))
// $infos["msg"]=$_POST["msg"];
// if(isset($_POST["tplMail"]))
// $infos["emails"]=$_POST["tplMail"];
// if(isset($_POST["listContact"]))
// $infos["community"]=$_POST["listContact"];
if
(
isset
(
$_POST
[
"to"
]))
$to
=
$_POST
[
"to"
];
$msg
=
null
;
$infos
=
array
();
if
(
isset
(
$_POST
[
"tpl"
]))
$msg
=
$_POST
[
"msg"
];
$tpl
=
$_POST
[
"tpl"
];
if
(
isset
(
$_POST
[
"step"
]))
$step
=
$_POST
[
"step"
];
// ALL infos
if
(
isset
(
$_POST
[
"tplObject"
]))
$infos
[
"tplObject"
]
=
$_POST
[
"tplObject"
];
if
(
isset
(
$_POST
[
"html"
]))
$infos
[
"html"
]
=
$_POST
[
"html"
];
if
(
isset
(
$_POST
[
"msg"
]))
$infos
[
"msg"
]
=
$_POST
[
"msg"
];
if
(
isset
(
$_POST
[
"tplMail"
]))
$infos
[
"emails"
]
=
$_POST
[
"tplMail"
];
if
(
isset
(
$_POST
[
"listContact"
]))
$infos
[
"community"
]
=
$_POST
[
"listContact"
]
S
$mailParams
=
Answer
::
mailProcessOne
(
$to
,
$msg
);
Rest
::
json
(
array
(
"result"
=>
true
,
"msg"
=>
"Ok : webhook handdled"
));
}
...
...
models/Answer.php
View file @
64c4cb37
...
...
@@ -367,21 +367,22 @@ class Answer{
public
static
function
mailProcessOne
(
$to
,
$msg
){
$params
=
array
(
"type"
=>
Cron
::
TYPE_MAIL
,
"tpl"
=>
s
$msg
,
"tpl"
=>
"basic"
,
"subject"
=>
"invitation"
,
"from"
=>
Yii
::
app
()
->
params
[
'adminEmail'
],
"to"
=>
$to
,
"tplParams"
=>
array
(
"user"
=>
"user"
,
"title"
=>
Mail
::
getAppName
()
,
"title"
=>
"title"
,
"answer"
=>
"answer"
,
"form"
=>
Yii
::
app
()
->
params
[
'adminEmail'
],
"msg"
=>
$msg
));
"msg"
=>
"helloword"
));
if
(
isset
(
$infos
[
"msg"
]))
$params
[
"tplParams"
][
"msg"
]
=
$infos
[
"msg"
];
if
(
isset
(
$infos
[
"html"
]))
$params
[
"tplParams"
][
"html"
]
=
$infos
[
"html"
];
$params
=
Mail
::
getCustomMail
(
$params
);
//Rest::json($params);exit();
Mail
::
schedule
(
$params
);
}
...
...
views/tpls/forms/costum/community/emailist.php
View file @
64c4cb37
...
...
@@ -102,16 +102,16 @@
ajaxPost
(
null
,
baseUrl
+
"
/survey/answer/sendmail/id/
<?php
echo
(
string
)
$answer
[
'_id'
]
?>
"
,
{
to
:
$
(
"
#liste_row
"
).
val
(),
m
ailtype
:
sectionDyf
.
<?php
echo
$kunik
?>
ParamsData
.
mail_type
},
{
to
:
$
(
"
#liste_row
"
).
val
(),
m
sg
:
sectionDyf
.
<?php
echo
$kunik
?>
ParamsData
.
mail_type
},
function
(
data
){
toastr
.
success
(
"
Un mail a été envoyé à toutes les parties prenantes afin de les notifier
"
);
//urlCtrl.loadByHash(location.hash);
//urlCtrl.loadByHash(location.hash);
dataHelper
.
path2Value
(
tplCtx
,
function
(
params
)
{
$
(
"
#ajax-modal
"
).
html
(
"
<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>
"
);
//$("#ajax-modal").modal('hide');
//location.reload();
}
);
}
);
dataHelper
.
path2Value
(
tplCtx
,
function
(
params
)
{
$
(
"
#ajax-modal
"
).
html
(
"
<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>
"
);
//$("#ajax-modal").modal('hide');
location
.
reload
();
}
);
}
}
}
...
...
@@ -123,8 +123,13 @@
"
description
"
:
"
Mail type
"
,
"
icon
"
:
"
fa-cog
"
,
"
properties
"
:
{
mail_type
:
{
subject
:
{
inputType
:
"
text
"
,
label
:
"
Sujet
"
,
values
:
sectionDyf
.
<?php
echo
$kunik
?>
ParamsData
.
mail_type
}
mail_type
:
{
inputType
:
"
textarea
"
,
label
:
"
Mail type
"
,
values
:
sectionDyf
.
<?php
echo
$kunik
?>
ParamsData
.
mail_type
}
...
...
views/tpls/forms/cplx/select2.php
View file @
64c4cb37
...
...
@@ -15,11 +15,13 @@ if($mode == "r"){ ?>
<?php
}
else
{
?>
<link
href=
"https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css"
rel=
"stylesheet"
/>
<div
class=
"form-group"
>
<label
for=
"
<?php
echo
$key
?>
"
><h4
style=
"color:
<?php
echo
(
$titleColor
)
?
$titleColor
:
"black"
;
?>
"
>
<?php
echo
$label
.
$editQuestionBtn
?>
</h4></label>
<br/>
<select
class=
"form-control js-example-tags"
>
<select
id=
"tags
<?php
echo
$kunik
?>
"
multiple
>
<option
selected=
"selected"
>
orange
</option>
<option>
white
</option>
<option>
purple
</option>
...
...
@@ -29,11 +31,17 @@ if($mode == "r"){ ?>
<?php
}
?>
</div>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"
></script>
<script
type=
"text/javascript"
>
jQuery
(
document
).
ready
(
function
()
{
$
(
"
.js-example-tags
"
).
select2
({
});
});
let
optionSelect2
<?php
echo
$kunik
?>
=
{
templateResult
:
formatResult
,
closeOnSelect
:
false
,
width
:
'
90%
'
,
placeholder
:
'
Saisir un territoire
'
};
let
$select2
<?php
echo
$kunik
?>
=
$
(
"
#tags
<?php
echo
$kunik
?>
"
).
select2
(
optionSelect2
<?php
echo
$kunik
?>
);
</script>
<?php
}
?>
\ No newline at end of file
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