Commit eb010374 authored by Raph El's avatar Raph El

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

parents 0efa1c22 e7f641ff
......@@ -540,14 +540,14 @@ var coInterface = {
if($("#headerBand").length > 0){
if($(this).scrollTop() > $("#headerBand").outerHeight() && infScroll){
coInterface.menu.initTopPostion=0;
coInterface.setDomHtmlPosition();
$("#affix-sub-menu, #mainNav, #menuApp, #filters-nav").removeClass("position-absolute");
$(".main-container.vertical .headerSearchContainer").addClass("affix");
coInterface.setDomHtmlPosition();
infScroll=false;
}else if($(this).scrollTop()<=$("#headerBand").outerHeight() && !infScroll){
coInterface.menu.initTopPostion=$("#headerBand").outerHeight();
coInterface.setDomHtmlPosition();
$("#affix-sub-menu, #mainNav, #filters-nav, #menuApp").addClass("position-absolute");
coInterface.setDomHtmlPosition();
infScroll=true;
}
......@@ -587,11 +587,14 @@ var coInterface = {
}, 400);
},
setDomHtmlPosition: function(){
mylog.log("coInterface.setDomHtmlPosition", coInterface.menu.initTopPostion);
$("#mainNav").css("top",coInterface.menu.initTopPostion);
//heightNav=$("#mainNav").outerHeight();
heightTopMenu=$("#mainNav").outerHeight()+coInterface.menu.initTopPostion;
mylog.log("coInterface.setDomHtmlPosition", heightTopMenu, $("#mainNav").outerHeight());
$("#menuApp, #affix-sub-menu").css("top",heightTopMenu);
$("#notificationPanelSearch.vertical.arrow_box, #floopDrawerDirectory, #modal-preview-coop, .main-container .dropdown-main-menu, #mainNav .dropdown-result-global-search, .main-container.vertical .portfolio-modal.modal, .portfolio-modal.modal.vertical").css("top",heightTopMenu);
$("#notificationPanelSearch.horizontal.arrow_box, #notificationPanelSearch.vertical.arrow_box, #floopDrawerDirectory, #modal-preview-coop, .main-container .dropdown-main-menu, #mainNav .dropdown-result-global-search, .main-container.vertical .portfolio-modal.modal, .portfolio-modal.modal.vertical").css("top",heightTopMenu);
$(".dropdownApps-menuTop .dropdown-menu, #affix-sub-menu .dropdown-result-global-search").css("top", (heightTopMenu+$("#text-search-menu").height()));
coInterface.setTopPosition(false);
/*if(heightNav > 70){
......@@ -600,33 +603,35 @@ var coInterface = {
} */
},
setTopPosition: function(bool){
headerScaling=bool;
heightPos=$("#mainNav").outerHeight();
if(coInterface.menu.initTopPostion!=0)
heightPos=heightPos+coInterface.menu.initTopPostion;
if($("#affix-sub-menu").is(":visible"))
heightPos=heightPos+$("#affix-sub-menu").outerHeight();
$("#filter-scopes-menu").css("top",heightPos);
if($("#filter-scopes-menu").is(":visible"))
heightPos=heightPos+$("#filter-scopes-menu").outerHeight();
if($("#menuApp").hasClass("subMenuTop")){
$("#menuApp").css("top",heightPos);
heightPos=heightPos+$("#menuApp").outerHeight();
}
$("#filters-nav").css("top",heightPos);
if($("#filters-nav").is(":visible"))
heightPos=heightPos+$("#filters-nav").outerHeight();
$("#mapContent").css("top",heightPos);
if($(".main-container.vertical .headerSearchContainer").hasClass("affix")){
$(".main-container.vertical .headerSearchContainer").css("top",heightPos);
heightPos=heightPos+$(".main-container.vertical .headerSearchContainer").outerHeight();
}else{
$(".main-container.vertical .headerSearchContainer").css("top","inherit");
}
if($("#headerBand").length > 0 && coInterface.menu.initTopPostion==0)
heightPos=heightPos+$("#headerBand").outerHeight();
$(".main-container").css("padding-top",heightPos);
setTimeout(function(){headerScaling=false;},300);
mylog.log("coInterface.setTopPosition", bool);
headerScaling=bool;
heightPos=$("#mainNav").outerHeight();
if(coInterface.menu.initTopPostion!=0)
heightPos=heightPos+coInterface.menu.initTopPostion;
if($("#affix-sub-menu").is(":visible"))
heightPos=heightPos+$("#affix-sub-menu").outerHeight();
$("#filter-scopes-menu").css("top",heightPos);
if($("#filter-scopes-menu").is(":visible"))
heightPos=heightPos+$("#filter-scopes-menu").outerHeight();
if($("#menuApp").hasClass("subMenuTop")){
$("#menuApp").css("top",heightPos);
heightPos=heightPos+$("#menuApp").outerHeight();
}
$("#filters-nav").css("top",heightPos);
if($("#filters-nav").is(":visible"))
heightPos=heightPos+$("#filters-nav").outerHeight();
$("#mapContent").css("top",heightPos);
if($(".main-container.vertical .headerSearchContainer").hasClass("affix")){
mylog.log("coInterface.setTopPosition headerSearchContainer heightPos", heightPos);
$(".main-container.vertical .headerSearchContainer").css("top",heightPos);
heightPos=heightPos+$(".main-container.vertical .headerSearchContainer").outerHeight();
}else{
$(".main-container.vertical .headerSearchContainer").css("top","inherit");
}
if($("#headerBand").length > 0 && coInterface.menu.initTopPostion==0)
heightPos=heightPos+$("#headerBand").outerHeight();
$(".main-container").css("padding-top",heightPos);
setTimeout(function(){headerScaling=false;},300);
},
bindResizeEvent : function(){
$(window).resize(function(){
......
......@@ -3723,6 +3723,7 @@ var directory = {
}*/
html+="</div>";
mylog.log("directory.getAdminToolBar html end", html);
return html;
},
getTypeObj: function(e){
......
......@@ -79,10 +79,14 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input, callB){
data.countType = [ "citoyens", "organizations", "projects", "events" ];
data.searchType = [ "citoyens", "organizations", "projects", "events" ];
}
if(typeof costum != "undefined" && notNull(costum) && typeof costum.filters != "undefined" && typeof costum.filters.searchTypeGS != "undefined"
&& (!notNull(input) || $.inArray(input, ["#filter-scopes-menu", "#scopes-news-form"]) < 0)){
data.countType = costum.filters.searchTypeGS;
data.searchType = costum.filters.searchTypeGS;
if(typeof costum != "undefined" && notNull(costum) && typeof costum.filters != "undefined" && (!notNull(input) || $.inArray(input, ["#filter-scopes-menu", "#scopes-news-form"]) < 0)){
if(typeof costum.filters.searchTypeGS != "undefined"){
data.countType = costum.filters.searchTypeGS;
data.searchType = costum.filters.searchTypeGS;
}
if(typeof costum.filters.sourceKey != "undefined"){
data.sourceKey=[costum.slug];
}
}
var domTarget = (notNull(input)) ? input+" .dropdown-result-global-search" : ".dropdown-result-global-search";
var dropDownVisibleDom=(notNull(input)) ? input+" .dropdown-result-global-search" : ".dropdown-result-global-search";
......@@ -148,7 +152,7 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input, callB){
str += '</div>';
str += "<hr style='margin: 0px; float:left; width:100%;'/>";
}
//parcours la liste des résultats de la recherche
//parcours la liste des résultats de la recherche
$.each(data.results, function(i, o) {
mylog.log("globalsearch res : ", o);
var typeIco = i;
......
......@@ -450,7 +450,7 @@ function bindButtonMenu(){
function getLabelTitleDir(dataName, dataIcon, countData, n){
mylog.log("getLabelTitleDir", dataName, dataIcon, countData, n, trad);
var elementName = "<span class='Montserrat' id='name-lbl-title'>"+$("#nameHeader .name-header").html()+"</span>";
var elementName = "<span class='Montserrat' id='name-lbl-title'>"+contextData.name+"</span>";
var s = (n>1) ? "s" : "";
......@@ -696,7 +696,7 @@ function displayInTheContainer(data, dataName, dataIcon, contextType, edit){
communityStr +='</div>';
}*/
mylog.log("communityStr", n, communityStr);
mylog.log("displayInTheContainer communityStr", n, communityStr);
if(n>0){
var thisTitle = getLabelTitleDir(dataName, dataIcon, parseInt(n), n);
......@@ -756,6 +756,7 @@ function displayInTheContainer(data, dataName, dataIcon, contextType, edit){
});
}
toogleNotif(false);
mylog.log("displayInTheContainer html",html);
$("#central-container").html(html);
//if(dataName != "collections" && directory.viewMode=="block")
// setTimeout(function(){ directory.checkImage(data);}, 300);
......@@ -788,7 +789,7 @@ function displayInTheContainer(data, dataName, dataIcon, contextType, edit){
});
});
}
mylog.log("displayInTheContainer here");
mylog.log("dataToMap", dataToMap);
$("#btn-show-links-onmap").off().click(function(){
//Sig.showMapElements(Sig.map, dataToMap, "", thisTitle);
......@@ -804,6 +805,7 @@ function displayInTheContainer(data, dataName, dataIcon, contextType, edit){
var html = communityStr+"<div class='col-md-12 col-sm-12 col-xs-12 labelTitleDir margin-bottom-15'>"+
getLabelTitleDir(dataName, dataIcon, parseInt(n), n)+
"</div>";
mylog.log("displayInTheContainer html2", html);
$("#central-container").html(html + "<span class='col-md-12 alert bold bg-white'>"+
"<i class='fa fa-ban'></i> "+trad.nodata+
"</span>");
......@@ -816,7 +818,9 @@ function displayInTheContainer(data, dataName, dataIcon, contextType, edit){
$(".load-coummunity").removeClass("active");
$(this).addClass("active");
pageProfil.params.dir = $(this).data("type-dir");
location.hash=hashUrlPage+".view.directory.dir."+pageProfil.params.dir;
//history.pushState remplace le location.hash car il recharge la page .
//location.hash=hashUrlPage+".view.directory.dir."+pageProfil.params.dir;
history.pushState(null, null, hashUrlPage+".view.directory.dir."+pageProfil.params.dir);
pageProfil.views.directory();
});
}
......
......@@ -7,8 +7,10 @@
"tool" : { "label": "Tool","key":"tool","icon":"wrench"},
"machine" : { "label": "Machine","key":"machine","icon":"cogs"},
"article" : { "label": "Article","key":"article","icon":"newspaper-o"},
"forum" : { "label": "Forum","key":"forum","icon":"comment"},
"cms" : { "label": "CMS","key":"cms","icon":"edit"},
"doc" : { "label": "Documentation","key":"doc","icon":"book"},
"faq" : { "label": "FAQ","key":"faq","icon":"info"},
"software" : { "label": "Software","key":"software","icon":"code"},
"rh" : { "label": "Human ressource","key":"rh","icon":"users"},
"financialRessource" : { "label": "Financial ressource","key":"RessourceFinanciere","icon":"money"},
......
......@@ -11,7 +11,32 @@ class DatamigrationController extends CommunecterController {
protected function beforeAction($action) {
return parent::beforeAction($action);
}
public function actionNASourceAllElts(){
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
$colElts = array(Person::COLLECTION, Organization::COLLECTION, Poi::COLLECTION);
$res = array();
foreach ($colElts as $keyCol => $col) {
$elts=PHDB::find($col, array("source" => array('$exists' => 0)), array("name"));
$res[$col] = 0;
foreach ($elts as $id => $elt) {
$source = array(
'insertOrign' => "import",
'date'=> new MongoDate(time()),
"key" => "notragora",
"keys" => array("notragora") );
PHDB::update($col,
array("_id" => $elt["_id"]),
array('$set' => array("source" => $source))
);
$res[$col]++;
}
}
Rest::json($res); exit;
}
}
public function actionKnowsToFollows(){
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
$persons=PHDB::find(Person::COLLECTION);
......@@ -65,21 +90,10 @@ class DatamigrationController extends CommunecterController {
}
public function actionActionWithnoAnswer(){
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]))){
echo "scenario<br/>".
"clicker c'est parti génère l'answers <br/>".
"mais le links ne se fait pas plus<br/>".
"todo :<br/>".
"[ ] refaire marcher les links comme avant l'utilisation de Ctenat::surveyAfterSave<br/>".
"[ ] générer les answers pour les 25 projets orphelins <br/>".
" >>> [ ] on a pas de lien entre le projet et orga <br/>".
" >>> [ ] retrouver à quel CTER appartient de creator de l'action <br/>".
" >>> [ ] on a le creator du project qui est le meme que celui de l'orga <br/>".
" >>> [X] au save de orga et project on a bien les links dans les params de la request<br/>".
" >>> [ ] retrouver le code dans element::Save <br/>";
$projects=PHDB::find(Project::COLLECTION, array("source.key"=>"ctenat", "category"=>"ficheAction"), array("links", "name","creator"));
$answers = PHDB::find(Form::ANSWER_COLLECTION, array("source.key"=>"ctenat","answers"=>['$exists'=>0]));
echo "<b style='color:red'>Empty Answers count : ".count($answers)."</b><br/><br/>";
//if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]))){
$projects=PHDB::find(Project::COLLECTION, array("source.key"=>"ctenat", "category"=>"ficheAction"), array("links", "name","creator","slug"));
$creators=[];
$projectNoAnswers = [];
$countAnswer=count($projects);
......@@ -88,65 +102,20 @@ class DatamigrationController extends CommunecterController {
if(!isset($p["links"]) || !isset($p["links"]["answers"]))
{
$i++;
echo "action : ".$p["name"]."<br/>";
echo "-------------------------------------------------<br/>";
echo "-------------------------------------------------<br/>";
echo "-----------------------".$i."--------------------------<br/>";
echo "Action : <a target='_blank' href='https://cte.ecologique-solidaire.gouv.fr/#@".$p["slug"]."'>".$p["name"]." : @".$p["slug"]."</a><br/>";
echo "-------------------------<br/>";
//who is the user
$person=PHDB::findOne(Person::COLLECTION, array("_id"=>new MongoId($p["creator"])), array("links", "name", "email"));
echo "<b>creator : ". $person["name"]." : ".$person["email"]." has ".count($person["links"])." links</b> <br/>";
if(!in_array($p["creator"], $creators)){
$creators[] = $p["creator"];
//echo implode(",", array_keys( $person["links"]));
foreach ($person["links"] as $what => $list) {
echo "<br/>".count($list)." ".$what."<br/>";
foreach ($list as $id => $val) {
if($what == "projects")
{
$el =PHDB::findOne(Project::COLLECTION, array( "_id"=>new MongoId($id)), array("links", "name"));
if(!in_array($id, $projectNoAnswers) && !isset($el["links"]) || !isset($el["links"]["answers"])){
$projectNoAnswers[] = $id;
echo "<b style='color:red'>proj: ".$id." : ".$el["name"]."</b><br/>";
if(!isset($el["category"]))
echo "<b>pas de category</b><br/>";
if(isset($el["links"])){
foreach ($el["links"] as $ow => $olist) {
echo "p>".count($olist)." ".$ow."<br/>";
}
}
}
} else if($what == "memberOf")
{
$el =PHDB::findOne(Organization::COLLECTION, array( "_id"=>new MongoId($id)), array("links", "name"));
if(!isset($el["links"]) || !isset($el["links"]["answers"])){
echo "<b>orga: ".$id." : ".$el["name"]."</b><br/>";
if(isset($el["links"])){
foreach ($el["links"] as $ow => $olist) {
echo "o>".count($olist)." ".$ow."<br/>";
//if($ow == "projects")
}
}
}
}
}
}
} else echo "<span style='color:red'>deja vu</span><br/>";
//find orga created by this user
$orgas =PHDB::find(Organization::COLLECTION, array( "creator"=> $p["creator"] ), array("links", "name"));
echo "orga créer : ".count($orgas);
// foreach($projects as $key => $o){
// echo "orga : ".$o["name"]."<br/>";
// }
echo "<br/><br/>-------------------------<br/>";
echo "<b>creator : ". $person["name"]." : ".$person["email"]."</b> <br/>";
echo "-------------------------<br/>";
}
}
echo "creators : ".count($creators)."<br/>";
echo count($projectNoAnswers)." n'ont pas de candidatures sur ".$countAnswer." ficheActions";
}
echo $i." n'ont pas de candidatures sur ".$countAnswer." ficheActions";
//}
}
public function actionRemoveLinkCterWithCter(){
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]))){
......@@ -4996,7 +4965,7 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
$parentType= Event::COLLECTION;
else
$parentType=$value["parentType"];
$set["parent"]=array($value["parentId"] => array("type"=>$parentType));
$set["parent"]=array($value["parentId"] => array("type"=>$parentType, "name"=>$value["name"]));
}
if(@$value["parentId"]){
......
......@@ -8,15 +8,7 @@
padding-bottom: 15px;
}
</style>
<?php
//var_dump($params);
if(!empty($params["files"])){ ?>
<h5 class="col-xs-12 title-files-list text-dark"> Voir le récapitulatif de la mesure :</h5>
<?php foreach($params["files"] as $k => $v){ ?>
<div class='col-xs-12 padding-5 shadow2 margin-top-5 margin-bottom-5'>
<a href='<?php echo $v["docPath"] ?>' target='_blank' class="link-files"><i class="fa fa-file-pdf-o text-red"></i> <?php echo $v["name"] ?></a>
</div>
<?php } } ?>
<div id="description" class="description-preview col-xs-12 no-padding activeMarkdown"><?php echo (!empty($params["description"]) ? $params["description"] : "" ); ?></div>
<?php
......
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