Changeset 179 for trunk/grails-app
- Timestamp:
- Nov 3, 2009, 5:58:21 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/TaskDetailedController.groovy
r178 r179 165 165 } 166 166 else { 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 167 params.max = 10 168 params.order = "desc" 169 params.sort = "id" 170 171 def entryWorkDoneList = Entry.withCriteria { 172 def entryType = EntryType.findByName("WorkDone") 173 eq("entryType", entryType) 174 eq("task", taskInstance) 175 } 176 177 def entryFaultList = Entry.withCriteria { 178 def entryType = EntryType.findByName("Fault") 179 eq("entryType", entryType) 180 eq("task", taskInstance) 181 } 182 183 def subTaskInstanceList = Task.findAllByParentTask(taskInstance, params) 184 def subTaskInstanceTotal = Task.countByParentTask(taskInstance) 185 185 def showTaskTab = new String("true") 186 186 … … 202 202 taskRecurringScheduleExits = false 203 203 } 204 204 205 205 return [ taskInstance: taskInstance, 206 207 206 entryWorkDoneList: entryWorkDoneList, 207 entryFaultList: entryFaultList, 208 208 taskProcedureInstance: taskProcedureInstance, 209 209 taskProcedureExits: taskProcedureExits, 210 210 showTaskTab: showTaskTab, 211 212 213 214 215 216 211 subTaskInstanceList: subTaskInstanceList, 212 subTaskInstanceTotal: subTaskInstanceTotal, 213 subTaskInstanceMax: params.max, 214 maintenanceActionList: maintenanceActionList, 215 taskRecurringScheduleInstance: taskRecurringScheduleInstance, 216 taskRecurringScheduleExits: taskRecurringScheduleExits, 217 217 inventoryMovementList: inventoryMovementList] 218 218 } … … 268 268 def version = params.version.toLong() 269 269 if(taskInstance.version > version) { 270 270 271 271 taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.") 272 272 render(view:'edit',model:[taskInstance:taskInstance]) … … 305 305 } 306 306 } 307 308 309 310 307 308 def listSubTasks = { 309 def parentTaskInstance = Task.get(params.id) 310 311 311 if(!parentTaskInstance) { 312 312 flash.message = "Task not found with id ${params.id}" … … 314 314 } 315 315 else { 316 317 318 319 316 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 317 def subTaskInstanceList = Task.findAllByParentTask(parentTaskInstance, params) 318 def subTaskInstanceTotal = Task.countByParentTask(parentTaskInstance) 319 320 320 [ taskInstanceList: subTaskInstanceList, 321 322 323 324 325 321 taskInstanceTotal: subTaskInstanceTotal, 322 parentTaskInstance: parentTaskInstance] 323 } 324 } 325 326 326 }
Note: See TracChangeset
for help on using the changeset viewer.