Changeset 515 for trunk/grails-app


Ignore:
Timestamp:
Apr 30, 2010, 3:41:32 AM (15 years ago)
Author:
gav
Message:

Default task dates to today when manually creating a sub task.

File:
1 edited

Legend:

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

    r514 r515  
    1010
    1111    def authService
     12    def dateUtilService
    1213    def assignedGroupService
    1314    def assignedPersonService
     
    167168    /**
    168169    * Creates a subTask copying sane attributes from the parentTask unless otherwise specified in params.
     170    * The targetStartDate and targetCompletionDate default to today since that is the sane thing to do.
    169171    * The taskProcedure is only assigned to the sub task if supplied in params.
    170172    * The assignedPersons and assignedGroups are only added to the sub task if supplied in params.
    171173    * Collections in params must be supplied as new ArrayList's.
    172174    * This method is not intended to be a copyTask method.
    173     * There should be no reason to copy tasks, try to find a better solution.
     175    * There should be no reason to copy tasks, recurrence can be used to create similar tasks.
    174176    * @param parentTask The parent task to get attributes from, also set as the parent.
    175177    * @param params Overrides the parent task values if specified.
     
    185187        p.description = params.description ?: parentTask.description
    186188        p.comment = params.comment ?: parentTask.comment
    187         p.targetStartDate = params.targetStartDate ?: parentTask.targetStartDate
    188         p.targetCompletionDate = params.targetCompletionDate ?: parentTask.targetCompletionDate
     189        p.targetStartDate = params.targetStartDate ?: dateUtilService.today
     190        p.targetCompletionDate = params.targetCompletionDate ?: dateUtilService.today
    189191        p.scheduled = params.scheduled ?:  parentTask.scheduled
    190192
Note: See TracChangeset for help on using the changeset viewer.