Changeset 789 for branches


Ignore:
Timestamp:
Feb 7, 2011, 12:16:43 PM (9 years ago)
Author:
gav
Message:

Adjust pre-population of maintenanceActions when creating a new TaskProcedure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/features/taskProcedureRework/grails-app/controllers/TaskProcedureDetailedController.groovy

    r776 r789  
    163163        taskProcedureInstance.properties = params
    164164
    165         // Populate a maintenanceAction for each assembly.
     165        // Populate a couple of maintenanceActions for the first assembly.
    166166        def assemblies = assetService.getAssemblies(params.linkedTask.primaryAsset)
    167         assemblies.eachWithIndex { assembly, i ->
    168             def ma = taskProcedureInstance.maintenanceActionLazyList.get(i)
     167        if(assemblies) {
     168            def assembly = assemblies[0]
     169            def ma = taskProcedureInstance.maintenanceActionLazyList.get(0)
    169170            ma.assetSubItem = assembly
    170             ma.procedureStepNumber = (i+1)*10
     171            ma.procedureStepNumber = 10
     172            ma = taskProcedureInstance.maintenanceActionLazyList.get(1)
     173            ma.assetSubItem = assembly
     174            ma.procedureStepNumber = 20
    171175        }
    172176
Note: See TracChangeset for help on using the changeset viewer.