Ignore:
Timestamp:
Dec 3, 2009, 11:44:05 PM (10 years ago)
Author:
gav
Message:

Finishing touches to recurring tasks.

File:
1 edited

Legend:

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

    r207 r213  
    7474
    7575            if(result.taskRecurringScheduleInstance.nextTargetStartDate < dateUtilService.getToday())
    76                 return fail("nextTargetStartDate", "taskRecurring.nextTargetStartDate.NotInTheFuture")
     76                return fail("nextTargetStartDate", "taskRecurringSchedule.nextTargetStartDate.mayNotBePast")
    7777
    7878            taskInstance.taskRecurringSchedule = result.taskRecurringScheduleInstance
     
    115115            }
    116116
    117             result.taskRecurringScheduleInstance.validate()
     117            result.taskRecurringScheduleInstance.properties = params
    118118
    119             Date originalDate = result.taskRecurringScheduleInstance.nextTargetStartDate
    120             result.taskRecurringScheduleInstance.properties = params
    121             Date newDate = result.taskRecurringScheduleInstance.nextTargetStartDate
    122 
    123             // If user changes nextTargetStartDate then ensure it is in the future, otherwise it's ok to keep the original date.
    124             if(originalDate.getTime() != newDate.getTime())
    125             {
    126                 if(newDate < dateUtilService.getToday())
    127                     return fail("nextTargetStartDate", "taskRecurring.nextTargetStartDate.NotInTheFuture")
    128             }
     119            if(result.taskRecurringScheduleInstance.nextTargetStartDate < dateUtilService.getToday())
     120                return fail("nextTargetStartDate", "taskRecurringSchedule.nextTargetStartDate.mayNotBePast")
    129121
    130122            result.taskRecurringScheduleInstance.setNextGenerationDate()
Note: See TracChangeset for help on using the changeset viewer.