Commit 9bc6bdbc authored by Clément Damiens's avatar Clément Damiens
Browse files

Merge branch 'master'

Conflicts:
	views/admin/index.php
	views/custom/ctc.php
parents ef11f19e 76bad0e7
......@@ -927,16 +927,14 @@ var urlCtrl = {
}
// console.log(">>>>>>>>>>>>>>>>>>> mod",mod,"> path : ",path,"> urlExtra : ",urlExtra,"> extraParams : ",extraParams);
showAjaxPanel( baseUrl+'/'+ mod +path+urlExtra+extraParams, endPoint.title,endPoint.icon, res,endPoint );
if(path == "dda" && extraParams != "" ){
urlCtrl.afterLoad = function() {
extraParams = extraParams.substring(1);
extraParamsT = extraParams.split(".");
typeProp= (extraParamsT[0]=="proposals") ? "proposal": extraParamsT[0];
uiCoop.getCoopDataPreview(typeProp,extraParamsT[1]/*, function(){
onchangeClick=false;
location.hash="#dda?"+typeProp+"."+extraParamsT[1];
}*/);
uiCoop.getCoopDataPreview(typeProp,extraParamsT[1]);
//uiCoop.prepPreview(extraParamsT[0],extraParamsT[1],null,extraParamsT[2],extraParamsT[3],null);
}
}
......
......@@ -108,6 +108,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"),
......@@ -536,6 +538,9 @@ 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"),
"getdata" => array("href" => "/co2/mailmanagement/getdata"),
),
"element"=> array(
"updatesettings" => array('href' => "/ph/co2/element/updatesettings"),
......@@ -570,6 +575,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"),
"askdata" => array("href" => "/co2/element/askdata"),
"deletedata" => array("href" => "/co2/element/deletedata"),
"remove" => array("href" => "/co2/element/remove"),
),
"app" => array(
"welcome" => array('href' => "/ph/co2/app/welcome", "public" => true),
......
......@@ -109,8 +109,8 @@
"hash" : "#app.web",
"icon" : "globe",
"mainTitle" : "Moteur de recherche",
"placeholderMainSearch" : "Que recherchez-vous ?"},
"placeholderMainSearch" : "Que recherchez-vous ?"
},
"#referencement":
{ "inMenu" : false,
"useHeader" : true,
......@@ -530,6 +530,14 @@
"id":"btn-mailerror",
"href":"javascript:;",
"icon":"envelope"
},
"notsendmail" :{
"label":"Not send mail",
"super":true,
"class":"text-red",
"id":"btn-notsendmail",
"href":"javascript:;",
"icon":"envelope"
}
},
"element":{
......
......@@ -47,7 +47,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',
);
}
......
......@@ -3801,6 +3801,36 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
}else
echo "Tout le monde t'as vu !! reste bien tranquille";
}
public function actionStatsPacteEmails(){
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
$listPeopleId=array();
$countTotalVotes=0;
$props=PHDB::find('proposals', array("source.key"=>"pactePourLaTransition"));
foreach($props as $k => $v){
if(@$v["votes"]){
foreach($v["votes"] as $k => $ids){
if(@$v["votes"][$k] && !empty($v["votes"][$k])){
$countTotalVotes=($countTotalVotes+count($v["votes"][$k]));
foreach($ids as $id){
if(!in_array($id, $listPeopleId))
array_push($listPeopleId, $id);
}
}
}
}
}
echo "<span class='pull-left'>nombre de votes :".$countTotalVotes."</span><br/>----------------<br/>";
echo "nombre de personnes votantes:".count($listPeopleId)."<br/>------------------<br/>";
$listPeopleEmail=[];
foreach($listPeopleId as $k => $id){
$citoyen=PHDB::findOne('citoyens',array("_id"=>new MongoId($id)));
if(@$citoyen["email"]){
echo $citoyen["email"].",<br/>";
}
}
}else
echo "Tout le monde t'as vu !! reste bien tranquille";
}
public static function createfolder($folderPath){
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
echo "/////////////create folder//////////////////////////<br/>";
......
......@@ -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',
'askdata' => 'citizenToolKit.controllers.element.AskDataAction',
'remove' => 'citizenToolKit.controllers.element.RemoveAction',
'deletedata' => 'citizenToolKit.controllers.element.DeleteDataAction'
);
}
}
\ No newline at end of file
......@@ -20,12 +20,17 @@ 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',
'getdata' => 'citizenToolKit.controllers.mailmanagement.GetDataAction'
);
}
}
\ No newline at end of file
......@@ -221,6 +221,8 @@
loadAdddata();
else if(sub=="mailslist")
loadMailslist();
else if(sub=="notsendmail")
loadNotsendmail();
else if(sub=="community")
loadCustomCommunity();
......@@ -272,6 +274,11 @@
loadMailerror();
});
$("#btn-notsendmail").click(function(){
location.hash=hashUrlPage+".view.notsendmail";
loadNotsendmail();
});
$("#btn-mailslist").click(function(){
location.hash=hashUrlPage+".view.mailslist";
loadMailslist();
......@@ -361,6 +368,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 class="pageTable col-md-12 col-sm-12 col-xs-12 padding-20 text-center"></div>
<div class="panel-body">
<div>
<table class="table table-striped table-bordered table-hover directoryTable" id="panelAdmin">
<thead>
<tr>
<th>Email</th>
<th>Date</th>
</tr>
</thead>
<tbody class="directoryLines">
</tbody>
</table>
</div>
</div>
<div class="pageTable col-md-12 col-sm-12 col-xs-12 padding-20"></div>
</div>
<script type="text/javascript">
var results = <?php echo json_encode($results) ?>;
jQuery(document).ready(function() {
setTitle("Not send mail","cog");
initViewTable(results);
$("#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){
if (data.res.result) {
toastr.success(data.res.msg);
location.reload();
} else {
$("#error").removeClass("hidden");
$("#success").addClass("hidden");
toastr.error(data.res.msg);
$("#errormsg").html(data.res.msg);
}
}
});
});
});
function initViewTable(data){
$('#panelAdmin .directoryLines').html("");
$.each(data,function(key,values){
entry=buildDirectoryLine(key, values );
$("#panelAdmin .directoryLines").append(entry);
});
//bindAdminBtnEvents();
}
function buildDirectoryLine(key, e ){
mylog.log("here", e);
strHTML="";
actions = "";
classes = "";
strHTML += '<tr id="'+key+'">';
strHTML += '<td>'+e.target.email+'</td>';
strHTML += '<td class="center status">'+moment(e.date).local().format("DD-MM-YYYY HH:mm");
strHTML += '</td>';
/* **************************************
* ACTIONS
***************************************** */
// if(searchAdmin.mode=="source"){
// action='<button data-id="'+id+'" data-type="'+type+'" data-action="remove" data-setkey="source" class="margin-right-5 setSourceAdmin btn bg-red text-white"><i class="fa fa-ban"></i> Remove from source</button>';
// }else if (searchAdmin.mode=="reference"){
// action='<button data-id="'+id+'" data-type="'+type+'" data-action="remove" data-setkey="reference" class="margin-right-5 setSourceAdmin btn bg-red text-white"><i class="fa fa-ban"></i> Remove from reference</button> ';
// }
// else if (searchAdmin.mode=="open"){
// action='<button data-id="'+id+'" data-type="'+type+'" data-action="add" data-setkey="reference" class="margin-right-5 setSourceAdmin btn bg-green text-white"><i class="fa fa-plus"></i> Add as reference</button>';
// }
// strHTML += '<td class="center">';
// strHTML += '<div class="btn-group">'+action
// '</div>';
// strHTML += '</td>';
strHTML += '</tr>';
return strHTML;
}
\ No newline at end of file
......@@ -67,6 +67,7 @@ $layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
<?php foreach ($typeDirectory as $value) { ?>
<a href="javascript:;" onclick="applyStateFilter('<?php echo $value ?>')" class="filter<?php echo $value ?> btn btn-xs btn-default active btncountsearch"> <?php echo $value ?> <span class="badge badge-warning countPeople" id="count<?php echo $value ?>"> <?php echo @$results["count"][$value] ?></span></a>
<?php } ?>
<a href="<?php echo Yii::app()->request->baseUrl. '/dda/co/getproposals/format/csv'; ?> " target="_blank" id="csv"><i class='fa fa-2x fa-table text-green'></i></a></span>
</div>
<div class="pageTable col-md-12 col-sm-12 col-xs-12 padding-20 text-center"></div>
<div class="panel-body">
......
......@@ -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;">
......
<div class="pageContent">
<style type="text/css">
.row_title {
margin-top:10px;
}
#bg-homepage {
width:100%;
}
.numberCircle {
font-size: 50px;
font-weight: bold;
margin-right: 15px;
}
p.step {
font-size:30px;
font-weight:bold;
display : flex;
align-items : center;
}
ul {
list-style: none;
margin-left: 0;
padding-left: 1.2em;
text-indent: -1.2em;
}
li:before {
content: "►";
display: block;
float: left;
width: 1.2em;
color: #00B1E4;
}
li {
font-size:1.5em;
margin-bottom:10px;
}
</style>
<div class="row row_title">
<p class="text-center">
<img src='<?php echo Yii::app()->getModule("co2")->assetsUrl ?>/images/custom/mocica/title_mocica3.png' alt="MOCICA" class="mocica" style="width:450px;margin-left:40px;"/>
<img src='<?php echo Yii::app()->getModule("co2")->assetsUrl ?>/images/custom/mocica/title_logo.png' alt="MOCICA" class="logo" style="width:170px;"/>
</p>
<h1 class="phrase text-center">Unis et Libres</h1>
</div>
<div class="container">
<p>
Bienvenue sur la plate-forme du Mocica. Ce mouvement propose, en 3 étapes, le passage à un
modèle de société sans argent, géré par une Organisation Démocratique Globale. Sans
dirigeant, l'ODG permet à chacun de prendre part aux décisions qui le concernent, du niveau
le plus local (son quartier), jusqu'au niveau le plus global (le monde).
</p>
<p class="step" style="color:#F44336;"><span class='numberCircle'><!-- &#x2776; -->&#x2780;</span> Créer des assemblées de quartiers</p>
<p>Permettre aux membres du Mocica de se retrouver et former des assemblées de quartiers,
base de notre gouvernance autogérée ODG (Organisation Démocratique Globale)</p>
<p class="step" style="color:#448AFF;"><span class='numberCircle'><!-- &#x2777; -->&#x2781;</span> Diffuser le projet Mocica</p>
<p>Chaque assemblée a pour objectif de sympathiser et de promouvoir
le projet Mocica afin de multiplier les assemblées à travers le monde.</p>
<p class="step" style="color:#4CAF50;"><span class='numberCircle'><!-- &#x2778; -->&#x2782;</span> Débattre de notre organisation future</p>
<p class="step" style="color:#9A1B7E;"><span class='numberCircle'><!-- &#x2779; -->&#x2783;</span> Concrétiser les 3 étapes du projet Mocica :</p>
<p>
<span style='font-weight:bold;'>Rassemblement – Transition – Organisation</span> <br/> Tous les détails du projet Mocica <a href='https://mocica.org'>ici</a>.
</p>
<p>
<br/>
Vous trouverez sur cette plateforme de nombreux outils :
<ul>
<li>Créer des assemblées</li>
<li>Espace de discussion / débat icônes</li>
<li>Une cartographie</li>
<li>Faire des annonces</li>
<li>Sondage</li>
<li>Un agenda commun</li>
<li>Un espace d’entraide</li>
<li>Télécharger des documents</li>
</p>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
setTitle("Projet MOCICA Unis et Libre");
});
</script>
<?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);
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
$this->renderPartial($layoutPath.'header',
array( "layoutPath"=>$layoutPath ,
"page" => "welcome",
"type" => @$type));
?>
<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>
<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>
<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'),
} ;