MyTasks template task transition commands now refesh page and set status message on complete.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5608 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-05-03 15:50:42 +00:00
parent 52950cfcfb
commit ae8c4f9bb5
2 changed files with 34 additions and 5 deletions

View File

@@ -69,7 +69,7 @@
<#else> <#else>
</div><div class="taskItem"> </div><div class="taskItem">
</#if> </#if>
${t.description?html} [${t.name?html}] ${t.description?html} (${t.type?html})
<#if hasDue> <#if hasDue>
(Due: ${due?date}) (Due: ${due?date})
</#if> </#if>
@@ -88,13 +88,13 @@
<tr><td class="taskMetaprop">Complete:</td><td class="taskMetadata">${t.properties["bpm:percentComplete"]}%</td> <tr><td class="taskMetaprop">Complete:</td><td class="taskMetadata">${t.properties["bpm:percentComplete"]}%</td>
</table> </table>
</div> </div>
<div class="taskResourceHeader">Resources:</div> <div class="taskResourceHeader">${t.name?html}:</div>
<div class="taskResources"></div> <div class="taskResources"></div>
<div> <div>
<table class="taskActions" style="padding-left:16px"> <table class="taskActions" style="padding-left:16px">
<tr> <tr>
<#list t.transitions as wt> <#list t.transitions as wt>
<td><a class="taskAction" href="${url.context}/command/task/end/${t.id}/${wt.id}">${wt.label}</a></td> <td><a class="taskAction" href="#" onclick="MyTasks.transitionTask('/command/task/end/${t.id}/${wt.id}', '${url.service}?f=${filter}', 'Workflow action \'${t.type?html}\' completed.');">${wt.label}</a></td>
</#list> </#list>
</tr> </tr>
</table> </table>
@@ -110,7 +110,7 @@
<tr> <tr>
<td bgcolor="#F9F3B0">&nbsp;</td> <td bgcolor="#F9F3B0">&nbsp;</td>
<td> <td>
<div class="taskFooter"> <div id="taskFooter">
Showing ${count} <#if filter=4>overdue</#if> task(s)<#if filter=1> due today</#if><#if filter=2> due next week</#if><#if filter=3> with no due date set</#if>. Showing ${count} <#if filter=4>overdue</#if> task(s)<#if filter=1> due today</#if><#if filter=2> due next week</#if><#if filter=3> with no due date set</#if>.
</div> </div>
</td> </td>
@@ -123,6 +123,9 @@
</tr> </tr>
</table> </table>
<#-- display status message if provided -->
<#if args.m?exists><script>window.addEvent('load', MyTasks.displayMessage("${args.m}"));</script></#if>
<STYLE type="text/css"> <STYLE type="text/css">
a.filterLink:link, a.filterLink:visited a.filterLink:link, a.filterLink:visited
{ {
@@ -173,7 +176,7 @@ a.filterLinkSelected:link, a.filterLinkSelected:visited
border-top: 1px solid #FEF8BC; border-top: 1px solid #FEF8BC;
} }
.taskFooter #taskFooter
{ {
width: 700px; width: 700px;
padding: 8px; padding: 8px;

View File

@@ -233,6 +233,32 @@ var MyTasks = {
}); });
fxInfo.start(animInfo); fxInfo.start(animInfo);
}); });
},
transitionTask: function(tUrl, rUrl, successMessage)
{
YAHOO.util.Connect.asyncRequest(
"GET",
getContextPath() + tUrl,
{
success: function(response)
{
window.location.href = rUrl + "&_rand=" + Math.floor(Math.random()*99999) +
"&" + "m=" + successMessage;
},
failure: function(e)
{
alert(e.status + " : ERROR failed to transition task.");
window.location.href = rUrl + "&_rand=" + Math.floor(Math.random()*99999);
}
}
);
},
displayMessage: function(message)
{
var footer = $('taskFooter');
footer.innerHTML = message + ' ' + footer.innerHTML
} }
}; };