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 = {
window.location.href = urlObj.goto;
return false;
}
checkMenu(urlObj, hash);
endPoint = urlCtrl.loadableUrls[urlIndex];
mylog.log("jsController 2",endPoint,"login",endPoint.login,endPoint.hash );
if( typeof endPoint.login == undefined || !endPoint.login || ( endPoint.login && userId ) )
......@@ -896,6 +897,7 @@ var urlCtrl = {
if( endPoint.preaction && typeof endPoint.preaction == "function")
res = endPoint.preaction(hash);
//hash can be iliased
if (endPoint.hash)
hash = hash.replace(urlIndex, endPoint.hash);
if(hash.indexOf("?") >= 0){
......@@ -907,6 +909,7 @@ var urlCtrl = {
if(extraParams.indexOf("#") >= 0){
extraParams=extraParams.replace( "#","%hash%" );
}
path = urlCtrl.convertToPath(hash);
pathT = path.split('/');
//open path in a modal (#openModal)
......@@ -923,14 +926,18 @@ var urlCtrl = {
//console.log(">>>>>>>>>>>>>>>>>>> module path",path);
}
// 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 );
if(path == "dda" && extraParams != "" && urlCtrl.firstLoad ){
if(path == "dda" && extraParams != "" ){
urlCtrl.afterLoad = function() {
extraParams = extraParams.substring(1);
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){
var parentType = $(this).data("coop-parenttype");
var afterLoad = null;
onchangeClick=false;
location.hash="#dda?"+coopType+"."+coopId+"."+parentId+"."+parentType;
location.hash="#dda?"+coopType+"."+coopId;//+"."+parentId+"."+parentType;
uiCoop.prepPreview(coopType,coopId,idParentRoom,parentId,parentType,afterLoad);
if( $(this).data("coop-section") ){
coopSection = $(this).data("coop-section");
......
......@@ -244,6 +244,10 @@ function buildNotifications(list, element, event, elementType, elementId)
url=url[1];
}
url = "#"+url.replace(/\//g, ".");
if(url.indexOf("#page.type.proposals") >= 0){
hasHProp=url.split(".");
url="#dda?proposals."+hasHProp[4];
}
momentNotif=notifObj.timeAgo;
var icon = (typeof notifObj.notify != "undefined") ? notifObj.notify.icon : "fa-bell";
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