Commit 2f436aa9 authored by thomas craipeau's avatar thomas craipeau

Merge branch 'qa' of https://gitlab.adullact.net/pixelhumain/co2 into qa

parents c5d39939 376cd8bb
......@@ -1933,24 +1933,6 @@ var directory = {
str += "<div class='col-md-8 col-sm-8 col-xs-12 margin-top-25'>";
str += dateFormated+countSubEvents;
str += "</div>";
if("undefined" != typeof params.organizerObj && params.organizerObj != null){
str += "<div class='col-md-8 col-sm-8 col-xs-12 entityOrganizer margin-top-10'>";
if("undefined" != typeof params.organizerObj.profilThumbImageUrl &&
params.organizerObj.profilThumbImageUrl != ""){
str += "<img class='pull-left img-responsive' src='"+baseUrl+params.organizerObj.profilThumbImageUrl+"' height='50'/>";
}
console.log("typeDYN",params.organizerObj.type, params.organizerObj);
elem = dyFInputs.get(params.organizerObj.type);
str += "<h5 class='no-margin padding-top-5'><small>"+tradDynForm.organizedby+"</small></h5>";
str += "<a href='#page.type."+elem.col+".id."+params.organizerObj["_id"]["$id"]+"' class='lbh' > <small class='entityOrganizerName'>"+params.organizerObj.name+"</small></a>";
str += "</div>";
}
str += "<div class='col-md-8 col-sm-8 col-xs-12 entityRight padding-top-10 margin-top-10 pull-right' style='border-top: 1px solid rgba(0,0,0,0.2);'>";
......@@ -1978,7 +1960,22 @@ var directory = {
params.name +
"</a>";
if("undefined" != typeof params.organizer && params.organizer != null){
countOrganizer=Object.keys(params.organizer).length;
str += "<div class='col-xs-12 margin-top-10 no-padding'>";
str+="<span class='bold'>"+tradDynForm.organizedby+" : </span>";
$.each(params.organizer, function(e,v){
imgIcon = (typeof v.profilThumbImageUrl != "undefined" && v.profilThumbImageUrl!="" ) ? baseUrl+"/"+v.profilThumbImageUrl: assetPath + "/images/thumb/default_"+v.type+".png";
str+='<a href="#page.type.'+v.type+'.id.'+e+'" class="lbh-preview-element tooltips" ';
if(countOrganizer>1) str+= 'data-toggle="tooltip" data-placement="top" title="'+v.name+'"';
str+=">"+
'<img src="'+imgIcon+'" class="img-circle margin-right-10" width="35" height="35"/>';
if(countOrganizer==1) str+=v.name;
str+="</a>";
});
str+="</div>";
}
str += "<div class='entityDescription margin-bottom-10'>" +
params.description +
"</div>";
......@@ -3045,8 +3042,9 @@ var directory = {
.done(function (data) {
if ( data && data.result ) {
toastr.info("élément effacé");
$("#"+type+id).remove();
if( $(".contain_"+type+"_"+id).length > 0 )
if( $("#"+type+id).length > 0)
$("#"+type+id).remove();
else if( $(".contain_"+type+"_"+id).length > 0 )
$(".contain_"+type+"_"+id).remove();
else
urlCtrl.loadByHash( location.hash );
......
......@@ -293,9 +293,9 @@ function buildLink(data) {
'</div>'+
' </a>';
html += '<li class="content_folder_file mix library-img col-xs-6" style="margin:0px !important; padding:5px;" data-cat="1">'+
html += '<li class="content_folder_file mix library-img col-xs-4" style="margin:0px !important; padding:5px;" data-cat="1">'+
' <div class="portfolio-item portfolio-item-album openFolder" data-folder="" data-folder-name="'+value.title+'" data-doctype="'+docT+'" data-key="">'+
'<div class="container-img col-xs-4 no-padding img circle" style="width:100%; height:auto">'+
'<div class="container-img col-xs-4 no-padding img circle" style="width:100%; height:auto; box-shadow: 0px 0px 20px -2px black;">'+
' <img src="'+value.img+'" class="initLibrary img-responsive"alt="">'+
'</div>'+
htmlBtn +
......
......@@ -199,7 +199,7 @@ class DatamigrationController extends CommunecterController {
echo $iFa." fiches actions ";
}else{
echo "Accès réservé au Big Bosses !";
}
}
}
public function actionUpdateAnswersActionCandidateMissing(){
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]))){
......@@ -210,51 +210,75 @@ class DatamigrationController extends CommunecterController {
array( "priorisation" => array('$nin' => array(
Ctenat::STATUT_ACTION_VALID,
Ctenat::STATUT_ACTION_MATURATION,
Ctenat::STATUT_ACTION_LAUREAT,
//Ctenat::STATUT_ACTION_LAUREAT,
Ctenat::STATUT_ACTION_REFUSE,
Ctenat::STATUT_ACTION_CANDIDAT,
Ctenat::STATUT_ACTION_CONTRACT,
"selected"))),
) ), array("formId", "priorisation") );
Ctenat::STATUT_ACTION_CONTRACT))),
) ), array("formId", "priorisation", "answers") );
$iTer=0;
$iFa=0;
Rest::json($answers); exit;
foreach($answers as $k => $v){
if(!empty($v["answers"]) &&
!empty($v["formId"])&&
!empty($v["answers"][$v["formId"]]) &&
!empty($v["answers"][$v["formId"]]["answers"]) &&
!empty($v["answers"][$v["formId"]]["answers"]["project"])&&
!empty($v["answers"][$v["formId"]]["answers"]["project"]["id"])){
$project=PHDB::findOneById(Project::COLLECTION,$v["answers"][$v["formId"]]["answers"]["project"]["id"], array("name", "slug"));
$cter=PHDB::findOne(Project::COLLECTION,array("slug"=> $v["formId"]), array("name", "slug"));
$iFa++;
echo "CTER concerné : ".$cter["name"]." : -> ".$cter["slug"]."<br/>";
$iFa=0;
$listCter = array();
if(!empty($answers)){
foreach($answers as $k => $v){
if(!empty($v["answers"]) &&
!empty($v["formId"])&&
!empty($v["answers"][$v["formId"]]) &&
!empty($v["answers"][$v["formId"]]["answers"]) &&
!empty($v["answers"][$v["formId"]]["answers"]["project"])&&
!empty($v["answers"][$v["formId"]]["answers"]["project"]["id"])){
//Rest::json($v["answers"]); exit;
$project=PHDB::findOneById(Project::COLLECTION,$v["answers"][$v["formId"]]["answers"]["project"]["id"], array("name", "slug"));
$cter=PHDB::findOne(Project::COLLECTION,array("slug"=> $v["formId"]), array("name", "slug"));
$iFa++;
//echo "CTER concerné : ".$cter["name"]." : -> ".$cter["slug"]."<br/>";
$prio = "";
if(!empty($v["priorisation"])){
if($v["priorisation"] == "abandoned"){
$prio = Ctenat::STATUT_ACTION_REFUSE;
}else if($v["priorisation"] == "selected"){
$prio = Ctenat::STATUT_ACTION_VALID;
}else if($v["priorisation"] == "reserved"){
$prio = Ctenat::STATUT_ACTION_MATURATION;
}else if($v["priorisation"] == Ctenat::STATUT_ACTION_LAUREAT){
$prio = Ctenat::STATUT_ACTION_MATURATION;
}
} else {
if( $cter["slug"] == "cteNordArdeche" || $cter["slug"] == "cteSudArdeche" )
$prio = Ctenat::STATUT_ACTION_VALID;
else
$prio = Ctenat::STATUT_ACTION_CANDIDAT;
}
$prio = "";
//echo $prio." CTER concerné : ".$cter["name"]." : -> ".$cter["slug"]."<br/>";
if( $prio != ""){
if(!isset($listCter[$cter["slug"]])){
$listCter[$cter["slug"]]["count"] = 1;
$listCter[$cter["slug"]]["projects"][] = $k. " -> ".$project["name"]. " : ".$prio ;
}else{
$listCter[$cter["slug"]]["projects"][] = $k. " -> ".$project["name"]. " : ".$prio;
$listCter[$cter["slug"]]["count"]++;
}
PHDB::update(Form::ANSWER_COLLECTION,
array("_id" => new MongoId($k)) ,
array('$set' => array("priorisation" => $prio))
);
if(!empty($v["priorisation"])){
if($v["priorisation"] == "abandoned"){
$prio = Ctenat::STATUT_ACTION_REFUSE;
Ctenat::updatePrioAnswers($k, $v["formId"], $prio, "priorisation");
}
} else {
}
// PHDB::update(Form::ANSWER_COLLECTION,
// array("_id" => $v["_id"]) ,
// array('$set' => array("priorisation" => "Action Candidate"))
// );
}
}
Rest::json($listCter); exit;
echo $iFa." fiches actions ";
}else{
echo "Accès réservé au Big Bosses !";
}
}
public function actionUpdateProjectOpenEditionCteNat(){
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]))){
$projects=PHDB::find(Project::COLLECTION, array("source.key"=>"ctenat"));
......@@ -6861,7 +6885,7 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
}
$resAnswers[$keyA] = $newPL;
echo $keyA."<br>";
//echo $keyA."<br>";
PHDB::update( "answers",
array("_id"=>new MongoId($keyA)),
array('$set' => array( "answers.".$answer["formId"].".answers.murir.planFinancement" => $newPL ) ) );
......@@ -6999,7 +7023,7 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
array("_id"=>new MongoId($a["_id"])),
array('$push' => array("answers.".$slug.".answers.murir.planFinancement" => [
"financerType" => $fk,
"title" => "Total financements collectivités",
"title" => "Financements collectivités",
"financer" => "",
"amount2019" => "",
"amount2020" => $a[ "answers"][ $slug ][ "answers"][ "financement"][$fk]["total"],
......@@ -7035,7 +7059,7 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
array("_id"=>new MongoId($a["_id"])),
array('$push' => array("answers.".$slug.".answers.murir.planFinancement" => [
"financerType" => $fk,
"title" => "Total Services et agences de l'état",
"title" => "Divers Financements Etat",
"financer" => "",
"amount2019" => "",
"amount2020" => $a[ "answers"][ $slug ][ "answers"][ "financement"][$fk]["total"],
......@@ -7094,8 +7118,8 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
PHDB::update( "answers",
array("_id"=>new MongoId($a["_id"])),
array('$push' => array("answers.".$slug.".answers.murir.planFinancement" => [
"financerType" => $fk,
"title" => "Acteurs socio-économiques",
"financerType" => "agenceLeau",
"title" => "Total Financements Agence de l'eau",
"amount2019" => "",
"amount2020" => $a[ "answers"][ $slug ][ "answers"][ "financement"][$fk]["total"],
"amount2021" => "",
......@@ -7105,8 +7129,8 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
PHDB::update( "answers",
array("_id"=>new MongoId($a["_id"])),
array('$push' => array("answers.".$slug.".answers.murir.planFinancement" => [
"financerType" => "acteursocioecot",
"title" => "Fondations",
"financerType" => "acteursocioeco",
"title" => "Financement provenant de Fondations",
"amount2019" => "",
"amount2020" => $a[ "answers"][ $slug ][ "answers"][ "financement"][$fk]["total"],
"amount2021" => "",
......
......@@ -11,6 +11,7 @@ co2/datamigration/ModifyCostumDB
co2/datamigration/UpdateAnswersIndicateurs
co2/datamigration/FinancterLabel
co2/datamigration/Financter
co2/datamigration/UpdateAnswersActionCandidateMissing
/////////////////////////// BASH VERSION 0.99 /////////////////////////////////////
......
......@@ -166,7 +166,7 @@ span{
<div class="col-xs-12"><ul class="file-description"></ul></div>
<div class="col-xs-12 no-padding" style="border-top: 2px #e2e2e2 dashed; margin-top: 1%; text-align:right;">
<a href="javascript:;" class="btn btn-warning ssmla" data-view="gallery" style="margin-top: 1%;"><i class="fa fa-plus"></i> Voir plus</a>
<a href="javascript:dyFObj.openForm('bookmark','sub')" class="btn btn-warning ssmla" data-view="gallery" style="margin-top: 1%;"><i class="fa fa-plus"></i> Voir plus</a>
</div>
</div>
......
......@@ -69,6 +69,16 @@
// $pageConfig=(@Yii::app()->session['paramsConfig']["element"]) ? Yii::app()->session['paramsConfig']["element"] : null;
// $addConfig=(@Yii::app()->session['paramsConfig']["add"]) ? Yii::app()->session['paramsConfig']["add"] : null;
///-------------- END ------------////
if(empty($element["_id"])){
$what=(@$element["type"]) ? "the ".Element::getControlerByCollection($element["type"]) : "the element";
?>
<script type="text/javascript">
urlCtrl.loadByHash("");
bootbox.dialog({message:"<div class='alert-danger text-center'><strong><?php echo Yii::t("common","{what}, that you are looking for, has been deleted or doesn't exist", array("{what}"=>ucfirst(Yii::t("common", $what)))) ?></strong></div>"});
</script>
<?php
exit;
}
if(@Yii::app()->params["front"]) $front = Yii::app()->params["front"];
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
$auth = Authorisation::canParticipate(Yii::app()->session['userId'], $type, (string)$element["_id"]);
......
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