mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
98197: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud) 98079: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2) 97973: Merged NESS/4.2.N-2015-02-10 (4.2.5) to V4.2-BUG-FIX (4.2.5) 97883: MNT-13331 : Unfriendly error displayed to user while trying to complete a task once more - added check on task status in workflow/TaskFormPersister.java; - added localization for the error message in workflow/workflow-messages.properties; - added js condition to display a friendly error message in alfresco.js 97924: MNT-13331 : Unfriendly error displayed to user while trying to complete a task once more git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@98321 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
46a73e07e5
commit
28eca9cea1
@ -229,3 +229,5 @@ listconstraint.wf_reviewOutcomeOptions.Reject=Reject
|
||||
workflowtask.outcome.Approve=Approved
|
||||
workflowtask.outcome.Reject=Rejected
|
||||
|
||||
workflowtask.already.done.error=This task has already been completed and is no longer editable.
|
||||
|
||||
|
@ -22,6 +22,7 @@ package org.alfresco.repo.forms.processor.workflow;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.forms.FormData.FieldData;
|
||||
import org.alfresco.repo.forms.processor.node.ContentModelItemData;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
@ -33,6 +34,7 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowTask;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowTaskState;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
@ -59,6 +61,12 @@ public class TaskFormPersister extends ContentModelFormPersister<WorkflowTask>
|
||||
super(itemData, namespaceService, dictionaryService, logger);
|
||||
WorkflowTask item = itemData.getItem();
|
||||
|
||||
// make sure that the task is not already completed
|
||||
if (item.getState().equals(WorkflowTaskState.COMPLETED))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("workflowtask.already.done.error");
|
||||
}
|
||||
|
||||
// make sure the current user is able to edit the task
|
||||
if (!workflowService.isTaskEditable(item, authenticationService.getCurrentUserName()))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user