Commit 8d9cbd0e authored by Raph El's avatar Raph El
Browse files

Hotfix

parent dcc6337a
......@@ -535,6 +535,8 @@ class CommunecterController extends Controller
"droppedmail" => array("href" => "/co2/mailmanagement/droppedmail"),
"updatetopending" => array("href" => "/co2/mailmanagement/updatetopending"),
"createandsend" => array("href" => "/co2/mailmanagement/createandsend"),
"removedata" => array("href" => "/co2/mailmanagement/removedata"),
"askdata" => array("href" => "/co2/mailmanagement/askdata"),
),
"element"=> array(
"updatesettings" => array('href' => "/ph/co2/element/updatesettings"),
......@@ -569,6 +571,9 @@ class CommunecterController extends Controller
'getnetworks' => array("href" => "/ph/co2/element/getnetworks"),
"invoice" => array("href" => "/ph/co2/element/invoice"),
"invite" => array("href" => "/ph/co2/element/invite"),
"removedata" => array("href" => "/co2/element/removedata"),
"deletedata" => array("href" => "/co2/element/deletedata"),
"remove" => array("href" => "/co2/element/remove"),
),
"app" => array(
"welcome" => array('href' => "/ph/co2/app/welcome", "public" => true),
......
......@@ -191,4 +191,12 @@ class DefaultController extends CommunecterController {
$this->render("sitemap",array("list"=>$list));
}
public function actionRemoveData($type=null){
$this->layout = "//layouts/empty";
$list = PHDB::find( "slugs" , array(), array("name", "slug") );
$this->render("sitemap",array("list"=>$list));
}
}
\ No newline at end of file
......@@ -45,6 +45,10 @@ class ElementController extends CommunecterController {
'invoice' => 'citizenToolKit.controllers.element.InvoiceAction',
'invite' => 'citizenToolKit.controllers.element.InviteAction',
'list' => 'citizenToolKit.controllers.element.ListAction',
'removedata' => 'citizenToolKit.controllers.element.RemoveDataAction',
'remove' => 'citizenToolKit.controllers.element.RemoveAction',
'deletedata' => 'citizenToolKit.controllers.element.DeleteDataAction'
);
}
}
\ No newline at end of file
......@@ -20,12 +20,16 @@ class MailmanagementController extends CommunecterController {
return parent::beforeAction($action);
}
public function actions()
{
return array(
'updatetopending' => 'citizenToolKit.controllers.mailmanagement.UpdateToPendingAction',
'droppedmail' => 'citizenToolKit.controllers.mailmanagement.DroppedMailAction',
'createandsend' => 'citizenToolKit.controllers.mailmanagement.CreateAndSendAction'
'createandsend' => 'citizenToolKit.controllers.mailmanagement.CreateAndSendAction',
'removedata' => 'citizenToolKit.controllers.mailmanagement.RemoveDataAction',
'askdata' => 'citizenToolKit.controllers.mailmanagement.AskDataAction'
);
}
}
\ No newline at end of file
......@@ -575,18 +575,18 @@ HtmlHelper::registerCssAndScriptsFiles($cssJs, Yii::app()->getRequest()->getBase
success: function(data){
//if(parentType == "actions"){
//toastr.info(trad["processing"]);
// var idProposal = $(this).data("id-action");
// uiCoop.getCoopData(parentType, parentId, "action", null, idProposal,
// function(){
// uiCoop.minimizeMenuRoom(true);
// uiCoop.showAmendement(false);
// toastr.success(trad["processing ok"]);
// }, false);
// $(".close-modal").trigger("click");
// $(".load-data-community").trigger("click");
//} else {
if(parentType == "actions"){
toastr.info(trad["processing"]);
var idProposal = $(this).data("id-action");
uiCoop.getCoopData(parentType, parentId, "action", null, idProposal,
function(){
uiCoop.minimizeMenuRoom(true);
uiCoop.showAmendement(false);
toastr.success(trad["processing ok"]);
}, false);
$(".close-modal").trigger("click");
$(".load-data-community").trigger("click");
} else {
mylog.log("link/multiconnect success", data);
var nbInvites = data.length;
var str = "";
......@@ -610,6 +610,10 @@ HtmlHelper::registerCssAndScriptsFiles($cssJs, Yii::app()->getRequest()->getBase
"</div>"+
'</a>'+
"</li>";
}else{
str += "<li class='li-dropdown-invite-results col-xs-12 text-red'>"+
value.msg
"</li>";
}
});
}
......@@ -637,6 +641,10 @@ HtmlHelper::registerCssAndScriptsFiles($cssJs, Yii::app()->getRequest()->getBase
"</div>"+
'</a>'+
"</li>";
}else{
str += "<li class='li-dropdown-invite-results col-xs-12 text-red'>"+
value.msg
"</li>";
}
});
......@@ -668,7 +676,7 @@ HtmlHelper::registerCssAndScriptsFiles($cssJs, Yii::app()->getRequest()->getBase
initListInvite();
fadeInView("result");
$("#modal-invite #dropdown-result").html(str);
//}
}
}
......@@ -1033,61 +1041,67 @@ HtmlHelper::registerCssAndScriptsFiles($cssJs, Yii::app()->getRequest()->getBase
dataType: "json",
success: function(data){
mylog.log("getcontactsbymails data", data, data.length);
var regexMail = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var nbError = 0;
var inParentLink = false;
$.each(data, function(keyMails, valueMails){
mylog.log("keyMails valueMails", keyMails, valueMails, typeof valueMails);
if(typeof valueMails == "object"){
if ( typeof parentLinks != "undefined" &&
typeof parentLinks.members != "undefined" &&
typeof parentLinks.members[valueMails.id] != "undefined" ){
inParentLink = true;
} else {
listInvite.citoyens[valueMails.id] = {
name : valueMails.name,
profilThumbImageUrl : valueMails.profilThumbImageUrl
} ;
if(parentType != "citoyens")
listInvite.citoyens[valueMails.id].isAdmin = "";
}
if(typeof data.result != "undefined" && data.result == false){
toastr.error(data.msg);
}else {
var regexMail = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var nbError = 0;
var inParentLink = false;
$.each(data, function(keyMails, valueMails){
mylog.log("keyMails valueMails", keyMails, valueMails, typeof valueMails);
if(typeof valueMails == "object"){
if ( typeof parentLinks != "undefined" &&
typeof parentLinks.members != "undefined" &&
typeof parentLinks.members[valueMails.id] != "undefined" ){
inParentLink = true;
} else {
listInvite.citoyens[valueMails.id] = {
name : valueMails.name,
profilThumbImageUrl : valueMails.profilThumbImageUrl
} ;
if(parentType != "citoyens")
listInvite.citoyens[valueMails.id].isAdmin = "";
}
} else {
mylog.log("regexMail", keyMails, regexMail.test(keyMails))
if(regexMail.test(keyMails)){
listInvite.invites[keyUniqueByMail(keyMails)] = {
name : keyMails,
mail : keyMails,
msg : ""
} ;
if(parentType != "citoyens")
listInvite.invites[keyUniqueByMail(keyMails)].isAdmin = "";
} else {
nbError++;
mylog.log("regexMail", keyMails, regexMail.test(keyMails))
if(regexMail.test(keyMails)){
listInvite.invites[keyUniqueByMail(keyMails)] = {
name : keyMails,
mail : keyMails,
msg : ""
} ;
if(parentType != "citoyens")
listInvite.invites[keyUniqueByMail(keyMails)].isAdmin = "";
} else {
nbError++;
}
}
}
});
});
showElementInvite(listInvite, true);
bindRemove();
mylog.log("nbError", nbError);
if(nbError > 0){
$("#modal-invite #errorFile").html(nbError+ " mails ne sont pas valides");
$("#modal-invite #errorFile").show();
}
showElementInvite(listInvite, true);
bindRemove();
mylog.log("nbError", nbError);
if(nbError > 0){
$("#modal-invite #errorFile").html(nbError+ " mails ne sont pas valides");
$("#modal-invite #errorFile").show();
}
if(inParentLink == true)
toastr.info("Certains contacts sont déjà membres, il n'ont pas été ajouter à la liste")
if(inParentLink == true)
toastr.info("Certains contacts sont déjà membres, il n'ont pas été ajouter à la liste");
}
$.unblockUI();
}
});
......
<div>
<?php
if(!empty($result) && $result == true){
$tab = array("removeMail", "notMail");
echo "Les actions suivantes ont été excécuté : ";
echo "<ul>";
foreach ($res as $k => $v) {
if(!empty($v) && !empty($v["result"]) && $v["result"] == true){
echo "<li>".$v["msg"]."</li>";
}
}
echo "</ul>";
}else{
echo $msg;
}
?>
</div>
\ No newline at end of file
<legend><?php echo Yii::t("common","Please choose your actions"); ?> :</legend>
<div class="col-xs-12">
<input type="checkbox" id="remove1" name="remove" value="remove1">
<label for="remove1"><?php echo Yii::t("common","Delete my email associated with items"); ?></label>
</div>
<div>
<input type="checkbox" id="remove2" name="remove" value="remove2">
<label for="remove2"><?php echo Yii::t("common","No longer allow my email to be informed about the platform"); ?></label>
</div>
<label for="email"><?php echo Yii::t("common","Your mail"); ?> : </label> <input type="text" name="email" id="email" />
<button id="btn-valider" class="btn btn-default" ><!-- <i class="fa fa-times"></i> --><?php echo Yii::t("common","Validate"); ?></button>
<div id="success" class="hidden text-green" style="margin-top: 30px;">
<h4><?php echo Yii::t("common","An e-mail has just been sent to you to validate the request"); ?> .</h4>
</div>
<?php
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
?>
<br><br>
<div class="col-xs-12">
<legend><?php echo Yii::t("common","Your data associated with your email address"); ?> :</legend>
<label for="email-info"><?php echo Yii::t("common","Your mail"); ?> : </label> <input type="text" name="email-info" id="email-info" />
<button id="btn-valid-info" class="btn btn-default" ><!-- <i class="fa fa-times"></i> --><?php echo Yii::t("common","Validate"); ?></button>
</div>
<?php
}
?>
<script type="text/javascript">
jQuery(document).ready(function() {
setTitle("Remove donnée : Répertoire","cog");
$("#btn-valider").off().on( "click", function(){
$("#success").addClass("hidden");
var param = {
removeMail : $("#remove1").prop("checked"),
notMail :$("#remove2").prop("checked"),
email : $("#email").val()
} ;
$.ajax({
type: "POST",
url: baseUrl+"/"+moduleId+"/mailmanagement/removedata/",
dataType: "json",
data : param,
success: function(data){
console.log("data", data);
if (data.result) {
toastr.success(data.msg);
$("#email").val("");
$("#success").removeClass("hidden");
} else {
toastr.error(data.msg);
}
}
});
});
$("#btn-valid-info").off().on( "click", function(){
$("#success").addClass("hidden");
var param = {
email : $("#email-info").val()
} ;
$.ajax({
type: "POST",
url: baseUrl+"/"+moduleId+"/mailmanagement/askdata/",
dataType: "json",
data : param,
success: function(data){
console.log("data", data);
if (data.result) {
toastr.success(data.msg);
$("#email").val("");
$("#success").removeClass("hidden");
} else {
toastr.error(data.msg);
}
}
});
});
});
</script>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment