Commit 11e846ef authored by Clément Damiens's avatar Clément Damiens
Browse files

fix url dda proposals

parent bd7bfd6e
...@@ -859,8 +859,9 @@ var urlCtrl = { ...@@ -859,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 ) )
...@@ -896,6 +897,7 @@ var urlCtrl = { ...@@ -896,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){
...@@ -907,6 +909,7 @@ var urlCtrl = { ...@@ -907,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)
...@@ -923,14 +926,18 @@ var urlCtrl = { ...@@ -923,14 +926,18 @@ var urlCtrl = {
//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);
} }
} }
} }
......
...@@ -679,7 +679,7 @@ function initPageTable(number){ ...@@ -679,7 +679,7 @@ function initPageTable(number){
var parentType = $(this).data("coop-parenttype"); var parentType = $(this).data("coop-parenttype");
var afterLoad = null; var afterLoad = null;
onchangeClick=false; onchangeClick=false;
location.hash="#dda?"+coopType+"."+coopId+"."+parentId+"."+parentType; 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");
......
...@@ -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";
......
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