Ignore:
Timestamp:
Sep 1, 2009, 10:10:43 PM (15 years ago)
Author:
gav
Message:

Update to grails-1.1.1 release.
Fix WorkDone? and Fault entries not showing after update, now using criteria.
Work on TaskRecurringSchedule, add DateUtilService class, regenerate views to suite.
Finally have correct rollback behaviour on TaskRecurringSchedule? domain object updates by using transactions.
Added name to copyright since the license has no meaning without it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/TaskRecurringSchedule.groovy

    r136 r137  
    2323
    2424    static constraints = {
    25 //              startDate(validator: {return (it > new Date())})
    26         recurEvery(min:0, max:365)
     25        recurEvery(min:1, max:365)
    2726        taskDuration(min:0, max:365)
    2827        generateAhead(min:0, max:365)
     
    3534    }
    3635   
    37     //As of Grails 1.1 this does not fire/pass before validation.
    38     //But setting defaults above and placing this code here in the hope that this will be fixed in future versions.
     36    // As of Grails 1.1.1 this does not fire/pass before validation.
     37    // But setting some defaults above to pass validation and placing this code here
     38        // in the hope that this will be fixed in future versions.
    3939    def beforeInsert = {
    40         def now = new Date()
    41        
    4240        nextTargetStartDate = startDate
    43        
    44         //nextGenerationDate
     41        setNextGenerationDate()
     42        setNextTargetCompletionDate()
     43    }
     44   
     45    public void setNextGenerationDate() {
    4546        switch (generateAheadPeriod.period) {
    4647            case "Day(s)":
     
    6768                break
    6869        }
    69        
     70        def now = new Date()
    7071        if( nextGenerationDate < now) {nextGenerationDate = now}
    71        
    72         //nextTargetCompletionDate
     72    }
     73   
     74    public void setNextTargetCompletionDate() {
    7375        switch (taskDurationPeriod.period) {
    7476            case "Day(s)":
     
    9294                }
    9395                break
    94         default:
     96            default:
    9597                break
    9698        }
    97        
    9899    }
    99 
     100   
    100101}
    101102
Note: See TracChangeset for help on using the changeset viewer.