mirror of
				https://github.com/Alfresco/alfresco-community-repo.git
				synced 2025-10-29 15:21:53 +00:00 
			
		
		
		
	Merged 5.0.N (5.0.3) to 5.1.N (5.1.1) (PARTIAL MERGE)
112938 adavis: Merged V4.2-BUG-FIX (4.2.6) to 5.0.N (5.0.3)
      112693 nsmintanca: Merged NESS/4.2.N-2015-09-17 (4.2.6) to V4.2-BUG-FIX (4.2.6)
         112598: 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 condition to display a friendly error message in alfresco.js
            - referenced  current object to access its properties in task-edit-header.js
            - added noCache parameter to the URL to ensure that requests are always made to the server to update data at back action in data-loader.js
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@113040 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
			
			
This commit is contained in:
		| @@ -229,3 +229,4 @@ 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())) | ||||
|         { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user