diff --git a/config/alfresco/templates/webscripts/org/alfresco/collaboration/colleaguePresence.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/collaboration/colleaguePresence.get.html.ftl index 922b27c969..3fc589494a 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/collaboration/colleaguePresence.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/collaboration/colleaguePresence.get.html.ftl @@ -5,6 +5,8 @@
-<#list projectSpace.subSpaces?keys as key>
+<#list projectSpace.subSpaces?keys?sort as key>
<#assign node = projectSpace.subSpaces[key]>
<#assign summary = node.properties["cm:summaryWebscript"]!"">
diff --git a/config/alfresco/templates/webscripts/org/alfresco/collaboration/projectSpace.get.js b/config/alfresco/templates/webscripts/org/alfresco/collaboration/projectSpace.get.js
index 5409fe6511..c9b9631726 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/collaboration/projectSpace.get.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/collaboration/projectSpace.get.js
@@ -22,7 +22,7 @@ function main(nodeRef)
{
if (node.hasAspect("{http://www.alfresco.org/model/content/1.0}projectsummary"))
{
- subSpaces[node.nodeRef] = node;
+ subSpaces[node.name] = node;
}
}
}
diff --git a/source/web/scripts/ajax/project_presence.js b/source/web/scripts/ajax/project_presence.js
index 86ee04cf3e..62cce7dbc3 100644
--- a/source/web/scripts/ajax/project_presence.js
+++ b/source/web/scripts/ajax/project_presence.js
@@ -5,59 +5,67 @@ var ProjectPresence =
{
OFFLINE_OPACITY: 0.2,
- init: function()
- {
+ init: function()
+ {
window.contextPath = ProjectPresence.getContextPath();
-
- var statuses = $$("#projectColleagues .colleaguePresence");
- var rows = $$("#projectColleagues .colleagueRow");
-
- $('colleaguesNotOnline').setStyle("opacity", ProjectPresence.OFFLINE_OPACITY);
-
- statuses.each(function(status, i)
- {
- var userDetails = status.attributes["rel"].value.split("|");
- var proxyURL = window.contextPath + "/ajax/invoke/PresenceProxyBean.proxyRequest";
- var statusURL = ProjectPresence.getStatusURL(userDetails);
-
- if (statusURL != "")
- {
- // ajax call to load online status
- var myAjax = new Ajax(proxyURL, {
- method: 'get',
- headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
- onComplete: function(textResponse, xmlResponse)
- {
- var statusType = ProjectPresence.getStatusType(userDetails[0], textResponse);
- status.addClass(userDetails[0] + "-" + statusType);
- if (statusType == "unknown")
- {
- status.title = "User's status is unknown, possibly due to client privacy settings";
- }
- else
- {
- status.title = "User's status is " + statusType;
- }
- if (statusType == "online")
- {
- $('colleaguesOnline').adopt(rows[i]);
- }
- else
- {
- $('colleaguesNotOnline').adopt(rows[i]);
- }
- }
- }).request("url=" + escape(statusURL));
- }
- else
- {
- status.addClass("none");
- status.title = "User's presence provider has not been configured by Alfresco admin";
- $('colleaguesNotOnline').adopt(rows[i]);
- }
- });
- },
-
+
+ var statuses = $$("#projectColleagues .colleaguePresence");
+ var rows = $$("#projectColleagues .colleagueRow");
+
+ $("colleaguesNotOnline").setStyle("opacity", ProjectPresence.OFFLINE_OPACITY);
+
+ statuses.each(function(stat, i)
+ {
+ var userDetails = stat.attributes["rel"].value.split("|");
+ var proxyURL = window.contextPath + "/ajax/invoke/PresenceProxyBean.proxyRequest";
+ var statusURL = ProjectPresence.getStatusURL(userDetails);
+
+ if (statusURL != "")
+ {
+ // ajax call to load online status
+ var myAjax = new Ajax(proxyURL, {
+ method: 'get',
+ headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
+ onComplete: function(textResponse, xmlResponse)
+ {
+ var statusType = ProjectPresence.getStatusType(userDetails[0], textResponse);
+ stat.addClass(userDetails[0] + "-" + statusType);
+ if (statusType == "unknown")
+ {
+ stat.title = "User's status is unknown, possibly due to client privacy settings";
+ }
+ else
+ {
+ stat.title = "User's status is " + statusType;
+ }
+ if (statusType == "online")
+ {
+ $("colleaguesOnline").adopt(rows[i]);
+ }
+ else
+ {
+ $("colleaguesNotOnline").adopt(rows[i]);
+ if (window.ie)
+ {
+ stat.getParent().setStyle("opacity", ProjectPresence.OFFLINE_OPACITY);
+ }
+ }
+ }
+ }).request("url=" + escape(statusURL));
+ }
+ else
+ {
+ stat.addClass("none");
+ stat.title = "User's presence provider has not been configured by Alfresco admin";
+ $("colleaguesNotOnline").adopt(rows[i]);
+ if (window.ie)
+ {
+ stat.getParent().setStyle("opacity", ProjectPresence.OFFLINE_OPACITY);
+ }
+ }
+ });
+ },
+
/* Calculates and returns the context path for the current page */
getContextPath: function()
{
@@ -76,51 +84,51 @@ var ProjectPresence =
return contextPath;
},
- getStatusURL: function(userDetails)
- {
- var provider = userDetails[0];
- var username = userDetails[1];
- var statusURL = "";
-
- switch(provider)
- {
- case "skype":
- statusURL = "http://mystatus.skype.com/" + username + ".txt";
- break;
- case "yahoo":
- statusURL = "http://opi.yahoo.com/online?u=" + username + "&m=t&t=1";
- break;
- }
-
- return statusURL;
- },
-
- getStatusType: function(provider, response)
- {
- var statusType = "unknown";
-
- switch(provider)
- {
- case "skype":
- switch (response)
- {
- case "Online":
- statusType = "online";
- break;
- case "Offline":
- statusType = "offline";
- break;
- default:
- statusType = "unknown";
- }
- break;
- case "yahoo":
- statusType = (response == "01") ? "online" : "offline";
- break;
- }
-
- return statusType;
- }
+ getStatusURL: function(userDetails)
+ {
+ var provider = userDetails[0];
+ var username = userDetails[1];
+ var statusURL = "";
+
+ switch(provider)
+ {
+ case "skype":
+ statusURL = "http://mystatus.skype.com/" + username + ".txt";
+ break;
+ case "yahoo":
+ statusURL = "http://opi.yahoo.com/online?u=" + username + "&m=t&t=1";
+ break;
+ }
+
+ return statusURL;
+ },
+
+ getStatusType: function(provider, response)
+ {
+ var statusType = "unknown";
+
+ switch(provider)
+ {
+ case "skype":
+ switch (response)
+ {
+ case "Online":
+ statusType = "online";
+ break;
+ case "Offline":
+ statusType = "offline";
+ break;
+ default:
+ statusType = "unknown";
+ }
+ break;
+ case "yahoo":
+ statusType = (response == "01") ? "online" : "offline";
+ break;
+ }
+
+ return statusType;
+ }
}
window.addEvent('domready', ProjectPresence.init);
|