From ef78de301d38ea711ed6497a0b4c60b6245d1e1c Mon Sep 17 00:00:00 2001 From: Mike Hatfield Date: Thu, 29 Nov 2007 15:25:10 +0000 Subject: [PATCH] Couple of fixes to presence space custom view scripts git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7478 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/presence/config.get.html.ftl | 16 +++++++++--- .../org/alfresco/presence/config.get.js | 11 ++++++-- .../org/alfresco/presence/status.get.html.ftl | 25 +++++++++++++------ .../org/alfresco/presence/status.get.js | 8 +++--- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/config/alfresco/templates/webscripts/org/alfresco/presence/config.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/presence/config.get.html.ftl index 1fd65886eb..83323ffede 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/presence/config.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/presence/config.get.html.ftl @@ -35,20 +35,28 @@ Space nodeRef:
e.g. "workspace://SpacesStore/e3741425-35cf-11dc-9762-4b73d0280543"
- + +<#if args.advanced?exists>
Webscript URL: +
- +<#else> + + +
- + +
-<#if args.n?exists> +<#if args.add?exists>
Aspect added to space.
+<#elseif args.remove?exists> +
Aspect removed from space.
\ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/presence/config.get.js b/config/alfresco/templates/webscripts/org/alfresco/presence/config.get.js index 5fc65fea3f..4cda81fa40 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/presence/config.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/presence/config.get.js @@ -1,7 +1,14 @@ if (args["n"] != null) { var dest = search.findNode(args["n"]); - dest.addAspect("cm:webscriptable"); - dest.properties["cm:webscript"] = args["w"]; + if (args["add"] != null) + { + dest.addAspect("cm:webscriptable"); + dest.properties["cm:webscript"] = args["w"]; + } + else + { + dest.removeAspect("cm:webscriptable"); + } dest.save(); } diff --git a/config/alfresco/templates/webscripts/org/alfresco/presence/status.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/presence/status.get.html.ftl index 4ca60a0ba7..46d0ea43f0 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/presence/status.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/presence/status.get.html.ftl @@ -1,3 +1,4 @@ +<#assign maxRecentDocs = 5>
Colleague Status
@@ -25,9 +26,9 @@
-
Recently created or modified documents
+
Recently created or modified documents<#if (maxRecentDocs != -1)>(showing ${maxRecentDocs} max.)
- +
@@ -35,14 +36,17 @@ <#assign rowNum=0> - <#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"] as child> + <#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"]?sort_by(['properties','cm:modified'])?reverse as child> <#if (dateCompare(child.properties["cm:modified"], date, 1000*60*60*24*7) == 1) || (dateCompare(child.properties["cm:created"], date, 1000*60*60*24*7) == 1)> <#assign rowNum = rowNum + 1> + <#if ((maxRecentDocs != -1) && (rowNum > maxRecentDocs))> + <#break> + - - - + + + @@ -116,7 +120,7 @@ { background-image: url(${url.context}/images/icons/presence_yahoo_offline.png) !important; } -.presenceStatus.unknown +.presenceStatus.unknown, .presenceStatus.skype-unknown, .presenceStatus.yahoo-unknown { background-image: url(${url.context}/images/icons/presence_status_unknown.png) !important; } @@ -140,6 +144,13 @@ float: left; } +.recentDocsTitleExtra +{ + font-size: small; + font-style: italic; + margin-left: 0.5em; +} + #recentDocsContainer { float: left; diff --git a/config/alfresco/templates/webscripts/org/alfresco/presence/status.get.js b/config/alfresco/templates/webscripts/org/alfresco/presence/status.get.js index de4e8ca25e..95ce6bbab2 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/presence/status.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/presence/status.get.js @@ -29,12 +29,12 @@ function parsePermissions(space) tokens = perm.split(";"); if (tokens[0] == "ALLOWED") { - if (("CollaboratorContributorCoordinatorEditor").indexOf(tokens[2]) != -1) + if (("AllCollaboratorContributorCoordinatorEditor").indexOf(tokens[2]) != -1) { user = people.getPerson(tokens[1]); if (user != null) { - pushUnique(results, user, presence.getDetails(user)); + pushUnique(user, presence.getDetails(user)); } else { @@ -43,7 +43,7 @@ function parsePermissions(space) { for each(user in people.getMembers(group)) { - pushUnique(results, user, presence.getDetails(user)); + pushUnique(user, presence.getDetails(user)); } } } @@ -56,7 +56,7 @@ function parsePermissions(space) } } -function pushUnique(results, user, details) +function pushUnique(user, details) { var provider = String(details).split("|")[0]; if (provider == "null")
NameModified Date
*${child.properties.name}${child.properties["cm:created"]?datetime}${child.properties["cm:modified"]?datetime} ${child.properties.name}    ${child.properties["cm:created"]?datetime}    ${child.properties["cm:modified"]?datetime}