Changeset 478 for trunk/grails-app


Ignore:
Timestamp:
Apr 7, 2010, 5:37:40 PM (15 years ago)
Author:
gav
Message:

Setup approved and scheduled during subTask creation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/TaskService.groovy

    r433 r478  
    185185        p.targetStartDate = params.targetStartDate ?: parentTask.targetStartDate
    186186        p.targetCompletionDate = params.targetCompletionDate ?: parentTask.targetCompletionDate
     187        p.scheduled = params.scheduled ?:  parentTask.scheduled
    187188
    188189        p.taskGroup = params.taskGroup ?: parentTask.taskGroup
     
    194195        p.associatedAssets = params.associatedAssets ?: new ArrayList(parentTask.associatedAssets) // Collection.
    195196
    196         // Only if supplied, otherwise this would be copying.
    197         if(params.scheduled) p.scheduled = params.scheduled
    198         if(params.approved) p.approved = params.approved
    199 
    200197        // Supplied by recurring tasks.
    201198        if(params.taskProcedure) p.taskProcedure = params.taskProcedure
     
    210207        // Create the sub task and return the result.
    211208        result = save(p)
     209
     210        // Approve.
     211        if(!result.error && parentTask.approved) {
     212            p = [:]
     213            p.id = result.taskInstance.id
     214            approve(p)
     215        }
     216
     217        // Success.
     218        return result
    212219
    213220    } // end createSubTask()
Note: See TracChangeset for help on using the changeset viewer.