mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
My Tasks improvements, fixes to webscript empty filter argument handling.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5581 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
27
config/alfresco/templates/client/task_resource_panel.ftl
Normal file
27
config/alfresco/templates/client/task_resource_panel.ftl
Normal file
@@ -0,0 +1,27 @@
|
||||
<table cellpadding='2' cellspacing='0'>
|
||||
<tr>
|
||||
<td>ICON</td>
|
||||
<td>Document NAME</td>
|
||||
<td>Something</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ICON</td>
|
||||
<td>Document NAME</td>
|
||||
<td>Something</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ICON</td>
|
||||
<td>Document NAME</td>
|
||||
<td>Something</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ICON</td>
|
||||
<td>Document NAME</td>
|
||||
<td>Something</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ICON</td>
|
||||
<td>Document NAME</td>
|
||||
<td>Something</td>
|
||||
</tr>
|
||||
</table>
|
@@ -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>
|
||||
<#if args.f?exists && args.f?length!=0><#assign filter=args.f?number><#else><#assign filter=0></#if>
|
||||
|
||||
<#-- get the path location from the passed in args -->
|
||||
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||
|
@@ -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>
|
||||
<#if args.f?exists && args.f?length!=0><#assign filter=args.f?number><#else><#assign filter=0></#if>
|
||||
|
||||
<table border=0 cellspacing=0 cellpadding=0 class="taskTable">
|
||||
<tr>
|
||||
@@ -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>
|
||||
<div class="taskRow">
|
||||
<div class="taskRow" id="${t.id}">
|
||||
<div class="taskTitle">
|
||||
<div class="taskIndicator">
|
||||
<#if hasDue>
|
||||
@@ -94,13 +94,22 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="taskDetail">
|
||||
<table cellpadding='2' cellspacing='0' style="margin-left:32px;">
|
||||
<tr><td class="taskMetadata">Type:</td><td class="taskMetadata">${t.type?html}</td></tr>
|
||||
<tr><td class="taskMetadata">Start Date:</td><td class="taskMetadata">${t.startDate?date}</td></tr>
|
||||
<tr><td class="taskMetadata">Priority:</td><td class="taskMetadata">${t.properties["bpm:priority"]}</td>
|
||||
<tr><td class="taskMetadata">Status:</td><td class="taskMetadata">${t.properties["bpm:status"]}</td>
|
||||
<tr><td class="taskMetadata">Percent Complete:</td><td class="taskMetadata">${t.properties["bpm:percentComplete"]}%</td>
|
||||
</table>
|
||||
<div style="float:left">
|
||||
<table cellpadding='2' cellspacing='0' style="margin-left:32px;margin-top:20px">
|
||||
<tr><td class="taskMetaprop">Status:</td><td class="taskMetadata">${t.properties["bpm:status"]}</td>
|
||||
<tr><td class="taskMetaprop">Priority:</td><td class="taskMetadata">${t.properties["bpm:priority"]}</td>
|
||||
<tr><td class="taskMetaprop">Start Date:</td><td class="taskMetadata">${t.startDate?date}</td></tr>
|
||||
<tr><td class="taskMetaprop">Type:</td><td class="taskMetadata">${t.type?html}</td></tr>
|
||||
<tr><td class="taskMetaprop">Complete:</td><td class="taskMetadata">${t.properties["bpm:percentComplete"]}%</td>
|
||||
</table>
|
||||
</div>
|
||||
<div class="taskResourceHeader">Resources:</div>
|
||||
<div class="taskResources"></div>
|
||||
<div>
|
||||
<table class="taskActions" style="padding-left:16px">
|
||||
<tr><td>Approve</td><td style="padding-left:64px">Reject</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</#if>
|
||||
@@ -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);
|
||||
|
@@ -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.
|
||||
* <p>
|
||||
* The result is the formatted HTML to show on the client.
|
||||
@@ -85,6 +85,35 @@ public class TaskInfoBean
|
||||
out.write("<span class='errorMessage'>Task could not be found.</span>");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the resource list for the workflow task identified by the 'taskId'
|
||||
* parameter found in the ExternalContext.
|
||||
* <p>
|
||||
* 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("<span class='errorMessage'>Task could not be found.</span>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user