Ignore:
Timestamp:
Jun 20, 2010, 2:28:29 PM (15 years ago)
Author:
gav
Message:

Add default.please.select.text and default.none.select.text messages.
Update Task views and service to use new messages.

File:
1 edited

Legend:

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

    r592 r601  
    9797            }
    9898
    99             // Default status to "not started" if not supplied.
    100             params.taskStatus = params.taskStatus ?: TaskStatus.get(1)
    101 
    102             // Set budgetStatus.
    103             if(params.taskType?.id?.toLong() == 1 || params.taskType?.id?.toLong() == 2) // Immediate Callout or Unsheduled Breakin.
    104                 params.taskBudgetStatus = params.taskBudgetStatus ?: TaskBudgetStatus.get(1) // Unplanned.
    105             else
    106                 params.taskBudgetStatus = params.taskBudgetStatus ?: TaskBudgetStatus.get(2) // Planned.
    107 
    10899            def taskInstance = new Task(params)
    109100            result.taskInstance = taskInstance
     101
     102            // Set taskStatus if not supplied.
     103            if(!params.taskStatus)
     104                taskInstance.taskStatus = TaskStatus.read(1) // Not Started
     105
     106            // Set budgetStatus if not supplied.
     107            if(!params.taskBudgetStatus) {
     108                if(taskInstance.taskType?.id == 1 || taskInstance.taskType?.id == 2) // Immediate Callout or Unsheduled Breakin.
     109                    taskInstance.taskBudgetStatus = TaskBudgetStatus.read(1) // Unplanned.
     110                else
     111                    taskInstance.taskBudgetStatus = TaskBudgetStatus.read(2) // Planned.
     112            }
    110113
    111114            if(result.taskInstance.parentTask?.trash)
Note: See TracChangeset for help on using the changeset viewer.