source: trunk/grails-app/domain/Task.groovy @ 582

Last change on this file since 582 was 567, checked in by gav, 14 years ago

Domain change, remove scheduled attribute from Task.
Update views and logic to suite.

File size: 1.7 KB
Line 
1class Task {
2
3    TaskGroup taskGroup
4    TaskStatus taskStatus
5    TaskPriority taskPriority
6    TaskBudgetStatus taskBudgetStatus
7    TaskType taskType
8    Task parentTask
9    Person leadPerson
10    Site site
11    Section section
12    Asset primaryAsset
13    AssetSubItem assetSubItem
14    TaskRecurringSchedule taskRecurringSchedule
15    TaskProcedure taskProcedure
16
17    String description
18    String comment = ""
19    Date targetStartDate = new Date()
20    Date targetCompletionDate = new Date()
21    boolean approved = false
22    boolean trash = false
23    boolean attentionFlag = false
24
25    static hasMany = [entries: Entry,
26                        taskModifications: TaskModification,
27                        assignedGroups: AssignedGroup,
28                        assignedPersons: AssignedPerson,
29                        subTasks: Task,
30                        associatedAssets: Asset,
31                        inventoryMovements: InventoryMovement]
32
33    static mappedBy = [taskRecurringSchedule:"task"]
34
35    static belongsTo = [TaskGroup, TaskStatus, Task, Person]
36
37    static constraints = {
38        description(blank:false,maxSize:75)
39        comment(maxSize:1000)
40        targetStartDate()
41        targetCompletionDate(validator: {val, obj ->
42            if(val.before(obj.targetStartDate))
43                return 'before.targetStartDate'
44        })
45        leadPerson()
46        taskPriority()
47        taskBudgetStatus()
48        taskStatus()
49        parentTask(nullable:true)
50        site(nullable:true)
51        section(nullable:true)
52        primaryAsset(nullable:true)
53        assetSubItem(nullable:true)
54        taskRecurringSchedule(nullable:true)
55        taskProcedure(nullable:true)
56
57    }
58
59    String toString() {"${this.id} - ${this.description}"}
60}
Note: See TracBrowser for help on using the repository browser.