Commit 6ab440e9 authored by Raph El's avatar Raph El
Browse files

Merge branch 'master' of https://github.com/pixelhumain/co2

parents 18ee6f96 822a098a
......@@ -572,9 +572,11 @@ function constructSearchObjectAndGetParams(){
getStatus+="text="+searchObject.text;
}
if(typeof searchObject.types != "undefined" && searchObject.types.length==1 && (searchObject.initType=="all" || searchObject.initType=="news")){
if(typeof searchObject.forced == "undefined" || typeof searchObject.forced.types == "undefined"){
getStatus+=(getStatus!="") ? "&":"";
getStatus+="types="+searchObject.types.join(",");
}
searchConstruct.searchType=searchObject.types;
getStatus+=(getStatus!="") ? "&":"";
getStatus+="types="+searchObject.types.join(",");
}else{
searchConstruct.searchType=searchObject.types;
}
......@@ -925,8 +927,9 @@ function customFiltersInterface(){
if(e=="types" && searchObject.initType!="news"){
keyfilter="searchSType";
}
if(typeof searchObject.forced == "undefined") searchObject.forced=new Object,
if(typeof searchObject.forced == "undefined") searchObject.forced=new Object;
searchObject.forced[keyfilter]=v[0];
// console.log("keyyyy",searc)
searchObject[keyfilter]=(searchObject.initType=="news") ? [v[0]] : v[0];
delete show[searchObject.initType][e];
$("#filters-nav-list .dropdown-"+e).remove();
......
......@@ -136,16 +136,18 @@ function getUrlSearchLocality(urlGet){
if(notNull(searchingOnLoc)){
$.each(searchingOnLoc, function(key, value){
mylog.log("getMultiScopeForSearch value.active", value.active);
if(value.active == true){
if(value.type == "cities"){
keyScope=(typeof value.postalCode == "undefined") ? value.id : value.id+"cp"+value.postalCode;
keyScope+=(typeof value.allCP == "undefined" && value.allCP) ? "allPostalCode" : "";
urlScopeCity.push(keyScope);
if(typeof custom == "undefined" || typeof custom.scopes == "undefined" || typeof custom.scopes[key] == "undefined" ){
if(value.active == true){
if(value.type == "cities"){
keyScope=(typeof value.postalCode == "undefined") ? value.id : value.id+"cp"+value.postalCode;
keyScope+=(typeof value.allCP == "undefined" && value.allCP) ? "allPostalCode" : "";
urlScopeCity.push(keyScope);
}
else if (value.type == "cp")
urlScopeCp.push(value.id);
else if (value.type.indexOf("level") >= 0)
urlScopeZone.push(value.id);
}
else if (value.type == "cp")
urlScopeCp.push(value.id);
else if (value.type.indexOf("level") >= 0)
urlScopeZone.push(value.id);
}
});
if(urlScopeCity.length > 0) urlMyScope+="&cities="+urlScopeCity.join(",");
......@@ -215,7 +217,7 @@ function appendScopeBreadcrum(){
if($.inArray(myScopes.type, ["multiscopes", "communexion"]) > -1)
$("#"+myScopes.type+"-btn").addClass("active");
}
function setOpenBreadCrum(params){
function setOpenBreadCrum(params, customCity){
setOpenScope={};
if(typeof params.zones != "undefined"){
zones=params.zones.split(",");
......@@ -251,6 +253,8 @@ function setOpenBreadCrum(params){
myScopes.open=data.scopes;
localStorage.setItem("myScopes",JSON.stringify(myScopes));
appendScopeBreadcrum();
if(customCity)
custom.scopes=myScopes["open"];
},
error: function(error){
toastr.error("waswrong")
......
......@@ -88,6 +88,9 @@ if( @Yii::app()->session['custom'] ){ ?>
$(".topLogoAnim").remove();
$(".logo-menutop, .logoLoginRegister").attr({'src':custom.logo});
}
if( typeof custom != "undefined" && custom.type == "cities" ){
setOpenBreadCrum({'cities': custom.id }, true);
}
};
custom.initMenu = function(where){
if(typeof custom.menu != "undefined"){
......@@ -149,4 +152,4 @@ if( @Yii::app()->session['custom'] ){ ?>
</script>
<?php }
}
?>
\ No newline at end of file
?>
Supports Markdown
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