Commit 9229d7e0 authored by Raph El's avatar Raph El
Browse files

Merge branch 'development' into custom-alex

parents c206d37a c6ad2fc5
...@@ -16,12 +16,16 @@ class Co2Module extends CWebModule { ...@@ -16,12 +16,16 @@ class Co2Module extends CWebModule {
private $_keywords = "societal, reseau,opensource,CO,communecter"; private $_keywords = "societal, reseau,opensource,CO,communecter";
private $_description = "réseau social libre et citoyen"; private $_description = "réseau social libre et citoyen";
private $_pageTitle = "Communecter:libre et connecté"; private $_pageTitle = "Communecter:libre et connecté";
private $_image= "Communecter:libre et connecté";
private $_favicon= "ico.ico";
public function getVersion(){return $this->_version;} public function getVersion(){return $this->_version;}
public function getVersionDate(){return $this->_versionDate;} public function getVersionDate(){return $this->_versionDate;}
public function getKeywords(){return $this->_keywords;} public function getKeywords(){return $this->_keywords;}
public function getDescription(){return $this->_description;} public function getDescription(){return $this->_description;}
public function getPageTitle(){return $this->_pageTitle;} public function getPageTitle(){return $this->_pageTitle;}
public function getImage(){return $this->_image;}
public function getFavicon(){return $this->_favicon;}
public function init() public function init()
{ {
......
...@@ -8,6 +8,19 @@ ...@@ -8,6 +8,19 @@
*/ */
class CustomModule extends CWebModule { class CustomModule extends CWebModule {
private $_keywords = "societal, reseau,opensource,CO,communecter";
private $_description = "réseau social libre et citoyen";
private $_pageTitle = "Communecter:libre et connecté";
private $_image= "Communecter:libre et connecté";
private $_favicon= "ico.ico";
public function getVersion(){return $this->_version;}
public function getVersionDate(){return $this->_versionDate;}
public function getKeywords(){return $this->_keywords;}
public function getDescription(){return $this->_description;}
public function getPageTitle(){return $this->_pageTitle;}
public function getImage(){return $this->_image;}
public function getFavicon(){return $this->_favicon;}
public function init() public function init()
{ {
......
...@@ -653,8 +653,7 @@ function connectTo(parentType, parentId, childId, childType, connectType, parent ...@@ -653,8 +653,7 @@ function connectTo(parentType, parentId, childId, childType, connectType, parent
} }
} }
} }
} });
);
} }
} }
...@@ -860,8 +859,9 @@ var urlCtrl = { ...@@ -860,8 +859,9 @@ var urlCtrl = {
window.location.href = urlObj.goto; window.location.href = urlObj.goto;
return false; return false;
} }
checkMenu(urlObj, hash); checkMenu(urlObj, hash);
endPoint = urlCtrl.loadableUrls[urlIndex]; endPoint = urlCtrl.loadableUrls[urlIndex];
mylog.log("jsController 2",endPoint,"login",endPoint.login,endPoint.hash ); mylog.log("jsController 2",endPoint,"login",endPoint.login,endPoint.hash );
if( typeof endPoint.login == undefined || !endPoint.login || ( endPoint.login && userId ) ) if( typeof endPoint.login == undefined || !endPoint.login || ( endPoint.login && userId ) )
...@@ -897,6 +897,7 @@ var urlCtrl = { ...@@ -897,6 +897,7 @@ var urlCtrl = {
if( endPoint.preaction && typeof endPoint.preaction == "function") if( endPoint.preaction && typeof endPoint.preaction == "function")
res = endPoint.preaction(hash); res = endPoint.preaction(hash);
//hash can be iliased //hash can be iliased
if (endPoint.hash) if (endPoint.hash)
hash = hash.replace(urlIndex, endPoint.hash); hash = hash.replace(urlIndex, endPoint.hash);
if(hash.indexOf("?") >= 0){ if(hash.indexOf("?") >= 0){
...@@ -908,6 +909,7 @@ var urlCtrl = { ...@@ -908,6 +909,7 @@ var urlCtrl = {
if(extraParams.indexOf("#") >= 0){ if(extraParams.indexOf("#") >= 0){
extraParams=extraParams.replace( "#","%hash%" ); extraParams=extraParams.replace( "#","%hash%" );
} }
path = urlCtrl.convertToPath(hash); path = urlCtrl.convertToPath(hash);
pathT = path.split('/'); pathT = path.split('/');
//open path in a modal (#openModal) //open path in a modal (#openModal)
...@@ -918,20 +920,24 @@ var urlCtrl = { ...@@ -918,20 +920,24 @@ var urlCtrl = {
} else { } else {
//console.log(">>>>>>>>>>>>>>>>>>> endPoint:",endPoint); //console.log(">>>>>>>>>>>>>>>>>>> endPoint:",endPoint);
mod = moduleId+ '/'; mod = moduleId+ '/';
if(moduleId != activeModuleId || endPoint.module){ if((moduleId != activeModuleId && activeModuleId != "costum") || endPoint.module){
mod = ''; mod = '';
//go get the path , module is given in the hash //go get the path , module is given in the hash
//console.log(">>>>>>>>>>>>>>>>>>> module path",path); //console.log(">>>>>>>>>>>>>>>>>>> module path",path);
} }
// console.log(">>>>>>>>>>>>>>>>>>> mod",mod,"> path : ",path,"> urlExtra : ",urlExtra,"> extraParams : ",extraParams); // console.log(">>>>>>>>>>>>>>>>>>> mod",mod,"> path : ",path,"> urlExtra : ",urlExtra,"> extraParams : ",extraParams);
// alert(baseUrl+'/'+ mod +path+urlExtra+extraParams);
showAjaxPanel( baseUrl+'/'+ mod +path+urlExtra+extraParams, endPoint.title,endPoint.icon, res,endPoint ); showAjaxPanel( baseUrl+'/'+ mod +path+urlExtra+extraParams, endPoint.title,endPoint.icon, res,endPoint );
if(path == "dda" && extraParams != "" && urlCtrl.firstLoad ){ if(path == "dda" && extraParams != "" ){
urlCtrl.afterLoad = function() { urlCtrl.afterLoad = function() {
extraParams = extraParams.substring(1); extraParams = extraParams.substring(1);
extraParamsT = extraParams.split("."); extraParamsT = extraParams.split(".");
uiCoop.prepPreview(extraParamsT[0],extraParamsT[1],null,extraParamsT[2],extraParamsT[3],null); typeProp= (extraParamsT[0]=="proposals") ? "proposal": extraParamsT[0];
uiCoop.getCoopDataPreview(typeProp,extraParamsT[1]/*, function(){
onchangeClick=false;
location.hash="#dda?"+typeProp+"."+extraParamsT[1];
}*/);
//uiCoop.prepPreview(extraParamsT[0],extraParamsT[1],null,extraParamsT[2],extraParamsT[3],null);
} }
} }
} }
...@@ -1149,7 +1155,7 @@ var urlCtrl = { ...@@ -1149,7 +1155,7 @@ var urlCtrl = {
//else //else
} }
} }
else if ( moduleId != activeModuleId) { else if ( moduleId != activeModuleId && activeModuleId != "costum") {
//alert( ctrlId +"/"+ actionId ); //alert( ctrlId +"/"+ actionId );
showAjaxPanel( baseUrl+'/'+ activeModuleId + '/'+ctrlId +"/"+ actionId, 'Home','home' ); showAjaxPanel( baseUrl+'/'+ activeModuleId + '/'+ctrlId +"/"+ actionId, 'Home','home' );
} }
......
...@@ -160,7 +160,6 @@ function autoCompleteSearch(indexMin, indexMax, callBack){ ...@@ -160,7 +160,6 @@ function autoCompleteSearch(indexMin, indexMax, callBack){
$(".btn-start-search").addClass("bg-azure"); $(".btn-start-search").addClass("bg-azure");
$(".btn-start-search").removeClass("bg-dark"); $(".btn-start-search").removeClass("bg-dark");
//if(indexMin > 0)
if(indexMin==0 || (typeof pageEvent != "undefined" && pageEvent)){ if(indexMin==0 || (typeof pageEvent != "undefined" && pageEvent)){
simpleScroll(scrollH, 400); simpleScroll(scrollH, 400);
$("#dropdown_search").html("<div class='col-md-12 col-sm-12 text-center search-loader text-dark'>"+ $("#dropdown_search").html("<div class='col-md-12 col-sm-12 text-center search-loader text-dark'>"+
...@@ -293,15 +292,15 @@ function autoCompleteSearch(indexMin, indexMax, callBack){ ...@@ -293,15 +292,15 @@ function autoCompleteSearch(indexMin, indexMax, callBack){
if(searchObject.initType == "events" && typeof showResultInCalendar != "undefined" && searchObject.text=="") if(searchObject.initType == "events" && typeof showResultInCalendar != "undefined" && searchObject.text=="")
showResultInCalendar(results); showResultInCalendar(results);
if(mapElements.length==0 || indexMin == 0)
if(mapElements.length==0) mapElements = results; mapElements = results;
else $.extend(mapElements, results); else
$.extend(mapElements, results);
if(location.hash == "#search" && searchObject.types.length > 1) if(location.hash == "#search" && searchObject.types.length > 1)
directory.switcherViewer(mapElements); directory.switcherViewer(mapElements);
else else
directory.switcherViewer(results); directory.switcherViewer(results);
//affiche les éléments sur la carte //affiche les éléments sur la carte
console.log("mapElements", results);
Sig.clearMap(); Sig.clearMap();
Sig.showMapElements(Sig.map, mapElements, "search", "Résultats de votre recherche"); Sig.showMapElements(Sig.map, mapElements, "search", "Résultats de votre recherche");
...@@ -664,6 +663,12 @@ function initPageTable(number){ ...@@ -664,6 +663,12 @@ function initPageTable(number){
$(".all-coop-detail-desc"+coopId).toggleClass('hide'); $(".all-coop-detail-desc"+coopId).toggleClass('hide');
}); });
$(".btn-coopfilter").off().click(function(){
$(".coopFilter").addClass('hidden');
$("."+$(this).data("filter")+"Filter").removeClass('hidden');
directory.sortSearch('.coopFilter:not(.hidden)');
});
$(".openCoopPanelHtml").off().click(function(){ $(".openCoopPanelHtml").off().click(function(){
mylog.log("HERE .openCoopPanelHtml"); mylog.log("HERE .openCoopPanelHtml");
var coopType = $(this).data("coop-type"); var coopType = $(this).data("coop-type");
...@@ -672,25 +677,26 @@ function initPageTable(number){ ...@@ -672,25 +677,26 @@ function initPageTable(number){
var parentId = $(this).data("coop-parentid"); var parentId = $(this).data("coop-parentid");
var parentType = $(this).data("coop-parenttype"); var parentType = $(this).data("coop-parenttype");
var afterLoad = null; var afterLoad = null;
location.hash="#dda?"+coopType+"."+coopId+"."+parentId+"."+parentType; onchangeClick=false;
location.hash="#dda?"+coopType+"."+coopId;//+"."+parentId+"."+parentType;
uiCoop.prepPreview(coopType,coopId,idParentRoom,parentId,parentType,afterLoad); uiCoop.prepPreview(coopType,coopId,idParentRoom,parentId,parentType,afterLoad);
if( $(this).data("coop-section") ){ if( $(this).data("coop-section") ){
coopSection = $(this).data("coop-section"); coopSection = $(this).data("coop-section");
if(coopSection == "amendments" ){ if(coopSection == "amendments" ){
afterLoad = function() { afterLoad = function() {
uiCoop.showAmendement(true); uiCoop.showAmendement(true);
if($("#form-amendement").hasClass("hidden")) /*if($("#form-amendement").hasClass("hidden"))
$("#form-amendement").removeClass("hidden"); $("#form-amendement").removeClass("hidden");
else else
$("#form-amendement").addClass("hidden"); $("#form-amendement").addClass("hidden");*/
}; };
} else if(coopSection == "vote" ){ } else if(coopSection == "vote" ){
mylog.log(".openCoopPanelHtml vote"); mylog.log(".openCoopPanelHtml vote");
afterLoad = function() { afterLoad = function() {
setTimeout(function(){ setTimeout(function(){
$("#coop-container").animate({ // $("#coop-container").animate({
scrollTop: $("#podVote").offset().top // scrollTop: $("#podVote").offset().top
}, 1000); // }, 1000);
}, 1000); }, 1000);
}; };
} }
...@@ -746,6 +752,7 @@ function initPageTable(number){ ...@@ -746,6 +752,7 @@ function initPageTable(number){
mylog.log("send vote",voteValue); mylog.log("send vote",voteValue);
uiCoop.sendVote("proposal", idParentProposal, voteValue, idParentRoom, null, true); uiCoop.sendVote("proposal", idParentProposal, voteValue, idParentRoom, null, true);
}); });
} }
function initBtnShare(){ function initBtnShare(){
...@@ -2549,11 +2556,25 @@ var directory = { ...@@ -2549,11 +2556,25 @@ var directory = {
var thisId = typeof params["_id"] != "undefined" && var thisId = typeof params["_id"] != "undefined" &&
typeof params["_id"]["$id"] != "undefined" ? params["_id"]["$id"] : typeof params["_id"]["$id"] != "undefined" ? params["_id"]["$id"] :
typeof params["id"] != "undefined" ? params["id"] : ""; typeof params["id"] != "undefined" ? params["id"] : "";
var filterClass = "";
var sortData = "";
if(typeof params.votes != "undefined"){
if(typeof params.votes.up != "undefined"){
filterClass += " upFilter";
sortData += " data-sort='"+params.votes.up.length+"' ";
}
if(typeof params.votes.down != "undefined"){
filterClass += " downFilter";
sortData += " data-sort='"+params.votes.down.length+"'";
}
}
str = ""; str = "";
if(size == "S") if(size == "S")
str += "<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12 blockCoop"+thisId+" coop-wraper margin-bottom-10 ' style='word-wrap: break-word; overflow:hidden;'>"; str += "<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12 blockCoop"+thisId+" "+filterClass+" coopFilter coop-wraper margin-bottom-10 ' "+sortData+" style='word-wrap: break-word; '>";
else else
str += "<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12 coop-wraper margin-bottom-10 ' style='word-wrap: break-word; overflow:hidden;'>"; str += "<div class='col-xs-12 coop-wraper margin-bottom-10 coopFilter "+filterClass+" ' "+sortData+" style='word-wrap: break-word;'>";
linkParams = " data-coop-type='"+ params.type + "' "+ linkParams = " data-coop-type='"+ params.type + "' "+
" data-coop-id='"+ thisId + "' "+ " data-coop-id='"+ thisId + "' "+
...@@ -2583,10 +2604,59 @@ var directory = { ...@@ -2583,10 +2604,59 @@ var directory = {
// "><i class='fa fa-chevron-right'></i> <span class='hidden-xs'>"+trad.Open+"</span></button>"; // "><i class='fa fa-chevron-right'></i> <span class='hidden-xs'>"+trad.Open+"</span></button>";
// NAME // NAME
if(name != "") if(name != ""){
str += '<a href="javascript:;" class="openCoopPanelHtml" style="text-decoration:none;" '+linkParams+'>'+ str += '<a href="javascript:;" class="openCoopPanelHtml" style="text-decoration:none;" '+linkParams+' >'+
'<h4 class="panel-title letter-turq"><i class="fa '+ params.ico + '"></i> '+ name + '</h4></a>'; '<h4 class="panel-title tooltips letter-turq" data-toggle="tooltip" data-placement="bottom" data-original-title="'+name+'">'+
'<i class="fa '+ params.ico + '"></i> '+
( (name.length > 100) ? name.substring(0,100)+"..." : name ) + '</h4></a>';
}
// if( typeof params.producer != "undefined" &&
// params.producer != null &&
// Object.keys(params.producer).length > 0 ) {
// var count = Object.keys(params.producer).length ;
// str += trad.proposedBy + " ";
// $.each(params.producer, function(kProd,valProd){
// var heightImg = ( count > 1 ) ? 35 : 25;
// var imgPath = assetPath+'/images/thumb/default_'+valProd.type+'.png';
// if(typeof valProd.profilThumbImageUrl != "undefined" && valProd.profilThumbImageUrl != null){
// imgPath = "/ph"+valProd.profilThumbImageUrl ;
// }
// str += '<img src="'+imgPath+'" class="img-circle" width="'+heightImg+'" height="'+heightImg+'" />';
// str += " "+valProd.name + " " ;
// });
// }
if( typeof params.producer != "undefined" &&
params.producer != null &&
Object.keys(params.producer).length > 0 ) {
count=Object.keys(params.producer).length;
htmlAbout="";
$.each(params.producer, function(e, v){
heightImg=(count>1) ? 35 : 25;
imgIcon = (typeof v.profilThumbImageUrl != "undefined" && v.profilThumbImageUrl!="" ) ? baseUrl+"/"+v.profilThumbImageUrl: assetPath + "/images/thumb/default_"+v.type+".png";
// htmlAbout+='<a href="#page.type.'+v.type+'.id.'+e+'" class="lbh tooltips" target="_blank" ';
// if(count>1) htmlAbout+= 'data-toggle="tooltip" data-placement="left" title="'+v.name+'"';
// htmlAbout+=">"+
htmlAbout+='<span ';
if(count>1) htmlAbout+= 'data-toggle="tooltip" data-placement="left" title="'+v.name+'"';
htmlAbout+=">"+
'<img src="'+imgIcon+'" class="img-circle margin-right-10" width='+heightImg+' height='+heightImg+' />';
if(count==1) htmlAbout+=v.name;
//htmlAbout+="</a>";
htmlAbout+="</span>";
});
htmlHeader = ((params.type == typeObj.event.col) ? trad["Planned on"] : tradCategory.carriedby ) ;
htmlHeader += " : "+htmlAbout;
str += htmlHeader;
}
// STATE OF THE PROPOSAL // STATE OF THE PROPOSAL
console.log("hasVote ? ", params.hasVote ); console.log("hasVote ? ", params.hasVote );
...@@ -2634,7 +2704,8 @@ var directory = { ...@@ -2634,7 +2704,8 @@ var directory = {
if(typeof userId != "undefined" && userId != null && userId != ""){ if(typeof userId != "undefined" && userId != null && userId != ""){
var btnSize = (params.status == "amendementAndVote") ? "6" : "12"; var btnSize = (params.status == "amendementAndVote") ? "6" : "12";
if( (params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote ===false ) 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>'; str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="vote" class="bg-green openCoopPanelHtml btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>';
//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 ) 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>'; 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>';
} else { } else {
...@@ -2643,7 +2714,7 @@ var directory = { ...@@ -2643,7 +2714,7 @@ var directory = {
str += '<a href="javascript:" data-toggle="modal" data-target="#modalLogin" class="btn-menu-connect bg-green btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>'; str += '<a href="javascript:" data-toggle="modal" data-target="#modalLogin" class="btn-menu-connect bg-green btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>';
} }
if( params.status == "amendementAndVote" || params.status =="amendable" ){ if( (params.status == "amendementAndVote" || params.status =="amendable") ){
amendCount = (params.amendements) ? " ("+Object.keys(params.amendements).length+")": ""; 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 += '<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>';
} }
...@@ -3047,15 +3118,23 @@ var directory = { ...@@ -3047,15 +3118,23 @@ var directory = {
titleSize=(searchObject.initType=="classifieds") ? "col-md-8 col-sm-6" : "col-md-9 col-sm-8"; titleSize=(searchObject.initType=="classifieds") ? "col-md-8 col-sm-6" : "col-md-9 col-sm-8";
toolsSize=(searchObject.initType=="classifieds") ? "col-md-4 col-sm-6" : "col-md-3 col-sm-4"; toolsSize=(searchObject.initType=="classifieds") ? "col-md-4 col-sm-6" : "col-md-3 col-sm-4";
headerFilters = "";
if( typeof custom != "undefined" && custom != null && typeof custom.filters != 'undefined'
&& typeof custom.filters.searchFilters != 'undefined'){
$.each(custom.filters.searchFilters,function(k,p) {
colorClass = (typeof p.colorClass != "unde") ? p.colorClass : "";
headerFilters += "<a href='javascript:;' data-filter='"+k+"' class='btn-coopfilter btn btn-xs "+colorClass+"'> "+p.label+"</a> ";
});
}
headerStr +='<div class="col-xs-12 margin-bottom-10">'+ headerStr +='<div class="col-xs-12 margin-bottom-10">'+
'<h4 class="elipsis '+titleSize+' col-xs-10 no-padding">'+ '<h4 class="elipsis '+titleSize+' col-xs-10 no-padding">'+
"<i class='fa fa-angle-down'></i> " + countHeader + " "+resultsStr+" "+ "<i class='fa fa-angle-down'></i> " + countHeader + " "+resultsStr+" "+
'<small>'+ '<small>'+directory.searchTypeHtml()+'</small>'+
directory.searchTypeHtml()+ headerFilters+
'</small>'+ '</h4>'+
'</h4>'+
'<div class="'+toolsSize+' col-xs-2 pull-right no-padding text-right headerSearchTools" style="padding-top:3px !important;">'; '<div class="'+toolsSize+' col-xs-2 pull-right no-padding text-right headerSearchTools" style="padding-top:3px !important;">';
// TODO CLEM :: ADD SURVEY // TODO CLEM :: ADD SURVEY
// if(searchObject.types.length == 1 && searchObject.types[0]=="vote"){ // if(searchObject.types.length == 1 && searchObject.types[0]=="vote"){
...@@ -3064,8 +3143,8 @@ var directory = { ...@@ -3064,8 +3143,8 @@ var directory = {
// '<span>'+tradDynForm.createsurvey+'</span>'+ // '<span>'+tradDynForm.createsurvey+'</span>'+
// '</a>'; // '</a>';
// } // }
if(userId != "" if(/*userId != ""
&& notNull(directory.custom) && */notNull(directory.custom)
&& typeof directory.custom.header != "undefined" && typeof directory.custom.header != "undefined"
&& typeof directory.custom.header.add != "undefined" && typeof directory.custom.header.add != "undefined"
&& typeof directory.custom.header.add[searchObject.initType] != "undefined"){ && typeof directory.custom.header.add[searchObject.initType] != "undefined"){
...@@ -3101,8 +3180,17 @@ var directory = { ...@@ -3101,8 +3180,17 @@ var directory = {
} }
headerStr+= '</div>'; headerStr+= '</div>';
} }
return headerStr; return headerStr;
}, },
sortSearch : function(what) {
var $wrapper = $('#dropdown_search');
$wrapper.find(what).sort(function (a, b) {
return +a.dataset.sort - +b.dataset.sort;
})
.appendTo( $wrapper );
},
checkImage : function($this){ checkImage : function($this){
// $.each(res, function(i,v){ // $.each(res, function(i,v){
// if($("#entity"+i+" .container-img-profil .img-responsive").length){ // if($("#entity"+i+" .container-img-profil .img-responsive").length){
...@@ -3302,6 +3390,8 @@ var directory = { ...@@ -3302,6 +3390,8 @@ var directory = {
directory.colPos = "left"; directory.colPos = "left";
if(typeof data == "object" && data!=null){ if(typeof data == "object" && data!=null){
$.each(data, function(i, params) { $.each(data, function(i, params) {
if(i!="count"){ if(i!="count"){
...@@ -3558,6 +3648,7 @@ var directory = { ...@@ -3558,6 +3648,7 @@ var directory = {
params.type == "actions" || params.type == "actions" ||
params.type == "resolutions" || params.type == "resolutions" ||
params.type == "rooms"){ params.type == "rooms"){
if(location.hash.indexOf('#dda') == 0) if(location.hash.indexOf('#dda') == 0)
str += directory.coopPanelHtml(params,null,"S"); str += directory.coopPanelHtml(params,null,"S");
else else
......
...@@ -78,7 +78,7 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input){ ...@@ -78,7 +78,7 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input){
data.countType = [ "citoyens", "organizations", "projects", "events" ]; data.countType = [ "citoyens", "organizations", "projects", "events" ];
data.searchType = [ "citoyens", "organizations", "projects", "events" ]; data.searchType = [ "citoyens", "organizations", "projects", "events" ];
} }
if(notNull(custom) && typeof custom.filters != "undefined" && typeof custom.filters.searchTypeGS != "undefined"){ if(typeof custom != "undefined" && notNull(custom) && typeof custom.filters != "undefined" && typeof custom.filters.searchTypeGS != "undefined"){
data.countType = custom.filters.searchTypeGS; data.countType = custom.filters.searchTypeGS;
data.searchType = custom.filters.searchTypeGS; data.searchType = custom.filters.searchTypeGS;
} }
...@@ -386,7 +386,7 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input){ ...@@ -386,7 +386,7 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input){
"</div>"; */ "</div>"; */
extendMsg=trad.extendedsearch; extendMsg=trad.extendedsearch;
extendUrl="#search"; extendUrl="#search";
if(notNull(custom) && typeof custom.searchOpenMenu != "undefined"){ if(typeof custom != "undefined" && notNull(custom) && typeof custom.searchOpenMenu != "undefined"){
extendMsg=custom.searchOpenMenu.msg; extendMsg=custom.searchOpenMenu.msg;
extendUrl=custom.searchOpenMenu.url; extendUrl=custom.searchOpenMenu.url;
} }
......
...@@ -244,6 +244,10 @@ function buildNotifications(list, element, event, elementType, elementId) ...@@ -244,6 +244,10 @@ function buildNotifications(list, element, event, elementType, elementId)
url=url[1]; url=url[1];
} }
url = "#"+url.replace(/\//g, "."); url = "#"+url.replace(/\//g, ".");
if(url.indexOf("#page.type.proposals") >= 0){
hasHProp=url.split(".");
url="#dda?proposals."+hasHProp[4];
}
momentNotif=notifObj.timeAgo; momentNotif=notifObj.timeAgo;
var icon = (typeof notifObj.notify != "undefined") ? notifObj.notify.icon : "fa-bell"; var icon = (typeof notifObj.notify != "undefined") ? notifObj.notify.icon : "fa-bell";
var displayName = (typeof notifObj.notify != "undefined") ? notifObj.notify.displayName : "Undefined notification"; var displayName = (typeof notifObj.notify != "undefined") ? notifObj.notify.displayName : "Undefined notification";
......
...@@ -44,7 +44,8 @@ var settings = { ...@@ -44,7 +44,8 @@ var settings = {
if(hidden) $('.btn-group-'+field+' > button[value="hide"]').addClass('active'); if(hidden) $('.btn-group-'+field+' > button[value="hide"]').addClass('active');
}); });
$.each(typePreferencesBool, function(field, typePrefB){ $.each(typePreferencesBool, function(field, typePrefB){
if(notNull(preferences) && typeof preferences[typePrefB] != "undefined" && preferences[typePrefB] == true) mylog.log("pref ", field, typePrefB, preferences)
if(notNull(preferences) && typeof preferences[typePrefB] != "undefined" && ( preferences[typePrefB] == true || preferences[typePrefB] == "true") )
$('.btn-group-'+typePrefB+' > button[value="true"]').addClass('active');