- Timestamp:
- Mar 16, 2011, 9:50:39 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/EntryDetailedController.groovy
r865 r873 113 113 def taskInstance = Task.read(params.taskId) 114 114 115 if(!taskInstance) {116 params.errorMessage = g.message(code:"default.not.found", args:['Task',params.taskId])117 render(contentType:"text/json", status: 403, template: "/shared/messages")118 return119 }120 121 // Check for Complete task.122 if(taskInstance.taskStatus.id == 3) {123 params.errorMessage = g.message(code:"task.operationNotPermittedOnCompleteTask")124 render(contentType:"text/json", status: 403, template: "/shared/messages")125 return126 }127 128 // Success.129 115 def entryInstance = new Entry() 130 116 entryInstance.task = taskInstance 131 117 entryInstance.entryType = EntryType.read(params.entryTypeId) 118 119 // Check if we should create this entry. 120 def checkResult = taskService.checkCreateEntry(entryInstance) 121 if(checkResult.error) { 122 params.errorMessage = g.message(code: checkResult.error.code) 123 render(contentType:"text/json", status: 403, template: "/shared/messages") 124 return 125 } 126 127 // Success. 132 128 def model = ['entryInstance': entryInstance] 133 129
Note: See TracChangeset
for help on using the changeset viewer.