Changeset 776 for branches/features/taskProcedureRework/grails-app/controllers/TaskProcedureDetailedController.groovy
- Timestamp:
- Feb 4, 2011, 2:11:45 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/features/taskProcedureRework/grails-app/controllers/TaskProcedureDetailedController.groovy
r775 r776 5 5 6 6 def filterService 7 def assetService 7 8 def taskProcedureService 8 9 … … 94 95 } 95 96 else { 96 return [ taskProcedureInstance : taskProcedureInstance ] 97 def assemblies = assetService.getAssemblies(taskProcedureInstance.linkedTask.primaryAsset) 98 return [ taskProcedureInstance : taskProcedureInstance, 99 assemblies: assemblies ] 97 100 } 98 101 } … … 125 128 } 126 129 127 render(view:'edit', model:[taskProcedureInstance: result.taskProcedureInstance]) 130 def assemblies = assetService.getAssemblies(result.taskProcedureInstance.linkedTask.primaryAsset) 131 render(view:'edit', model:[taskProcedureInstance: result.taskProcedureInstance, 132 assemblies: assemblies]) 128 133 } 129 134 … … 157 162 def taskProcedureInstance = new TaskProcedure() 158 163 taskProcedureInstance.properties = params 159 return ['taskProcedureInstance':taskProcedureInstance] 164 165 // Populate a maintenanceAction for each assembly. 166 def assemblies = assetService.getAssemblies(params.linkedTask.primaryAsset) 167 assemblies.eachWithIndex { assembly, i -> 168 def ma = taskProcedureInstance.maintenanceActionLazyList.get(i) 169 ma.assetSubItem = assembly 170 ma.procedureStepNumber = (i+1)*10 171 } 172 173 return ['taskProcedureInstance':taskProcedureInstance, 'assemblies': assemblies] 160 174 } 161 175 … … 181 195 } 182 196 183 render(view:'create', model:[taskProcedureInstance: result.taskProcedureInstance]) 197 def assemblies = assetService.getAssemblies(result.taskProcedureInstance.linkedTask.primaryAsset) 198 render(view:'create', model:[taskProcedureInstance: result.taskProcedureInstance, 199 assemblies: assemblies]) 184 200 } 185 201
Note: See TracChangeset
for help on using the changeset viewer.