diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 18a35f4280..b7b155a250 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -1352,10 +1352,13 @@ task_properties=Task Properties task_pooled_properties=Task Pool task_type=Task Type id=Id +owner=Owner status=Status completed=Completed source=Source priority=Priority +tasks_active_title=All Active Tasks +tasks_active_desc=List of active tasks still to complete my_tasks_todo_title=My Tasks To Do my_tasks_todo_desc=List of your tasks still to complete my_tasks_completed_title=My Completed Tasks diff --git a/config/alfresco/web-client-config.xml b/config/alfresco/web-client-config.xml index 2eb4a96783..16f6207fae 100644 --- a/config/alfresco/web-client-config.xml +++ b/config/alfresco/web-client-config.xml @@ -215,6 +215,8 @@ + diff --git a/source/java/org/alfresco/web/bean/workflow/WorkflowBean.java b/source/java/org/alfresco/web/bean/workflow/WorkflowBean.java index 1a3293dca9..5875cfe0d5 100644 --- a/source/java/org/alfresco/web/bean/workflow/WorkflowBean.java +++ b/source/java/org/alfresco/web/bean/workflow/WorkflowBean.java @@ -39,6 +39,7 @@ import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.workflow.WorkflowService; import org.alfresco.service.cmr.workflow.WorkflowTask; import org.alfresco.service.cmr.workflow.WorkflowTaskDefinition; +import org.alfresco.service.cmr.workflow.WorkflowTaskQuery; import org.alfresco.service.cmr.workflow.WorkflowTaskState; import org.alfresco.service.cmr.workflow.WorkflowTransition; import org.alfresco.service.namespace.QName; @@ -66,6 +67,7 @@ public class WorkflowBean protected NodeService nodeService; protected WorkflowService workflowService; protected List tasks; + protected List activeTasks; protected List pooledTasks; protected List completedTasks; @@ -77,6 +79,55 @@ public class WorkflowBean // ------------------------------------------------------------------------------ // Bean Getters and Setters + /** + * Returns a list of nodes representing the "all" active tasks. + * + * @return List of all active tasks + */ + public List getAllActiveTasks() + { + if (this.activeTasks == null) + { + // get the current username + FacesContext context = FacesContext.getCurrentInstance(); + User user = Application.getCurrentUser(context); + String userName = user.getUserName(); + + UserTransaction tx = null; + try + { + tx = Repository.getUserTransaction(context, true); + tx.begin(); + + // query for all active tasks + WorkflowTaskQuery query = new WorkflowTaskQuery(); + List tasks = this.workflowService.queryTasks(query); + + // create a list of transient nodes to represent + this.activeTasks = new ArrayList(tasks.size()); + for (WorkflowTask task : tasks) + { + Node node = createTask(task); + this.activeTasks.add(node); + + if (logger.isDebugEnabled()) + logger.debug("Added active task: " + node); + } + + // commit the changes + tx.commit(); + } + catch (Throwable e) + { + // rollback the transaction + try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} + Utils.addErrorMessage("Failed to get all active tasks: " + e.toString(), e); + } + } + + return this.activeTasks; + } + /** * Returns a list of nodes representing the "pooled" to do tasks the * current user has. diff --git a/source/web/jsp/workflow/tasks-active-dashlet.jsp b/source/web/jsp/workflow/tasks-active-dashlet.jsp new file mode 100644 index 0000000000..e6f5ba69d4 --- /dev/null +++ b/source/web/jsp/workflow/tasks-active-dashlet.jsp @@ -0,0 +1,103 @@ +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + + + + + + <%-- Primary column for details view mode --%> + + + + + + + + + + + + + + + + + <%-- Task type --%> + + + + + + + + <%-- Task owner column --%> + + + + + + + + <%-- Task id column --%> + + + + + + + + <%-- Created Date column --%> + + + + + + + + + + <%-- Due date column --%> + + + + + + + + + + <%-- Status column --%> + + + + + + + + <%-- Priority column --%> + + + + + + + + <%-- Actions column --%> + + + + + + + + + \ No newline at end of file diff --git a/source/web/jsp/workflow/workitems-completed-dashlet.jsp b/source/web/jsp/workflow/workitems-completed-dashlet.jsp deleted file mode 100644 index 969aeb8bc8..0000000000 --- a/source/web/jsp/workflow/workitems-completed-dashlet.jsp +++ /dev/null @@ -1,76 +0,0 @@ -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - - - - <%-- Primary column for details view mode --%> - - - - - - - - - - - <%-- Task id column --%> - - - - - - - - <%-- Type column --%> - - - - - - - - <%-- Source column --%> - - - - - - - - <%-- Completed date column --%> - - - - - - - - - - <%-- Outcome column --%> - - - - - - - - <%-- Actions column --%> - - - - - - - - - - - \ No newline at end of file diff --git a/source/web/jsp/workflow/workitems-todo-dashlet.jsp b/source/web/jsp/workflow/workitems-todo-dashlet.jsp deleted file mode 100644 index 1bae631b80..0000000000 --- a/source/web/jsp/workflow/workitems-todo-dashlet.jsp +++ /dev/null @@ -1,92 +0,0 @@ -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - - - - <%-- Primary column for details view mode --%> - - - - - - - - - - - - - - - - - <%-- Task id column --%> - - - - - - - - <%-- Type column --%> - - - - - - - - <%-- Source column --%> - - - - - - - - <%-- Due date column --%> - - - - - - - - - - <%-- Status column --%> - - - - - - - - <%-- Priority column --%> - - - - - - - - <%-- Actions column --%> - - - - - - - - - - - \ No newline at end of file