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

Merge remote-tracking branch 'origin/master'

parents 3547b84c a8a20813
......@@ -282,13 +282,17 @@ var adminDirectory = {
aObj.panelAdmin.table != null ){
//mylog.log("adminDirectory.initTable table ", aObj.panelAdmin.table);
$.each(aObj.panelAdmin.table, function(key, value){
//mylog.log("adminDirectory.initTable each ", key, value);
if(value === "true")
str +="<th>"+key+"</th>";
else if(typeof value != "undefined" && typeof value.name != "undefined"){
var classCol = ((typeof value.class != "undefined") ? value.class : " text-center ");
str +="<th class='"+classCol+"'>"+value.name+"</th>";
mylog.log("adminDirectory.initTable each ", key, value, (key != "actions"));
if(key != "actions"){
mylog.log("adminDirectory.initTable if ");
if(value === "true")
str +="<th>"+key+"</th>";
else if(typeof value != "undefined" && typeof value.name != "undefined"){
var classCol = ((typeof value.class != "undefined") ? value.class : " text-center ");
str +="<th class='"+classCol+"'>"+value.name+"</th>";
}
}
});
}
......@@ -296,7 +300,12 @@ var adminDirectory = {
if( typeof aObj.panelAdmin.table != "undefined" &&
aObj.panelAdmin.actions != null &&
aObj.actionsStr === true) {
str +="<th class='col-xs-1'>Actions</th>";
var classCol = 'col-xs-1 text-center';
if(typeof aObj.panelAdmin.table.actions != "undefined" ){
if(typeof aObj.panelAdmin.table.actions.class != "undefined")
classCol = aObj.panelAdmin.table.actions.class ;
}
str +="<th class='"+classCol+"'>Actions</th>";
}
$("#"+aObj.container+" #headerTable").append(str) ;
},
......@@ -306,21 +315,24 @@ var adminDirectory = {
var aObj = this ;
if( typeof aObj.panelAdmin.table != "undefined" &&
aObj.panelAdmin.table != null ){
$.each(aObj.panelAdmin.table, function(key, value){
str += '<td class="center '+key+'">';
// if(key == "pdf" && value === "true"){
//
// } else if(key == "validated" && value === "true") {
// str += aObj.values.validated(e, id, type, aObj);
// } else if(key == "status" && value === "true") {
// str += aObj.values.status(e, id, type, aObj);
// } else
if(typeof aObj.values[key] != "undefined" && value === "true") {
str += aObj.values[key](e, id, collection, aObj);
} else if(typeof aObj.values[key] != "undefined") {
str += aObj.values[key](e, id, collection, aObj, value);
if(key != "actions"){
str += '<td class="center '+key+'">';
// if(key == "pdf" && value === "true"){
//
// } else if(key == "validated" && value === "true") {
// str += aObj.values.validated(e, id, type, aObj);
// } else if(key == "status" && value === "true") {
// str += aObj.values.status(e, id, type, aObj);
// } else
if(typeof aObj.values[key] != "undefined" && value === "true") {
str += aObj.values[key](e, id, collection, aObj);
} else if(typeof aObj.values[key] != "undefined") {
str += aObj.values[key](e, id, collection, aObj, value);
}
str += '</td>';
}
str += '</td>';
});
}
//mylog.log("adminDirectory.columTable ", str);
......@@ -616,7 +628,6 @@ var adminDirectory = {
return '<a href="'+baseUrl+'/co2/export/pdfelement/id/'+id+'/type/'+type+'/" data-id="'+id+'" data-type="'+type+'" class="col-xs-12 btn bg-green-k" target="_blank"> <i class="fa fa-file-pdf-o text-red" ></i> PDF </a> ';
},
validated : function(e, id, type, aObj){
//mylog.log("adminDirectory.actions.validated", e, id, type);
var str = "" ;
var isValidated=( typeof e.source != "undefined" && typeof e.source.toBeValidated != "undefined" && typeof e.source.toBeValidated[costum.slug] != "undefined" && e.source.toBeValidated[costum.slug] == true) ? false : true;
if(!isValidated){
......
......@@ -68,25 +68,26 @@ function startSearch(indexMin, indexMax, callBack){
}
}*/
function initCountType(){
if(searchObject.initType=="all"){
if(isCustom("types")){
searchObject.countType = [];
$.each(costum.app[appParamsKey].filters.types, function(e, v){
if(v=="organizations")
searchObject.countType=searchObject.countType.concat("NGO", "Group", "GovernmentOrganization", "LocalBusiness");
else
searchObject.countType.push(v);
});
}
else{
searchObject.countType=["NGO", "Group", "GovernmentOrganization", "LocalBusiness", "citoyens", "projects", "events", "poi", "classifieds"];
}
}
//else if(searchObject.initType=="ressources") searchObject.countType=["ressources"];
else if(searchObject.initType=="classifieds") searchObject.countType=["classifieds"];
else if(searchObject.initType=="events") searchObject.countType=["events"];
else if(searchObject.initType=="proposals") searchObject.countType=["proposals"];
}
mylog.log("initCountType ", searchObject.initType);
if(searchObject.initType=="all"){
if(isCustom("types")){
searchObject.countType = [];
$.each(costum.app[appParamsKey].filters.types, function(e, v){
if(v=="organizations")
searchObject.countType=searchObject.countType.concat("NGO", "Group", "GovernmentOrganization", "LocalBusiness");
else
searchObject.countType.push(v);
});
}
else{
searchObject.countType=["NGO", "Group", "GovernmentOrganization", "LocalBusiness", "citoyens", "projects", "events", "poi", "classifieds"];
}
}
//else if(searchObject.initType=="ressources") searchObject.countType=["ressources"];
else if(searchObject.initType=="classifieds") searchObject.countType=["classifieds"];
else if(searchObject.initType=="events") searchObject.countType=["events"];
else if(searchObject.initType=="proposals") searchObject.countType=["proposals"];
}
function removeSearchType(type){
var index = searchObject.types.indexOf(type);
......
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