Commit 915da297 authored by Raph El's avatar Raph El
Browse files

AJout page admin + hotfix

parent 8d9cbd0e
......@@ -107,6 +107,8 @@ class CommunecterController extends Controller
"cities" => array("href" => "/ph/co2/admin/cities"),
"circuits" => array("href" => "/ph/co2/admin/circuits"),
"mailslist" => array("href" => "ph/co2/admin/mailslist"),
"notsendmail" => array("href" => "/ph/co2/admin/notsendmail"),
"addnotsendmail" => array("href" => "/ph/co2/admin/addnotsendmail"),
),
"docs" => array(
"index" => array("href" => "/ph/co2/docs"),
......@@ -537,6 +539,7 @@ class CommunecterController extends Controller
"createandsend" => array("href" => "/co2/mailmanagement/createandsend"),
"removedata" => array("href" => "/co2/mailmanagement/removedata"),
"askdata" => array("href" => "/co2/mailmanagement/askdata"),
"getdata" => array("href" => "/co2/mailmanagement/getdata"),
),
"element"=> array(
"updatesettings" => array('href' => "/ph/co2/element/updatesettings"),
......@@ -571,7 +574,7 @@ 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"),
"askdata" => array("href" => "/co2/element/askdata"),
"deletedata" => array("href" => "/co2/element/deletedata"),
"remove" => array("href" => "/co2/element/remove"),
),
......
......@@ -46,7 +46,8 @@ class AdminController extends CommunecterController {
'statistics' => 'citizenToolKit.controllers.admin.StatisticsAction',
'createfile' => 'citizenToolKit.controllers.admin.CreateFileAction',
'cities' => 'citizenToolKit.controllers.admin.CitiesAction',
'notsendmail' => 'citizenToolKit.controllers.admin.NotSendMailAction',
'addnotsendmail' => 'citizenToolKit.controllers.admin.AddNotSendMailAction',
);
}
......
......@@ -45,8 +45,8 @@ 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',
'askdata' => 'citizenToolKit.controllers.element.AskDataAction',
'remove' => 'citizenToolKit.controllers.element.RemoveAction',
'deletedata' => 'citizenToolKit.controllers.element.DeleteDataAction'
);
......
......@@ -29,7 +29,8 @@ class MailmanagementController extends CommunecterController {
'droppedmail' => 'citizenToolKit.controllers.mailmanagement.DroppedMailAction',
'createandsend' => 'citizenToolKit.controllers.mailmanagement.CreateAndSendAction',
'removedata' => 'citizenToolKit.controllers.mailmanagement.RemoveDataAction',
'askdata' => 'citizenToolKit.controllers.mailmanagement.AskDataAction'
'askdata' => 'citizenToolKit.controllers.mailmanagement.AskDataAction',
'getdata' => 'citizenToolKit.controllers.mailmanagement.GetDataAction'
);
}
}
\ No newline at end of file
......@@ -151,6 +151,14 @@
"id"=> "btn-mailerror",
"href"=>"javascript:;",
"icon"=>"envelope"
),
"notsendmail" => array(
"label"=>Yii::t("admin","Not send mail"),
"super"=>true,
"class"=> "text-red",
"id"=> "btn-notsendmail",
"href"=>"javascript:;",
"icon"=>"envelope"
)
);
?>
......@@ -364,6 +372,8 @@
loadAdddata();
else if(sub=="mailslist")
loadMailslist();
else if(sub=="notsendmail")
loadNotsendmail();
/*else if(sub=="backups")
loadBackup();
else if(sub=="bookings"){
......@@ -412,6 +422,11 @@
loadMailerror();
});
$("#btn-notsendmail").click(function(){
location.hash=hashUrlPage+".view.notsendmail";
loadNotsendmail();
});
$("#btn-mailslist").click(function(){
location.hash=hashUrlPage+".view.mailslist";
loadMailslist();
......@@ -492,6 +507,15 @@
}
function loadNotsendmail(){
initDashboard();
var url = "admin/notsendmail";
//showLoader('.content-view-dashboard');
$("#goBackToHome").show(700);
ajaxPost('#content-view-admin', baseUrl+'/'+moduleId+'/'+url, null, function(){},"html");
}
function loadMailslist(){
initDashboard();
var url = "adminpublic/mailslist";
......
<div class="col-xs-12" id="divRemove" style="margin-top: 10px">
<legend><?php echo Yii::t("common","Not send mails"); ?> :</legend>
<div class="col-xs-12 padding-10">
<label for="email"><?php echo Yii::t("common","Your mail"); ?> : </label> <input type="text" name="email" id="email" />
</div>
<div class="col-xs-12">
<button id="btn-valider" class="btn btn-default" ><!-- <i class="fa fa-times"></i> --><?php echo Yii::t("common","Validate"); ?></button>
</div>
<div class="col-xs-12 padding-10">
<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>
<div id="error" class="hidden text-red" style="margin-top: 30px;">
<h4 id="errormsg"></h4>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
setTitle("Not send mail","cog");
$("#btn-valider").off().on( "click", function(){
$("#success").addClass("hidden");
$("#error").addClass("hidden");
var param = {
email : $("#email").val()
} ;
mylog.log("param", param);
$.ajax({
type: "POST",
url: baseUrl+"/"+moduleId+"/admin/addnotsendmail/",
dataType: "json",
data : param,
success: function(data){
console.log("data", data);
if (data.result) {
toastr.success(data.msg);
$("#email").val("");
$("#success").removeClass("hidden");
$("#error").addClass("hidden");
} else {
$("#error").removeClass("hidden");
$("#success").addClass("hidden");
toastr.error(data.msg);
$("#errormsg").html(data.msg);
}
}
});
});
});
\ No newline at end of file
......@@ -59,8 +59,6 @@ $states = array();
<a href="javascript:;" onclick="showType('line')" class="btn btn-xs btn-default">Tous</a>
<a href="javascript:;" onclick="showType('pending')" class="btn btn-xs btn-default">Pending</a>
<a href="javascript:;" onclick="showType('update')" class="btn btn-xs btn-default">Update</a>
</h5>
<div style="width:80%; display: -webkit-inline-box;">
......
<?php
$cssAnsScriptFiles = array(
'/assets/vendor/jquery_realperson_captcha/jquery.realperson.css',
'/assets/vendor/jquery_realperson_captcha/jquery.plugin.js',
'/assets/vendor/jquery_realperson_captcha/jquery.realperson.min.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFiles, Yii::app()->theme->baseUrl);
?>
<div class="row">
<div class="col-md-12 margin-top-15 text-dark menuInvite">
<ul class="nav nav-tabs">
<li role="presentation">
<a href="javascript:" class='radius-10 padding-10 text-green' id="menuRemove">
<h4><i class="fa fa-trash"></i>
<?php echo Yii::t("common","Remove my data"); ?> </h4>
</a>
</li>
<li role="presentation">
<a href="javascript:" class="radius-10 padding-10 text-dark" id="menuGet">
<h4><i class="fa fa-info-circle"></i>
<?php echo Yii::t("common","Get my data"); ?> </h4>
</a>
</li>
</ul>
</div>
</div>
<div class="col-xs-12" id="divRemove" style="margin-top: 10px">
<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 class="col-xs-12">
<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>
<div class="col-xs-12 padding-10">
<label for="email"><?php echo Yii::t("common","Your mail"); ?> : </label> <input type="text" name="email" id="email" />
</div>
<div class="col-xs-12">
<div class="col-xs-4 padding-10">
<input placeholder="<?php echo Yii::t("terla", "copy the code here"); ?>" class="col-xs-12 txt-captcha" id="captcha">
</div>
</div>
<div class="col-xs-12">
<button id="btn-valider" class="btn btn-default" ><!-- <i class="fa fa-times"></i> --><?php echo Yii::t("common","Validate"); ?></button>
</div>
<div class="col-xs-12 padding-10">
<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>
<div id="error" class="hidden text-red" style="margin-top: 30px;">
<h4 id="errormsg"></h4>
</div>
</div>
</div>
<?php
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
?>
<div class="col-xs-12 hidden" id="divGet" style="margin-top: 10px">
<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" />
</div>
<div class="col-xs-12">
<div class="col-xs-4 padding-10">
<input placeholder="<?php echo Yii::t("terla", "copy the code here"); ?>" class="col-xs-12 txt-captcha" id="captchaGet">
</div>
</div>
<div class="col-xs-12">
<button id="btn-valid-info" class="btn btn-default" ><?php echo Yii::t("common","Validate"); ?></button>
</div>
<div class="col-xs-12 padding-10">
<div id="successGet" class="hidden text-green" style="margin-top: 30px;">
<h4><?php echo Yii::t("common","Vous allez recevoir un e-mail avec vos informations"); ?> .</h4>
</div>
<div id="errorGet" class="hidden text-red" style="margin-top: 30px;">
<h4 id="errormsgget"></h4>
</div>
</div>
</div>
<?php
}
?>
<script type="text/javascript">
jQuery(document).ready(function() {
setTitle("Remove donnée : Répertoire","cog");
$("#captcha").realperson({length: 4});
$("#captchaGet").realperson({length: 4});
$("#btn-valider").off().on( "click", function(){
$("#success").addClass("hidden");
$("#error").addClass("hidden");
if($('[name=remove').is(':checked') == true ) {
var param = {
removeMail : $("#remove1").prop("checked"),
notMail :$("#remove2").prop("checked"),
email : $("#email").val(),
captchaUserVal: $("#captcha").val(),
captchaHash: $("#captcha").realperson('getHash')
} ;
mylog.log("param", param);
$.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");
$("#error").addClass("hidden");
} else {
$("#error").removeClass("hidden");
$("#success").addClass("hidden");
toastr.error(data.msg);
$("#errormsg").html(data.msg);
}
}
});
} else {
$("#error").removeClass("hidden");
$("#success").addClass("hidden");
toastr.error("Select at least one action");
$("#errormsg").html("Select at least one action");
}
});
$("#btn-valid-info").off().on( "click", function(){
var param = {
email : $("#email-info").val(),
captchaUserVal: $("#captchaGet").val(),
captchaHash: $("#captchaGet").realperson('getHash'),
} ;
$.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-info").val("");
$("#successGet").removeClass("hidden");
$("#errorGet").addClass("hidden");
} else {
$("#errorGet").removeClass("hidden");
$("#success").addClass("hidden");
toastr.error(data.msg);
$("#errormsgget").html(data.msg);
}
}
});
});
$("#menuRemove").click(function() {
mylog.log("menuRemove");
$("#divGet").addClass("hidden");
$("#divRemove").removeClass("hidden");
$("#menuRemove").addClass("text-green");
$("#menuGet").removeClass("text-green");
});
$("#menuGet").click(function() {
mylog.log("menuGet");
$("#divRemove").addClass("hidden");
$("#divGet").removeClass("hidden");
$("#menuGet").addClass("text-green");
$("#menuRemove").removeClass("text-green");
});
});
</script>
\ No newline at end of file
......@@ -643,7 +643,13 @@ HtmlHelper::registerCssAndScriptsFiles($cssJs, Yii::app()->getRequest()->getBase
"</li>";
}else{
str += "<li class='li-dropdown-invite-results col-xs-12 text-red'>"+
value.msg
"<div class='success pull-left text-red'><i class='fa fa-times'></i></div>"+
"<div class='btn-scroll-type pull-left col-xs-10' >"+
'<span class="text-dark text-bold text-red margin-left-5 msg-back">'+
'<i class="fa fa-arrow-right"></i> '+value.msg +
'</span>'+
"</div>"+
"</li>";
}
......
<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