Changeset 833 for trunk/grails-app/controllers
- Timestamp:
- Mar 3, 2011, 12:24:01 PM (14 years ago)
- Location:
- trunk/grails-app/controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/EntryDetailedController.groovy
r826 r833 31 31 if(entryInstance) { 32 32 if(entryInstance.enteredBy.loginName == authService.currentUser.loginName) { 33 def taskI D= entryInstance.task.id33 def taskId = entryInstance.task.id 34 34 entryInstance.delete(flush:true) 35 35 flash.message = "Entry ${params.id} deleted" 36 redirect(controller: 'taskDetailed', action: 'show', id: taskI D)36 redirect(controller: 'taskDetailed', action: 'show', id: taskId) 37 37 } 38 38 else { … … 94 94 def ajaxCreate = { 95 95 if(!params.taskId || !params.entryTypeId) { 96 flash.message = g.message(code:"entry.create.no.params") 97 redirect(controller:"taskDetailed", action:"search") 96 response.status = 403 97 params.errorMessage = g.message(code: "entry.create.no.params.ajax") 98 render(template: "/shared/messages") 98 99 return 99 100 } … … 102 103 103 104 if(!taskInstance) { 104 flash.message = g.message(code:"task.notFound") 105 redirect(controller:"taskDetailed", action:"search") 105 response.status = 403 106 params.errorMessage = g.message(code:"default.not.found", args:['Task',params.taskId]) 107 render(template: "/shared/messages") 106 108 return 107 109 } … … 109 111 // Check for Complete task. 110 112 if(taskInstance.taskStatus.id == 3) { 111 flash.errorMessage = g.message(code:"task.operationNotPermittedOnCompleteTask") 112 redirect(controller:"taskDetailed", action:"show", id: taskInstance.id) 113 response.status = 403 114 params.errorMessage = g.message(code:"task.operationNotPermittedOnCompleteTask") 115 render(template: "/shared/messages") 113 116 return 114 117 } 115 118 119 // Success. 116 120 def entryInstance = new Entry() 117 121 entryInstance.task = taskInstance … … 119 123 render(template: "create", model: ['entryInstance': entryInstance]) 120 124 } 125 126 def ajaxSave = { 127 def result = taskService.saveEntry(params) 128 129 // Success. 130 if(!result.error) { 131 def entryList = Entry.withCriteria { 132 eq("entryType", result.entryInstance.entryType) 133 task { 134 idEq(result.taskId) 135 } 136 } 137 render(template: "list", model: ['entryList': entryList]) 138 return 139 } 140 141 if(result.error.code != "default.create.failure") { 142 response.status = 403 143 params.errorMessage = g.message(code: result.error.code) 144 render(template: "/shared/messages") 145 return 146 } 147 148 response.status = 403 149 render(template: "create", model: ['entryInstance': result.entryInstance]) 150 } // ajaxSave 121 151 122 152 def create = { -
trunk/grails-app/controllers/TaskDetailedController.groovy
r809 r833 424 424 } 425 425 426 def entryPMList = Entry.withCriteria { 427 eq("entryType", EntryType.get(6)) 428 eq("task", taskInstance) 429 } 430 426 431 def subTaskInstanceList = Task.findAllByParentTaskAndTrash(taskInstance, false, params) 427 432 def subTaskInstanceTotal = Task.countByParentTaskAndTrash(taskInstance, false) … … 450 455 entryCauseList: entryCauseList, 451 456 entryWorkDoneList: entryWorkDoneList, 457 entryPMList: entryPMList, 452 458 taskProcedureRevision: taskProcedureRevision, 453 459 taskProcedureExits: taskProcedureExits,
Note: See TracChangeset
for help on using the changeset viewer.