diff --git a/config/alfresco/templates/client/task_resource_panel.ftl b/config/alfresco/templates/client/task_resource_panel.ftl new file mode 100644 index 0000000000..5a0baf4857 --- /dev/null +++ b/config/alfresco/templates/client/task_resource_panel.ftl @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ICONDocument NAMESomething
ICONDocument NAMESomething
ICONDocument NAMESomething
ICONDocument NAMESomething
ICONDocument NAMESomething
\ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/portlets/doclist_get_html.ftl b/config/alfresco/templates/webscripts/org/alfresco/portlets/doclist_get_html.ftl index 9f3415c857..e79f8aaed8 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/portlets/doclist_get_html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/portlets/doclist_get_html.ftl @@ -19,7 +19,7 @@ <#-- get the filter mode from the passed in args --> <#-- filters: 0=all, 1=word, 2=html, 3=pdf, 4=recent --> -<#if args.f?exists><#assign filter=args.f?number><#else><#assign filter=0> +<#if args.f?exists && args.f?length!=0><#assign filter=args.f?number><#else><#assign filter=0> <#-- get the path location from the passed in args --> <#if args.p?exists><#assign path=args.p><#else><#assign path=""> 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 60b9842fc2..f97bb4a5dd 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,7 +34,7 @@ <#-- get the filter mode from the passed in args --> <#-- filters: 0=all, 1=today, 2=next week, 3=no due date, 4=overdue --> -<#if args.f?exists><#assign filter=args.f?number><#else><#assign filter=0> +<#if args.f?exists && args.f?length!=0><#assign filter=args.f?number><#else><#assign filter=0> @@ -68,7 +68,7 @@ (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> @@ -94,13 +94,22 @@
-
- - - - - -
+
+ + + + + + +
Status:
Priority:
Start Date:
Type:
Complete:
+
+
Resources:
+
+
+ + +
ApproveReject
+
@@ -217,10 +226,10 @@ a.filterLinkSelected:link, a.filterLinkSelected:visited .taskDetail { + color: #5A5741; background-color: #DFC900; font-family: Trebuchet MS, Arial, Helvetica, sans-serif; font-size: 12px; - color: #000000; margin: 0px; display: none; overflow: hidden; @@ -233,12 +242,55 @@ a.filterLinkSelected:link, a.filterLinkSelected:visited border-top: 1px solid #82770B !important; } +.taskResources +{ + border-left: 1px solid #0092DD; + border-top: 1px solid #0092DD; + border-bottom: 1px solid #CCD4DB; + border-right: 1px solid #CCD4DB; + background-color: #F8FCFD; + margin: 4px 0px 0px 16px; + width: 400px; + height: 80px; + overflow: hidden; +} + +.taskResourceHeader +{ + color: #5A5741; + font-family: Trebuchet MS, Arial, Helvetica, sans-serif; + padding: 0px 0px 0px 16px; + font-weight: bold; + display: inline; +} + +.taskResources td +{ + color: #5A5741; + font-family: Trebuchet MS, Arial, Helvetica, sans-serif; +} + +.taskActions td +{ + color: #5A5741; + font-size: 14px; + font-weight: bold; + font-family: Trebuchet MS, Arial, Helvetica, sans-serif; +} + .taskMetadata { color: #5A5741; font-family: Trebuchet MS, Arial, Helvetica, sans-serif; } +.taskMetaprop +{ + color: #5A5741; + font-family: Trebuchet MS, Arial, Helvetica, sans-serif; + font-weight: bold; +} + .paperEdgeRight { background-image: url(../images/parts/paper_rightedge.png); diff --git a/source/java/org/alfresco/web/bean/ajax/TaskInfoBean.java b/source/java/org/alfresco/web/bean/ajax/TaskInfoBean.java index 43507a5d2d..edbe83a460 100644 --- a/source/java/org/alfresco/web/bean/ajax/TaskInfoBean.java +++ b/source/java/org/alfresco/web/bean/ajax/TaskInfoBean.java @@ -58,7 +58,7 @@ public class TaskInfoBean private WorkflowService workflowService; /** - * Returns information on the node identified by the 'taskId' + * Returns information for the workflow task identified by the 'taskId' * parameter found in the ExternalContext. *

* The result is the formatted HTML to show on the client. @@ -85,6 +85,35 @@ public class TaskInfoBean out.write("Task could not be found."); } } + + /** + * Returns the resource list for the workflow task identified by the 'taskId' + * parameter found in the ExternalContext. + *

+ * The result is the formatted HTML to show on the client. + */ + public void sendTaskResources() throws IOException + { + FacesContext context = FacesContext.getCurrentInstance(); + ResponseWriter out = context.getResponseWriter(); + + String taskId = (String)context.getExternalContext().getRequestParameterMap().get("taskId"); + if (taskId == null || taskId.length() == 0) + { + throw new IllegalArgumentException("'taskId' parameter is missing"); + } + + WorkflowTask task = this.workflowService.getTaskById(taskId); + if (task != null) + { + Repository.getServiceRegistry(context).getTemplateService().processTemplate( + "/alfresco/templates/client/task_resource_panel.ftl", getModel(task), out); + } + else + { + out.write("Task could not be found."); + } + } // ------------------------------------------------------------------------------ diff --git a/source/web/scripts/ajax/mytasks.js b/source/web/scripts/ajax/mytasks.js index e774220340..baf6ca65e8 100644 --- a/source/web/scripts/ajax/mytasks.js +++ b/source/web/scripts/ajax/mytasks.js @@ -14,16 +14,31 @@ var MyTasks = { var items = $$('#taskPanel .taskItem'); var infos = $$('#taskPanel .taskInfo'); var details = $$('#taskPanel .taskDetail'); + var resources = $$('#taskPanel .taskResources'); var fxInfo = new Fx.Elements(infos, {wait: false, duration: 500, transition: Fx.Transitions.linear}); - var fxDetail = new Fx.Elements(details, {wait: false, duration: 500, transition: Fx.Transitions.linear}); + var fxDetail = new Fx.Elements(details, {wait: false, duration: 500, transition: Fx.Transitions.linear, + onComplete: function() + { + // event handler to ensure + this.elements.each(function(detail, i) + { + if (detail.parentNode.isOpen == true) + { + detail.getElementsByTagName("div")[2].setStyle('overflow', 'auto'); + } + }); + } + }); tasks.each(function(task, i) { var item = items[i]; var info = infos[i]; var detail = details[i]; + var resource = resources[i]; // animated elements defaults task.isOpen = false; + task.loadingResources = false; item.defBColor = (item.getStyle('background-color') == 'transparent') ? '' : item.getStyle('background-color'); detail.defHeight = 0; detail.setStyle('opacity', 0); @@ -117,21 +132,41 @@ var MyTasks = { // flag this task as open task.isOpen = true; + if (task.loadingResources == false) + { + // ajax call to populate the task resource list + task.loadingResources = true; + YAHOO.util.Connect.asyncRequest( + "POST", + getContextPath() + '/ajax/invoke/TaskInfoBean.sendTaskResources', + { + success: function(response) + { + // set the resource list panel html + var resource = response.argument[0]; + resource.innerHTML = response.responseText; + }, + failure: handleErrorYahoo, // global error handler + argument: [resource] + }, + "taskId=" + task.id); + } + // fade in info button animInfo[i] = {'opacity': [infoOpacity, 1]}; // slide and fade in the details panel animDetail[i] = { - 'height': [detailHeight, detail.defHeight + 100], + 'height': [detailHeight, detail.defHeight + 140], 'opacity': [detail.getStyle('opacity'), 1]}; // close other open tasks and toggle this one if it's already open tasks.each(function(otherTask, j) { var otherItem = items[j], - otherInfo = infos[j], - otherDetail = details[j]; - + otherInfo = infos[j], + otherDetail = details[j]; + if (otherTask != task) { // close any other open tasks @@ -154,6 +189,8 @@ var MyTasks = { { animInfo[j] = {'opacity': [otherOpacity, 0]}; } + + otherDetail.getElementsByTagName("div")[2].setStyle('overflow', 'hidden'); } }); } @@ -170,6 +207,8 @@ var MyTasks = { animDetail[i] = { 'height': [detailHeight, detail.defHeight], 'opacity': [detail.getStyle('opacity'), 0]}; + + detail.getElementsByTagName("div")[2].setStyle('overflow', 'hidden'); } fxInfo.start(animInfo); fxDetail.start(animDetail);