Commit afa5f55a authored by Clément Damiens's avatar Clément Damiens

Merged branch development into development

parents 18d941c4 2b0fbad7
......@@ -2600,11 +2600,12 @@ var directory = {
str += '<small class="text-'+statusColor+'"><i class="fa fa-certificate"></i> '+trad[params.status]+'</small>';
// YOUR VOTE STATUS
if((params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote ===false)
str += '<small class="margin-left-15 letter-red"><i class="fa fa-ban"></i> '+trad["You did not vote"]+'</small>';
else if((params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote !==false)
str += '<small class="margin-left-15"><i class="fa fa-thumbs-up"></i> '+trad["You did vote"]+'</small>';
if(typeof userId != "undefined" && userId != null && userId != ""){
if((params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote ===false)
str += '<small class="margin-left-15 letter-red"><i class="fa fa-ban"></i> '+trad["You did not vote"]+'</small>';
else if((params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote !==false)
str += '<small class="margin-left-15"><i class="fa fa-thumbs-up"></i> '+trad["You did vote"]+'</small>';
}
// if(params.chat)
// str += '<a href="javascript:" '+linkParams+' data-coop-section="comments" class="openCoopPanelHtml btn btn-xs btn-default tooltips pull-right text-dark" data-toggle="tooltip" data-placement="top" data-original-title="'+tradDynForm.chat+'"><i class="fa fa-comments" ></i></a> ';
// if(params.invite)
......@@ -2628,15 +2629,18 @@ var directory = {
}
//SHOW HIDE VOTE BTNs
var btnSize = (params.status == "amendementAndVote") ? "6" : "12";
if( (params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote ===false )
str += '<a href="javascript:" '+ linkParams + ' class="btn-openVoteDetail bg-green btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>';
else if( (params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote !==false )
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="vote" class="openCoopPanelHtml btn btn-default col-sm-'+btnSize+' "><i class="fa fa-eye"></i> '+trad["See votes"]+'</a>';
if( params.status == "amendementAndVote" || params.status =="amendable" ){
amendCount = (params.amendements) ? " ("+Object.keys(params.amendements).length+")": "";
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="amendments" class="openCoopPanelHtml btn btn-default text-purple col-sm-6 "><i class="fa fa-list"></i> '+trad.Amendements+amendCount+'</a>';
if(typeof userId != "undefined" && userId != null && userId != ""){
var btnSize = (params.status == "amendementAndVote") ? "6" : "12";
if( (params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote ===false )
str += '<a href="javascript:" '+ linkParams + ' class="btn-openVoteDetail bg-green btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>';
else if( (params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote !==false )
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="vote" class="openCoopPanelHtml btn btn-default col-sm-'+btnSize+' "><i class="fa fa-eye"></i> '+trad["See votes"]+'</a>';
if( params.status == "amendementAndVote" || params.status =="amendable" ){
amendCount = (params.amendements) ? " ("+Object.keys(params.amendements).length+")": "";
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="amendments" class="openCoopPanelHtml btn btn-default text-purple col-sm-6 "><i class="fa fa-list"></i> '+trad.Amendements+amendCount+'</a>';
}
}
str += '</div>';
......
......@@ -24,6 +24,7 @@ dynForm = {
"</small>" );
}
$("#ajaxFormModal .publiccheckboxSimple").remove();
$("#ajaxFormModal .infoScopecustom").remove();
$("#ajaxFormModal .locationlocation").remove();
$("#ajaxFormModal .shortDescription").remove();
......@@ -40,7 +41,7 @@ dynForm = {
$("#ajax-modal #ajaxFormModal .titletext label").html("<i class='fa fa-chevron-down'></i> "+tradDynForm.surveyname);
$("#ajax-modal #ajaxFormModal .titletext input#title").attr("placeholder", tradDynForm.surveyname);
$("#ajaxFormModal .locationBtn").html("<i class='fa fa-home'></i> Sélectionner une commune");
$("#ajaxFormModal .publiccheckboxSimple").hide();
}
......@@ -392,6 +393,14 @@ dynForm = {
tags : dyFInputs.tags(),
urls : dyFInputs.urls,
status: dyFInputs.inputHidden( "amendable" ),
public : dyFInputs.checkboxSimple("true", "public", {
"onText" : trad.yes,
"offText": trad.no,
"onLabel" : tradDynForm.public,
"offLabel": tradDynForm.private,
"labelText": tradDynForm.makeprojectvisible+" ?",
"labelInformation": tradDynForm.explainvisibleproject
}),
parentId : dyFInputs.inputHidden(),
parentType : dyFInputs.inputHidden(),
}
......
......@@ -5448,6 +5448,36 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
echo "Number of user with preferences modified : ".$nbUser;
}
}
public function actionPublicProposal() {
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
$nbUser = 0;
$elts = PHDB::find( Proposal::COLLECTION,
array( "modifiedByBatch.PublicProposal" => array('$exists' => 0),
"parentType" => "citoyens") );
foreach ($elts as $keyE => $elt) {
$elt["modifiedByBatch"][] = array("PublicProposal" => new MongoDate(time()));
$elt["preferences"] = array();
$elt["preferences"]["private"]=false;
$nbUser++;
$res = PHDB::update(Proposal::COLLECTION,
array("_id"=>new MongoId($keyE)),
array('$set' => array( "preferences" => $elt["preferences"],
"modifiedByBatch" => $elt["modifiedByBatch"] ) ) );
if($res["ok"] == 1){
$nbUser++;
}else{
echo "<br/> Error with user id : ".$key;
}
}
//Rest::json($tags); exit;
echo "Number of user with preferences modified : ".$nbUser;
}
}
}
......
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