From c05c6a253f77b1b4d54ad3e9c9cd391052255c63 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Wed, 30 May 2007 09:35:20 +0000 Subject: [PATCH] MyTasks portlet improvements and fixes: - Inner panel of MyTasks portlet now a separate webscript called 'mytaskspanel' and an ajax request is used to refresh or update the panel after an action occurs. - Generated task actions fixed to use ajax refresh rather than full window refresh (fixes issue with MyTasks portlet actions being used in JSF-168 or JSF runtime) - Generated task actions fixed to handle default (null) transition ID Permission checking added to MySpaces portlet actions. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5808 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../client/myspaces_preview_panel.ftl | 4 +- .../alfresco/portlets/myspaces.get.html.ftl | 4 +- .../alfresco/portlets/mytasks.get.html.ftl | 88 +++++-------------- .../portlets/mytaskspanel.get.desc.xml | 7 ++ .../portlets/mytaskspanel.get.html.ftl | 67 ++++++++++++++ source/web/scripts/ajax/myspaces.js | 4 +- source/web/scripts/ajax/mytasks.js | 61 +++++++++++-- 7 files changed, 154 insertions(+), 81 deletions(-) create mode 100644 config/alfresco/templates/webscripts/org/alfresco/portlets/mytaskspanel.get.desc.xml create mode 100644 config/alfresco/templates/webscripts/org/alfresco/portlets/mytaskspanel.get.html.ftl diff --git a/config/alfresco/templates/client/myspaces_preview_panel.ftl b/config/alfresco/templates/client/myspaces_preview_panel.ftl index e5f913203c..328dfbb74a 100644 --- a/config/alfresco/templates/client/myspaces_preview_panel.ftl +++ b/config/alfresco/templates/client/myspaces_preview_panel.ftl @@ -33,13 +33,13 @@ View Content - Delete + onclick='event.cancelBubble=true;MySpaces.deleteItem("${node.name}", "${node.nodeRef}");'>Delete More Actions... <#else> Edit Details - Delete + onclick='event.cancelBubble=true;MySpaces.deleteItem("${node.name}", "${node.nodeRef}");'>Delete More Actions... diff --git a/config/alfresco/templates/webscripts/org/alfresco/portlets/myspaces.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/portlets/myspaces.get.html.ftl index 00344c5e62..7a8386e57a 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/portlets/myspaces.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/portlets/myspaces.get.html.ftl @@ -54,14 +54,14 @@
<#-- TODO: permission checks on the actions! --> <#-- Upload File action --> -
Upload
+
onclick="MySpaces.upload(this);">Upload
<#-- Url encode the path value, and encode any single quotes to generate valid string -->
<#-- Create Space action --> -
Create Space
+
onclick="MySpaces.createSpace(this);">Create Space
diff --git a/config/alfresco/templates/webscripts/org/alfresco/portlets/mytasks.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/portlets/mytasks.get.html.ftl index c7faf2829d..96ec4e2189 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/portlets/mytasks.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/portlets/mytasks.get.html.ftl @@ -34,71 +34,11 @@
Name:
  +
- <#assign weekms=1000*60*60*24*7> - <#assign count=0> - <#list workflow.assignedTasks?sort_by('startDate') as t> - <#-- TODO: is it better to use a js script to pre-filter the list? --> - <#assign hasDue=t.properties["bpm:dueDate"]?exists> - <#if hasDue> - <#assign due=t.properties["bpm:dueDate"]> - - <#if (filter=0) || - (filter=3 && !hasDue) || - (filter=1 && hasDue && (dateCompare(date?date, due?date, 0, "==") == 1)) || - (filter=2 && hasDue && (dateCompare(due?date, date?date) == 1 && dateCompare(date?date, due?date, weekms) == 1)) || - (filter=4 && hasDue && (dateCompare(date?date, due?date) == 1))> - <#assign count=count+1> -
-
-
- <#if hasDue> - <#-- items due today? --> - <#if (filter=0 || filter=1) && (dateCompare(date?date, due?date, 0, "==") == 1)> -
- <#-- items overdue? --> - <#elseif (filter=0 || filter=4) && (dateCompare(date?date, due?date) == 1)> -
- <#else> -
- - <#else> -
- - ${t.description?html} (${t.type?html}) - <#if hasDue> - (Due: ${due?date}) - - - - -
-
-
-
- - - - - - -
Status:
Priority:
Start Date:
Type:
Complete:
-
-
${t.name?html}:
-
-
- - - <#list t.transitions as wt> - - - -
${wt.label?html}
-
-
-
- - + <#-- populated via an AJAX call to 'mytaskspanel' webscript --> + <#-- resolved filter required as argument --> +
@@ -107,7 +47,8 @@  
- Showing ${count} <#if filter=4>overdue task(s)<#if filter=1> due today<#if filter=2> due next week<#if filter=3> with no due date set. + <#-- the count value is retrieved and set dynamically from the AJAX webscript output above --> + Showing 0 <#if filter=4>overdue task(s)<#if filter=1> due today<#if filter=2> due next week<#if filter=3> with no due date set.
@@ -119,9 +60,6 @@
-<#-- display status message if provided --> -<#if args.m?exists> -