Ignore:
Timestamp:
Mar 9, 2009, 10:31:40 AM (16 years ago)
Author:
gav
Message:

Add TaskPriority? and TaskType? domains, generate views and controllers.
Tweak security extensively.
Use 'extend BaseController?' to pass ROLE_USER to most controllers.
Add parentTask and subTask to Task Domain.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/TaskRewrite/src/grails-app/conf/BootStrap.groovy

    r66 r69  
    121121        personInstance.addToPersonGroups(PersonGroup.findByName("Production"))
    122122
    123         //TaskStatus
    124         def taskStatusInstance
    125    
    126         taskStatusInstance = new TaskStatus(name:"Not Started")
    127         BootStrapSaveAndTest(taskStatusInstance)
    128 
    129         taskStatusInstance = new TaskStatus(name:"In Progress")
    130         BootStrapSaveAndTest(taskStatusInstance)
    131 
    132         taskStatusInstance = new TaskStatus(name:"Completed")
    133         BootStrapSaveAndTest(taskStatusInstance)
    134 
    135123        //TaskGroup
    136124        def taskGroupInstance
     
    144132        BootStrapSaveAndTest(taskGroupInstance)
    145133
    146         taskGroupInstance = new TaskGroup(name:"NewProject(s)",
     134        taskGroupInstance = new TaskGroup(name:"New Projects",
    147135                      description:" ")
    148136        BootStrapSaveAndTest(taskGroupInstance)
    149137
     138        //TaskStatus
     139        def taskStatusInstance
     140   
     141        taskStatusInstance = new TaskStatus(name:"Not Started")
     142        BootStrapSaveAndTest(taskStatusInstance)
     143
     144        taskStatusInstance = new TaskStatus(name:"In Progress")
     145        BootStrapSaveAndTest(taskStatusInstance)
     146
     147        taskStatusInstance = new TaskStatus(name:"Completed")
     148        BootStrapSaveAndTest(taskStatusInstance)
     149
     150        //TaskPriority
     151        def taskPriorityInstance
     152
     153        taskPriorityInstance = new TaskPriority(name:"Low")
     154        BootStrapSaveAndTest(taskPriorityInstance)
     155
     156        taskPriorityInstance = new TaskPriority(name:"Normal")
     157        BootStrapSaveAndTest(taskPriorityInstance)
     158
     159        taskPriorityInstance = new TaskPriority(name:"High")
     160        BootStrapSaveAndTest(taskPriorityInstance)
     161
     162        taskPriorityInstance = new TaskPriority(name:"Immediate")
     163        BootStrapSaveAndTest(taskPriorityInstance)
     164
     165        //TaskType
     166        def taskTypeInstance
     167
     168        taskTypeInstance = new TaskType(name:"Unscheduled Breakin")
     169        BootStrapSaveAndTest(taskTypeInstance)
     170
     171        taskTypeInstance = new TaskType(name:"Planned Maintenance")
     172        BootStrapSaveAndTest(taskTypeInstance)
     173
     174        taskTypeInstance = new TaskType(name:"Project")
     175        BootStrapSaveAndTest(taskTypeInstance)
     176
     177        taskTypeInstance = new TaskType(name:"Turnaround")
     178        BootStrapSaveAndTest(taskTypeInstance)
     179
     180        taskTypeInstance = new TaskType(name:"Production Run")
     181        BootStrapSaveAndTest(taskTypeInstance)
     182
    150183        //Task
    151184        def taskInstance
     185        def subTaskInstance
    152186
    153187        taskInstance = new Task(taskGroup:TaskGroup.findByName("Engineering Activites"),
    154188                 taskStatus:TaskStatus.findByName("Not Started"),
     189                 taskPriority:TaskPriority.get(2),
     190                 taskType:TaskType.get(1),
    155191                 leadPerson:Person.get(3),
    156192                 description:"Check specific level sensor",
     
    160196        taskInstance.addToAssignedPersons(Person.get(2))
    161197
     198        subTaskInstance = new Task(taskGroup:TaskGroup.findByName("Engineering Activites"),
     199                 taskStatus:TaskStatus.findByName("Not Started"),
     200                 taskPriority:TaskPriority.get(2),
     201                 taskType:TaskType.get(1),
     202                 leadPerson:Person.get(3),
     203                 description:"Some follow up work",
     204                 comment:"Some help required")
     205        BootStrapSaveAndTest(subTaskInstance)
     206        subTaskInstance.addToAssignedPersons(Person.get(1))
     207       
     208        //Add task 2 as a subTask of task 1.
     209        taskInstance.addToSubTasks(Task.get(2))
     210        subTaskInstance.parentTask = Task.get(1)
     211
    162212        taskInstance = new Task(taskGroup:TaskGroup.findByName("Production Activites"),
    163213                 taskStatus:TaskStatus.findByName("Not Started"),
     214                 taskPriority:TaskPriority.get(2),
     215                 taskType:TaskType.get(5),
    164216                 leadPerson:Person.get(5),
    165217                 description:"Production Report",
     
    167219        BootStrapSaveAndTest(taskInstance)
    168220
    169         taskInstance = new Task(taskGroup:TaskGroup.findByName("NewProject(s)"),
    170                  taskStatus:TaskStatus.findByName("Not Started"),
     221        taskInstance = new Task(taskGroup:TaskGroup.findByName("New Projects"),
     222                 taskStatus:TaskStatus.findByName("Not Started"),
     223                 taskPriority:TaskPriority.get(2),
     224                 taskType:TaskType.get(3),
    171225                 leadPerson:Person.get(1),
    172226                 description:"Make killer CMMS app",
     
    183237        BootStrapSaveAndTest(entryTypeInstance)
    184238
    185         entryTypeInstance = new EntryType(name:"Production Report")
     239        entryTypeInstance = new EntryType(name:"Production Note")
    186240        BootStrapSaveAndTest(entryTypeInstance)
    187241
Note: See TracChangeset for help on using the changeset viewer.