Index: /trunk/grails-app/conf/Config.groovy
===================================================================
--- /trunk/grails-app/conf/Config.groovy	(revision 417)
+++ /trunk/grails-app/conf/Config.groovy	(revision 418)
@@ -104,4 +104,5 @@
             warn "grails.app.controller"
             info "grails.app.service.AssetCsvService"
+            info "grails.app.service.InventoryCsvService"
             break
     }
@@ -146,6 +147,6 @@
             [order:10, controller:'taskDetailed', title:'Search', action:'search', isVisible: { true }],
             [order:11, controller:'taskDetailed', title:'Calendar', action:'searchCalendar', isVisible: { true }],
-            [order:20, controller:'taskDetailed', title:'Create', action:'create', isVisible: { true }],
-            [order:30, controller:'taskDetailed', title:'Breakin', action:'createBreakin', isVisible: { true }],
+            [order:20, controller:'taskDetailed', title:'+Scheduled', action:'create', isVisible: { true }],
+            [order:30, controller:'taskDetailed', title:'+Callout', action:'createImmediateCallout', isVisible: { true }],
             [order:90, controller:'taskDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
             [order:91, controller:'taskDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
Index: /trunk/grails-app/controllers/TaskDetailedController.groovy
===================================================================
--- /trunk/grails-app/controllers/TaskDetailedController.groovy	(revision 417)
+++ /trunk/grails-app/controllers/TaskDetailedController.groovy	(revision 418)
@@ -14,14 +14,10 @@
 
     // these actions only accept POST requests
-    static allowedMethods = [save:'POST', update:'POST', restore:'POST', trash:'POST', approve:'POST', renegeApproval:'POST', complete:'POST', reopen:'POST']
+    static allowedMethods = [save:'POST',update:'POST',restore:'POST', trash:'POST',
+                                                approve:'POST', renegeApproval:'POST', complete:'POST',
+                                                reopen:'POST', setAttentionFlag:'POST', clearAttentionFlag:'POST']
 
     @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
     def index = { redirect(action: 'search', params: params) }
-
-    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
-    def list = {
-        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100 )
-        [ taskInstanceList: Task.list( params ), taskInstanceTotal: Task.count() ]
-    }
 
     @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
@@ -115,5 +111,5 @@
         filterParams.max = params.max
         filterParams.offset = params.offset?.toInteger() ?: 0
-        filterParams.sort = params.sort ?: "id"
+        filterParams.sort = params.sort ?: "attentionFlag"
         filterParams.order = params.order ?: "desc"
 
@@ -253,9 +249,4 @@
             params.sort = "id"
 
-            def entryWorkDoneList = Entry.withCriteria {
-                                                                eq("entryType", EntryType.get(2))
-                                                                eq("task", taskInstance)
-                                                        }
-
             def entryFaultList = Entry.withCriteria {
                                                                 eq("entryType", EntryType.get(1))
@@ -263,4 +254,14 @@
                                                         }
 
+            def entryCauseList = Entry.withCriteria {
+                                                                eq("entryType", EntryType.get(2))
+                                                                eq("task", taskInstance)
+                                                        }
+
+            def entryWorkDoneList = Entry.withCriteria {
+                                                                eq("entryType", EntryType.get(3))
+                                                                eq("task", taskInstance)
+                                                        }
+
             def subTaskInstanceList = Task.findAllByParentTaskAndTrash(taskInstance, false, params)
             def subTaskInstanceTotal = Task.countByParentTaskAndTrash(taskInstance, false)
@@ -290,6 +291,7 @@
 
             return [ taskInstance: taskInstance,
+                            entryFaultList: entryFaultList,
+                            entryCauseList: entryCauseList,
                             entryWorkDoneList: entryWorkDoneList,
-                            entryFaultList: entryFaultList,
                             taskProcedureInstance: taskProcedureInstance,
                             taskProcedureExits: taskProcedureExits,
@@ -308,35 +310,26 @@
     }
 
+    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
     def restore = {
 
-        if(!Task.exists(params.id)) {
-            flash.message = "Task not found with id ${params.id}"
-            redirect(action: 'search')
-        }
-
         def result = taskService.restore(params)
 
         if(!result.error) {
                 flash.message = "Task ${params.id} has been restored."
-                redirect(action: 'show', id: result.taskInstance.id)
-        }
-        else {
-            if(result.taskInstance) {
-                render(view:'edit',model:[taskInstance:result.taskInstance])
-            }
-            else {
-                flash.message = "Task could not be updated."
-                redirect(action: 'search')
-            }
-        }
-
-    }
-
+                redirect(action: show, id: params.id)
+                return
+        }
+
+        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        if(result.taskInstance)
+            redirect(action: show, id: params.id)
+        else
+            redirect(action: 'search')
+
+    }
+
+    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
     def trash = {
-
-        if(!Task.exists(params.id)) {
-            flash.message = "Task not found with id ${params.id}."
-            redirect(action: 'search')
-        }
 
         def result = taskService.trash(params)
@@ -345,64 +338,53 @@
                 flash.message = "Task ${params.id} has been moved to trash."
                 redirect(action: 'search')
-        }
-        else {
-            if(result.taskInstance) {
-                render(view:'edit',model:[taskInstance:result.taskInstance])
-            }
-            else {
-                flash.message = "Task could not be updated."
-                redirect(action: 'search')
-            }
-        }
-
-    }
-
+                return
+        }
+
+        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        if(result.taskInstance)
+            redirect(action: show, id: params.id)
+        else
+            redirect(action: 'search')
+
+    }
+
+    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager'])
     def approve = {
 
-        if(!Task.exists(params.id)) {
-            flash.message = "Task not found with id ${params.id}."
-            redirect(action: 'search')
-        }
-
         def result = taskService.approve(params)
 
         if(!result.error) {
                 flash.message = "Task ${params.id} has been approved."
-                redirect(action: 'show', id: result.taskInstance.id)
-        }
-        else {
-            if(result.taskInstance) {
-                render(view:'edit',model:[taskInstance:result.taskInstance])
-            }
-            else {
-                flash.message = "Task could not be updated."
-                redirect(action: 'search')
-            }
-        }
-
-    }
-
+                redirect(action: show, id: params.id)
+                return
+        }
+
+        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        if(result.taskInstance)
+            redirect(action: show, id: params.id)
+        else
+            redirect(action: 'search')
+
+    }
+
+    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
     def renegeApproval = {
 
-        if(!Task.exists(params.id)) {
-            flash.message = "Task not found with id ${params.id}."
-            redirect(action: 'search')
-        }
-
         def result = taskService.renegeApproval(params)
 
         if(!result.error) {
                 flash.message = "Task ${params.id} has had approval removed."
-                redirect(action: 'show', id: result.taskInstance.id)
-        }
-        else {
-            if(result.taskInstance) {
-                render(view:'edit',model:[taskInstance:result.taskInstance])
-            }
-            else {
-                flash.message = "Task could not be updated."
-                redirect(action: 'search')
-            }
-        }
+                redirect(action: show, id: params.id)
+                return
+        }
+
+        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        if(result.taskInstance)
+            redirect(action: show, id: params.id)
+        else
+            redirect(action: 'search')
 
     }
@@ -411,24 +393,58 @@
     def complete = {
 
-        if(!Task.exists(params.id)) {
-            flash.message = "Task not found with id ${params.id}."
-            redirect(action: 'search')
-        }
-
         def result = taskService.complete(params)
 
         if(!result.error) {
                 flash.message = "Task ${params.id} has been completed."
-                redirect(action: 'show', id: result.taskInstance.id)
-        }
-        else {
-            if(result.taskInstance) {
-                render(view:'edit',model:[taskInstance:result.taskInstance])
-            }
-            else {
-                flash.message = "Task could not be updated."
-                redirect(action: 'search')
-            }
-        }
+                redirect(action: show, id: params.id)
+                return
+        }
+
+        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        if(result.taskInstance)
+            redirect(action: show, id: params.id)
+        else
+            redirect(action: 'search')
+
+    }
+
+    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
+    def setAttentionFlag = {
+
+        def result = taskService.setAttentionFlag(params)
+
+        if(!result.error) {
+                flash.message = "Task ${params.id} has been flagged for attention."
+                redirect(action: show, id: params.id)
+                return
+        }
+
+        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        if(result.taskInstance)
+            redirect(action: show, id: params.id)
+        else
+            redirect(action: 'search')
+
+    }
+
+    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
+    def clearAttentionFlag = {
+
+        def result = taskService.clearAttentionFlag(params)
+
+        if(!result.error) {
+                flash.message = "Task ${params.id} attention flag cleared."
+                redirect(action: show, id: params.id)
+                return
+        }
+
+        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        if(result.taskInstance)
+            redirect(action: show, id: params.id)
+        else
+            redirect(action: 'search')
 
     }
@@ -437,24 +453,18 @@
     def reopen = {
 
-        if(!Task.exists(params.id)) {
-            flash.message = "Task not found with id ${params.id}."
-            redirect(action: 'search')
-        }
-
         def result = taskService.reopen(params)
 
         if(!result.error) {
                 flash.message = "Task ${params.id} has been reopened."
-                redirect(action: 'show', id: result.taskInstance.id)
-        }
-        else {
-            if(result.taskInstance) {
-                render(view:'edit',model:[taskInstance:result.taskInstance])
-            }
-            else {
-                flash.message = "Task could not be updated."
-                redirect(action: 'search')
-            }
-        }
+                redirect(action: show, id: params.id)
+                return
+        }
+
+        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        if(result.taskInstance)
+            redirect(action: show, id: params.id)
+        else
+            redirect(action: 'search')
 
     }
@@ -488,18 +498,16 @@
     def update = {
 
-        if(!Task.exists(params.id)) {
-            flash.message = "Task not found with id ${params.id}"
-            redirect(action: 'search')
-        }
-
         def result = taskService.update(params)
 
         if(!result.error) {
                 flash.message = "Task ${params.id} updated"
-                redirect(action: 'show', id: result.taskInstance.id)
-        }
-        else {
-            render(view:'edit',model:[taskInstance:result.taskInstance.attach()])
-        }
+                redirect(action: show, id: params.id)
+                return
+        }
+
+        if(result.error.code == "task.modifications.failedToSave")
+            flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        render(view:'edit',model:[taskInstance:result.taskInstance.attach()])
 
     }
@@ -526,15 +534,11 @@
             flash.message = "Task ${result.taskInstance.id} created."
             redirect(action: 'show', id: result.taskInstance.id)
-        }
-        else {
-            if(result.taskInstance) {
-                render(view:'create', model:[taskInstance:result.taskInstance])
-            }
-            else {
-                flash.message = "Could not create task."
-                redirect(action: 'search')
-            }
-
-        }
+            return
+        }
+
+        if(result.error.code == "task.modifications.failedToSave")
+            flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
+
+        render(view:'create', model:[taskInstance:result.taskInstance])
     }
 
@@ -571,5 +575,5 @@
             else {
                 if(result.taskInstance.errors.hasFieldErrors("parentTask")) {
-                    flash.message = g.message(code:"task.operationNotPermittedOnTaskInTrash")
+                    flash.errorMessage = g.message(code:"task.operationNotPermittedOnTaskInTrash")
                     redirect(action: 'show', id:  parentTaskInstance.id)
                 }
@@ -587,18 +591,20 @@
 
     @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
-    def createBreakin = {
+    def createImmediateCallout = {
         def taskInstance = new Task()
 
         def entryFaultInstance = new Entry(entryType: EntryType.get(1))  // Fault.
-        def entryWorkDoneInstance = new Entry(entryType: EntryType.get(2))  // Work Done.
+        def entryCauseInstance = new Entry(entryType: EntryType.get(2))  // Cause.
+        def entryWorkDoneInstance = new Entry(entryType: EntryType.get(3))  // Work Done.
 
         return ['taskInstance': taskInstance,
                         'entryFaultInstance': entryFaultInstance,
+                        'entryCauseInstance': entryCauseInstance,
                         'entryWorkDoneInstance': entryWorkDoneInstance]
     }
 
     @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser'])
-    def saveBreakin = {
-        def result = taskService.saveBreakin(params)
+    def saveImmediateCallout = {
+        def result = taskService.saveImmediateCallout(params)
 
         if(!result.error) {
@@ -611,7 +617,8 @@
             flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
 
-        render(view:'createBreakin',
+        render(view:'createImmediateCallout',
                     model: ['taskInstance': result.taskInstance,
                                 'entryFaultInstance': result.entryFaultInstance,
+                                'entryCauseInstance': result.entryCauseInstance,
                                 'entryWorkDoneInstance': result.entryWorkDoneInstance])
 
Index: /trunk/grails-app/domain/Task.groovy
===================================================================
--- /trunk/grails-app/domain/Task.groovy	(revision 417)
+++ /trunk/grails-app/domain/Task.groovy	(revision 418)
@@ -19,6 +19,7 @@
     boolean approved = false
     boolean trash = false
+    boolean attentionFlag = false
 
-    static hasMany = [entries: Entry, 
+    static hasMany = [entries: Entry,
                         taskModifications: TaskModification,
                         assignedGroups: AssignedGroup,
Index: /trunk/grails-app/i18n/messages.properties
===================================================================
--- /trunk/grails-app/i18n/messages.properties	(revision 417)
+++ /trunk/grails-app/i18n/messages.properties	(revision 418)
@@ -59,8 +59,9 @@
 entry.comment.fault.help=Describe the fault and what is happening, NOT what needs doing! \
 <br /><br />From an operation perspective, NOT a technical perspective.
+entry.comment.cause=Cause
+entry.comment.cause.help=The root cause of the fault. Professional opinion on any faults. \
+Include condition and contributing factors.
 entry.comment.work.done=Work Done
-entry.comment.work.done.help=Describe the work that was done. \
-Include the root cause if known or professional opinion on any faults. \
-Include condition and contributing factors.
+entry.comment.work.done.help=Describe the work that was done.
 
 assignedGroup.estimatedDuration=Estimated Duration
Index: /trunk/grails-app/services/CreateBulkDataService.groovy
===================================================================
--- /trunk/grails-app/services/CreateBulkDataService.groovy	(revision 417)
+++ /trunk/grails-app/services/CreateBulkDataService.groovy	(revision 418)
@@ -145,5 +145,5 @@
         def taskGroup1 = TaskGroup.get(1)
         def taskPriority2 = TaskPriority.get(2)
-        def taskType1 = TaskType.get(1)
+        def taskType3 = TaskType.get(3)
         def leadPerson2 = Person.get(2)
 
@@ -168,5 +168,5 @@
             p = [taskGroup: taskGroup1,
                     taskPriority: taskPriority2,
-                    taskType: taskType1,
+                    taskType: taskType3,
                     leadPerson: leadPerson2,
                     description: btDescription,
Index: /trunk/grails-app/services/CreateDataService.groovy
===================================================================
--- /trunk/grails-app/services/CreateDataService.groovy	(revision 417)
+++ /trunk/grails-app/services/CreateDataService.groovy	(revision 418)
@@ -685,17 +685,20 @@
         def taskTypeInstance
 
-        taskTypeInstance = new TaskType(name:"Unscheduled Breakin") // #1
+        taskTypeInstance = new TaskType(name:"Immediate Callout") // #1
         saveAndTest(taskTypeInstance)
 
-        taskTypeInstance = new TaskType(name:"Preventative Maintenance") // #2
+        taskTypeInstance = new TaskType(name:"Unscheduled Breakin") // #2
         saveAndTest(taskTypeInstance)
 
-        taskTypeInstance = new TaskType(name:"Project") // #3
+        taskTypeInstance = new TaskType(name:"Scheduled") // #3
         saveAndTest(taskTypeInstance)
 
-        taskTypeInstance = new TaskType(name:"Turnaround") // #4
+        taskTypeInstance = new TaskType(name:"Preventative Maintenance") // #4
         saveAndTest(taskTypeInstance)
 
-        taskTypeInstance = new TaskType(name:"Production Run") // #5
+        taskTypeInstance = new TaskType(name:"Predictive Maintenance") // #5
+        saveAndTest(taskTypeInstance)
+
+        taskTypeInstance = new TaskType(name:"Project") // #6
         saveAndTest(taskTypeInstance)
     }
@@ -716,4 +719,6 @@
         taskModificationTypeInstance = new TaskModificationType(name:"Modified (Assigned Groups)").save()  // #10
         taskModificationTypeInstance = new TaskModificationType(name:"Modified (Assigned Persons)").save()  // #11
+        taskModificationTypeInstance = new TaskModificationType(name:"Modified (Flagged for attention)").save()  // #12
+        taskModificationTypeInstance = new TaskModificationType(name:"Modified (Attention flag cleared)").save()  // #13
     }
 
@@ -728,5 +733,5 @@
                 taskType:TaskType.get(1),
                 leadPerson:Person.get(2),
-                description:"Check specific level sensor",
+                description:"Level sensor not working",
                 comment:"Has been noted as problematic, try recalibrating.",
                 targetStartDate: dateUtilService.today]
@@ -737,5 +742,5 @@
         p = [taskGroup:TaskGroup.findByName("Engineering Activites"),
                 taskPriority:TaskPriority.get(2),
-                taskType:TaskType.get(1),
+                taskType:TaskType.get(3),
                 leadPerson:Person.get(5),
                 description:"Some follow-up work",
@@ -749,7 +754,7 @@
         p = [taskGroup:TaskGroup.findByName("Engineering Activites"),
                 taskPriority:TaskPriority.get(2),
-                taskType:TaskType.get(1),
+                taskType:TaskType.get(3),
                 leadPerson:Person.get(5),
-                description:"A Sub Task can be created from the Sub Task's tab.",
+                description:"A Sub Task can be created from the 'Sub Task' tab.",
                 comment:"Some help required",
                 targetStartDate: dateUtilService.yesterday,
@@ -761,8 +766,8 @@
         p = [taskGroup:TaskGroup.findByName("Engineering Activites"),
                  taskPriority:TaskPriority.get(2),
-                 taskType:TaskType.get(1),
+                 taskType:TaskType.get(2),
                  leadPerson:Person.get(4),
-                 description:"Replace sensor at next opportunity.",
-                 comment:"Nothing else has worked.",
+                 description:"Please replace sensor at next available opportunity.",
+                 comment:"Nothing else has worked. So we now require the part to be replaced.",
                 targetStartDate: dateUtilService.oneWeekFromNow,
                 parentTask: Task.get(1)]
@@ -773,8 +778,8 @@
         p = [taskGroup:TaskGroup.findByName("Production Activites"),
                  taskPriority:TaskPriority.get(2),
-                 taskType:TaskType.get(5),
+                 taskType:TaskType.get(3),
                  leadPerson:Person.get(6),
-                 description:"Production Report",
-                 comment:"Production report for specific production run or shift",
+                 description:"Production Task",
+                 comment:"Production task for specific production run or shift",
                 targetStartDate: dateUtilService.today - 6]
 
@@ -783,8 +788,8 @@
         //Task #6
         p = [taskGroup:TaskGroup.findByName("Engineering Activites"),
-                 taskPriority:TaskPriority.get(1),
-                 taskType:TaskType.get(2),
+                 taskPriority:TaskPriority.get(4),
+                 taskType:TaskType.get(3),
                  leadPerson:Person.get(4),
-                 description:"This is a recurring task",
+                 description:"This is a recurring preventative maintenance task.",
                  comment:"If there is a parent task specified then this is a generated sub task, if there is a recurring schedule specified then this is a parent task.",
                 targetStartDate: dateUtilService.today]
@@ -801,11 +806,14 @@
         saveAndTest(entryTypeInstance)
 
-        entryTypeInstance = new EntryType(name:"Work Done") // #2
+        entryTypeInstance = new EntryType(name:"Cause") // #2
         saveAndTest(entryTypeInstance)
 
-        entryTypeInstance = new EntryType(name:"Production Note") // #3
+        entryTypeInstance = new EntryType(name:"Work Done") // #3
         saveAndTest(entryTypeInstance)
 
-        entryTypeInstance = new EntryType(name:"Work Request") // #4
+        entryTypeInstance = new EntryType(name:"Production Note") // #4
+        saveAndTest(entryTypeInstance)
+
+        entryTypeInstance = new EntryType(name:"Work Request") // #5
         saveAndTest(entryTypeInstance)
     }
@@ -826,5 +834,5 @@
         //Entry #2
         p = [task: Task.get(1),
-                entryType: EntryType.get(2),
+                entryType: EntryType.get(3),
                 comment: "Cleaned sensor, see how it goes.",
                 durationMinute: 30]
@@ -834,5 +842,5 @@
         //Entry #3
         p = [task: Task.get(1),
-                entryType: EntryType.get(2),
+                entryType: EntryType.get(3),
                 comment: "Checked up on it later and sensor is dropping out intermittently, created sub task to replace sensor.",
                 durationMinute: 20]
@@ -933,5 +941,5 @@
         saveAndTest(inventoryLocation)
 
-        inventoryLocation = new InventoryLocation(inventoryStore: InventoryStore.get(1), name: "C55")
+        inventoryLocation = new InventoryLocation(inventoryStore: InventoryStore.get(2), name: "C55")
         saveAndTest(inventoryLocation)
     }
Index: /trunk/grails-app/services/TaskService.groovy
===================================================================
--- /trunk/grails-app/services/TaskService.groovy	(revision 417)
+++ /trunk/grails-app/services/TaskService.groovy	(revision 418)
@@ -31,14 +31,23 @@
     * Creates a new task with the given params.
     * @param params The params to use when creating the new task.
-    * @returns A map containing result.error=true (if any error) and result.taskInstance.
+    * @returns A map containing result.error (if any error) and result.taskInstance.
     */
     def save(params) {
         Task.withTransaction { status ->
             def result = [:]
+
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
+                return result
+            }
+
             // Default status to "not started" if not supplied.
             params.taskStatus = params.taskStatus ?: TaskStatus.get(1)
 
             // Set budgetStatus.
-            if(params.taskType?.id?.toLong() == 1) // Unscheduled Breakin.
+            if(params.taskType?.id?.toLong() == 1 || params.taskType?.id?.toLong() == 2) // Immediate Callout or Unsheduled Breakin.
                 params.taskBudgetStatus = params.taskBudgetStatus ?: TaskBudgetStatus.get(1) // Unplanned.
             else
@@ -48,76 +57,57 @@
             result.taskInstance = taskInstance
 
-            if(result.taskInstance.parentTask?.trash) {
-                status.setRollbackOnly()
-                result.taskInstance.errors.rejectValue("parentTask", "task.operationNotPermittedOnTaskInTrash")
-                result.error = true
-                return result
-            }
-
-            if(taskInstance.save()) {
-                def taskModification = new TaskModification(person: authService.currentUser,
-                                                        taskModificationType: TaskModificationType.get(1),
-                                                        task: taskInstance)
-
-                if(!taskModification.save()) {
-                    status.setRollbackOnly()
-                    taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
-                    result.error = true
-                    return result
+            if(result.taskInstance.parentTask?.trash)
+                return fail(field:"parentTask", code:"task.operationNotPermittedOnTaskInTrash")
+
+            if(result.taskInstance.hasErrors() || !result.taskInstance.save())
+                return fail(code:"default.create.failure")
+
+            def taskModification = new TaskModification(person: authService.currentUser,
+                                                taskModificationType: TaskModificationType.get(1),
+                                                task: taskInstance)
+
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(field:"taskModifications", code:"task.modifications.failedToSave")
+
+            //Add the assignedGroups, provided by a new ArrayList(task.assignedGroups)
+            if(params.assignedGroups) {
+                def assignedGroupsResult
+                def assignedGroupParams = [:]
+                params.assignedGroups.each() {
+
+                    assignedGroupParams = [personGroup: it.personGroup,
+                                                                task: taskInstance,
+                                                                estimatedHour: it.estimatedHour,
+                                                                estimatedMinute: it.estimatedMinute]
+
+                    assignedGroupsResult = assignedGroupService.save(assignedGroupParams)
+
+                    if(assignedGroupsResult.error)
+                        return fail(field:"assignedGroups", code:"task.assignedGroups.failedToSave")
+
                 }
-
-                //Add the assignedGroups, provided by a new ArrayList(task.assignedGroups)
-                if(params.assignedGroups) {
-                    def assignedGroupsResult
-                    def assignedGroupParams = [:]
-                    params.assignedGroups.each() {
-
-                        assignedGroupParams = [personGroup: it.personGroup,
-                                                                    task: taskInstance,
-                                                                    estimatedHour: it.estimatedHour,
-                                                                    estimatedMinute: it.estimatedMinute]
-
-                        assignedGroupsResult = assignedGroupService.save(assignedGroupParams)
-
-                        if(assignedGroupsResult.error) {
-                            status.setRollbackOnly()
-                            taskInstance.errors.rejectValue("assignedGroups", "task.assignedGroups.failedToSave")
-                            result.error = true
-                            return result
-                        }
-
-                    }
+            }
+
+            //Add the assignedPersons, provided by a new ArrayList(task.assignedPersons)
+            if(params.assignedPersons) {
+                def assignedPersonsResult
+                def assignedPersonsParams = [:]
+                params.assignedPersons.each() {
+
+                    assignedPersonsParams = [person: it.person,
+                                                                task: taskInstance,
+                                                                estimatedHour: it.estimatedHour,
+                                                                estimatedMinute: it.estimatedMinute]
+
+                    assignedPersonsResult = assignedPersonService.save(assignedPersonsParams)
+
+                    if(assignedPersonsResult.error)
+                        return fail(field:"assignedPersons", code:"task.assignedPersons.failedToSave")
+
                 }
-
-                //Add the assignedPersons, provided by a new ArrayList(task.assignedPersons)
-                if(params.assignedPersons) {
-                    def assignedPersonsResult
-                    def assignedPersonsParams = [:]
-                    params.assignedPersons.each() {
-
-                        assignedPersonsParams = [person: it.person,
-                                                                    task: taskInstance,
-                                                                    estimatedHour: it.estimatedHour,
-                                                                    estimatedMinute: it.estimatedMinute]
-
-                        assignedPersonsResult = assignedPersonService.save(assignedPersonsParams)
-
-                        if(assignedPersonsResult.error) {
-                            status.setRollbackOnly()
-                            taskInstance.errors.rejectValue("assignedPersons", "task.assignedPersons.failedToSave")
-                            result.error = true
-                            return result
-                        }
-
-                    }
-                }
-
-                // Success.
-                return result
-            }
-            else {
-                result.error = true
-                return result
-            }
+            }
+
+            // Success.
+            return result
 
         } //end withTransaction
@@ -210,5 +200,5 @@
 
             // If task status is "Not Started" and entry type is "Work Done" then we create the started modification and set the status.
-            if(taskInstance.taskStatus.id == 1 && result.entryInstance.entryType.id == 2) {
+            if(taskInstance.taskStatus.id == 1 && result.entryInstance.entryType.id == 3) {
 
                 // Create the "Started" task modification, this provides the "Actual Started Date".
@@ -239,5 +229,5 @@
     * Updates an existing task.
     * @param params The params to update for task with id of params.id.
-    * @returns A map containing result.error=true (if any error) and result.taskInstance (if available).
+    * @returns A map containing result.error (if any error) and result.taskInstance (if available).
     */
     def update(params) {
@@ -245,8 +235,9 @@
             def result = [:]
 
-            def fail = { Object[] args ->
-                status.setRollbackOnly()
-                if(args.size() == 2) result.taskInstance.errors.rejectValue(args[0], args[1])
-                result.error = true
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
                 return result
             }
@@ -259,7 +250,6 @@
             // Optimistic locking check.
             if(params.version) {
-                def version = params.version.toLong()
-                if(result.taskInstance.version > version)
-                    return fail("version", "default.optimistic.locking.failure")
+                if(result.taskInstance.version > params.version.toLong())
+                    return fail(field:"version", code:"default.optimistic.locking.failure")
             }
 
@@ -267,5 +257,5 @@
 
             if(result.taskInstance.hasErrors() || !result.taskInstance.save())
-                return fail()
+                return fail(code:"default.update.failure")
 
             def taskModification = new TaskModification(person:authService.currentUser,
@@ -273,8 +263,8 @@
                                                     task: result.taskInstance)
 
-            if(!taskModification.save())
-                return fail("taskModifications", "task.modifications.failedToSave")
-
-            // If we get here all went well.
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(code:"task.modifications.failedToSave")
+
+            // Success.
             return result
 
@@ -285,94 +275,183 @@
     * Completes an existing task.
     * @param params The params for task with id of params.id.
-    * @returns A map containing result.error=true (if any error) and result.taskInstance.
+    * @returns A map containing result.error (if any error) and result.taskInstance (if available).
     */
     def complete(params) {
         Task.withTransaction { status ->
             def result = [:]
-            result.taskInstance = Task.get(params.id)
-            if(result.taskInstance) {
-
-                // Optimistic locking check.
-                if(params.version) {
-                    def version = params.version.toLong()
-                    if(result.taskInstance.version > version) {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
-                        result.error = true
-                        return result
-                    }
-                }
-
-                result.taskInstance.taskStatus = TaskStatus.get(3)
-                result.taskInstance.taskRecurringSchedule?.enabled = false
-
-                if(result.taskInstance.save()) {
-                    def taskModification = new TaskModification(person:authService.currentUser,
-                                                            taskModificationType: TaskModificationType.get(4),
-                                                            task: result.taskInstance)
-
-                    if(taskModification.save()) {
-                        // All went well.
-                        return result
-                    }
-                    else {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
-                        result.error = true
-                        return result
-                    }
-                }
-            }
-            // Something failed.
-            status.setRollbackOnly()
-            result.error = true
+
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
+                return result
+            }
+
+            result.taskInstance = Task.get(params.id)
+
+            if(!result.taskInstance)
+                return fail(code:"default.not.found")
+
+            // Optimistic locking check.
+            if(params.version) {
+                if(result.taskInstance.version > params.version.toLong())
+                    return fail(field:"version", code:"default.optimistic.locking.failure")
+            }
+
+            result.taskInstance.taskStatus = TaskStatus.get(3)
+            result.taskInstance.attentionFlag = false
+            result.taskInstance.taskRecurringSchedule?.enabled = false
+
+            if(result.taskInstance.hasErrors() || !result.taskInstance.save())
+                return fail(code:"default.update.failure")
+
+            def taskModification = new TaskModification(person:authService.currentUser,
+                                                    taskModificationType: TaskModificationType.get(4),
+                                                    task: result.taskInstance)
+
+
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(code:"task.modifications.failedToSave")
+
+            // Success.
             return result
 
         } //end withTransaction
     }  // end complete()
+
+    /**
+    * Sets the attentionFlag on an existing task.
+    * @param params The params for task with id of params.id.
+    * @returns A map containing result.error (if any error) and result.taskInstance (if available).
+    */
+    def setAttentionFlag(params) {
+        Task.withTransaction { status ->
+            def result = [:]
+
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
+                return result
+            }
+
+            result.taskInstance = Task.get(params.id)
+
+            if(!result.taskInstance)
+                return fail(code:"default.not.found")
+
+            // Optimistic locking check.
+            if(params.version) {
+                if(result.taskInstance.version > params.version.toLong())
+                    return fail(field:"version", code:"default.optimistic.locking.failure")
+            }
+
+            result.taskInstance.attentionFlag = true
+
+            if(result.taskInstance.hasErrors() || !result.taskInstance.save())
+                return fail(code:"default.update.failure")
+
+            def taskModification = new TaskModification(person:authService.currentUser,
+                                                    taskModificationType: TaskModificationType.get(12),
+                                                    task: result.taskInstance)
+
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(code:"task.modifications.failedToSave")
+
+            // Success.
+            return result
+
+        } //end withTransaction
+    }  // end flag()
+
+    /**
+    * Clears the attentionFlag on an existing task.
+    * @param params The params for task with id of params.id.
+    * @returns A map containing result.error (if any error) and result.taskInstance (if available).
+    */
+    def clearAttentionFlag(params) {
+        Task.withTransaction { status ->
+            def result = [:]
+
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
+                return result
+            }
+
+            result.taskInstance = Task.get(params.id)
+
+            if(!result.taskInstance)
+                return fail(code:"default.not.found")
+
+            // Optimistic locking check.
+            if(params.version) {
+                if(result.taskInstance.version > params.version.toLong())
+                    return fail(field:"version", code:"default.optimistic.locking.failure")
+            }
+
+            result.taskInstance.attentionFlag = false
+
+            if(result.taskInstance.hasErrors() || !result.taskInstance.save())
+                return fail(code:"default.update.failure")
+
+            def taskModification = new TaskModification(person:authService.currentUser,
+                                                    taskModificationType: TaskModificationType.get(13),
+                                                    task: result.taskInstance)
+
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(code:"task.modifications.failedToSave")
+
+            // Success.
+            return result
+
+        } //end withTransaction
+    }  // end clearFlag()
 
     /**
     * Reopens an existing task.
     * @param params The params for task with id of params.id.
-    * @returns A map containing result.error=true (if any error) and result.taskInstance.
+    * @returns A map containing result.error (if any error) and result.taskInstance (if available).
     */
     def reopen(params) {
         Task.withTransaction { status ->
             def result = [:]
-            result.taskInstance = Task.get(params.id)
-            if(result.taskInstance) {
-
-                // Optimistic locking check.
-                if(params.version) {
-                    def version = params.version.toLong()
-                    if(result.taskInstance.version > version) {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
-                        result.error = true
-                        return result
-                    }
-                }
-
-                result.taskInstance.taskStatus = TaskStatus.get(2)
-
-                if(result.taskInstance.save()) {
-                    def taskModification = new TaskModification(person:authService.currentUser,
-                                                            taskModificationType: TaskModificationType.get(5),
-                                                            task: result.taskInstance)
-                    if(taskModification.save()) {
-                        // All went well.
-                        return result
-                    }
-                    else {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
-                        result.error = true
-                        return result
-                    }
-                }
-            }
-            // Something failed.
-            status.setRollbackOnly()
-            result.error = true
+
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
+                return result
+            }
+
+            result.taskInstance = Task.get(params.id)
+
+            if(!result.taskInstance)
+                return fail(code:"default.not.found")
+
+            // Optimistic locking check.
+            if(params.version) {
+                if(result.taskInstance.version > params.version.toLong())
+                    return fail(field:"version", code:"default.optimistic.locking.failure")
+            }
+
+            result.taskInstance.taskStatus = TaskStatus.get(2)
+
+            if(result.taskInstance.hasErrors() || !result.taskInstance.save())
+                return fail(code:"default.update.failure")
+
+            def taskModification = new TaskModification(person:authService.currentUser,
+                                                    taskModificationType: TaskModificationType.get(5),
+                                                    task: result.taskInstance)
+
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(code:"task.modifications.failedToSave")
+
+            // Success.
             return result
 
@@ -383,45 +462,44 @@
     * Move a task to the trash.
     * @param params The params for task with id of params.id.
-    * @returns A map containing result.error=true (if any error) and result.taskInstance.
+    * @returns A map containing result.error (if any error) and result.taskInstance (if available).
     */
     def trash(params) {
         Task.withTransaction { status ->
             def result = [:]
-            result.taskInstance = Task.get(params.id)
-            if(result.taskInstance) {
-
-                // Optimistic locking check.
-                if(params.version) {
-                    def version = params.version.toLong()
-                    if(result.taskInstance.version > version) {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
-                        result.error = true
-                        return result
-                    }
-                }
-
-                result.taskInstance.trash = true
-                result.taskInstance.taskRecurringSchedule?.enabled = false
-
-                if(result.taskInstance.save()) {
-                    def taskModification = new TaskModification(person:authService.currentUser,
-                                                            taskModificationType: TaskModificationType.get(6),
-                                                            task: result.taskInstance)
-                    if(taskModification.save()) {
-                        // All went well.
-                        return result
-                    }
-                    else {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
-                        result.error = true
-                        return result
-                    }
-                }
-            }
-            // Something failed.
-            status.setRollbackOnly()
-            result.error = true
+
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
+                return result
+            }
+
+            result.taskInstance = Task.get(params.id)
+
+            if(!result.taskInstance)
+                return fail(code:"default.not.found")
+
+            // Optimistic locking check.
+            if(params.version) {
+                if(result.taskInstance.version > params.version.toLong())
+                    return fail(field:"version", code:"default.optimistic.locking.failure")
+            }
+
+            result.taskInstance.trash = true
+            result.taskInstance.attentionFlag = false
+            result.taskInstance.taskRecurringSchedule?.enabled = false
+
+            if(result.taskInstance.hasErrors() || !result.taskInstance.save())
+                return fail(code:"default.update.failure")
+
+            def taskModification = new TaskModification(person:authService.currentUser,
+                                                    taskModificationType: TaskModificationType.get(6),
+                                                    task: result.taskInstance)
+
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(code:"task.modifications.failedToSave")
+
+            // Success.
             return result
 
@@ -432,44 +510,42 @@
     * Restore a task from the trash.
     * @param params The params for task with id of params.id.
-    * @returns A map containing result.error=true (if any error) and result.taskInstance.
+    * @returns A map containing result.error (if any error) and result.taskInstance (if available).
     */
     def restore(params) {
         Task.withTransaction { status ->
             def result = [:]
-            result.taskInstance = Task.get(params.id)
-            if(result.taskInstance) {
-
-                // Optimistic locking check.
-                if(params.version) {
-                    def version = params.version.toLong()
-                    if(result.taskInstance.version > version) {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
-                        result.error = true
-                        return result
-                    }
-                }
-
-                result.taskInstance.trash = false
-
-                if(result.taskInstance.save()) {
-                    def taskModification = new TaskModification(person:authService.currentUser,
-                                                            taskModificationType: TaskModificationType.get(7),
-                                                            task: result.taskInstance)
-                    if(taskModification.save()) {
-                        // All went well.
-                        return result
-                    }
-                    else {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
-                        result.error = true
-                        return result
-                    }
-                }
-            }
-            // Something failed.
-            status.setRollbackOnly()
-            result.error = true
+
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
+                return result
+            }
+
+            result.taskInstance = Task.get(params.id)
+
+            if(!result.taskInstance)
+                return fail(code:"default.not.found")
+
+            // Optimistic locking check.
+            if(params.version) {
+                if(result.taskInstance.version > params.version.toLong())
+                    return fail(field:"version", code:"default.optimistic.locking.failure")
+            }
+
+            result.taskInstance.trash = false
+
+            if(result.taskInstance.hasErrors() || !result.taskInstance.save())
+                return fail(code:"default.update.failure")
+
+            def taskModification = new TaskModification(person:authService.currentUser,
+                                                    taskModificationType: TaskModificationType.get(7),
+                                                    task: result.taskInstance)
+
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(code:"task.modifications.failedToSave")
+
+            // Success.
             return result
 
@@ -480,44 +556,42 @@
     * Approve a task.
     * @param params The params for task with id of params.id.
-    * @returns A map containing result.error=true (if any error) and result.taskInstance.
+    * @returns A map containing result.error (if any error) and result.taskInstance (if available).
     */
     def approve(params) {
         Task.withTransaction { status ->
             def result = [:]
-            result.taskInstance = Task.get(params.id)
-            if(result.taskInstance) {
-
-                // Optimistic locking check.
-                if(params.version) {
-                    def version = params.version.toLong()
-                    if(result.taskInstance.version > version) {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
-                        result.error = true
-                        return result
-                    }
-                }
-
-                result.taskInstance.approved = true
-
-                if(result.taskInstance.save()) {
-                    def taskModification = new TaskModification(person:authService.currentUser,
-                                                            taskModificationType: TaskModificationType.get(8),
-                                                            task: result.taskInstance)
-                    if(taskModification.save()) {
-                        // All went well.
-                        return result
-                    }
-                    else {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
-                        result.error = true
-                        return result
-                    }
-                }
-            }
-            // Something failed.
-            status.setRollbackOnly()
-            result.error = true
+
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
+                return result
+            }
+
+            result.taskInstance = Task.get(params.id)
+
+            if(!result.taskInstance)
+                return fail(code:"default.not.found")
+
+            // Optimistic locking check.
+            if(params.version) {
+                if(result.taskInstance.version > params.version.toLong())
+                    return fail(field:"version", code:"default.optimistic.locking.failure")
+            }
+
+            result.taskInstance.approved = true
+
+            if(result.taskInstance.hasErrors() || !result.taskInstance.save())
+                return fail(code:"default.update.failure")
+
+            def taskModification = new TaskModification(person:authService.currentUser,
+                                                    taskModificationType: TaskModificationType.get(8),
+                                                    task: result.taskInstance)
+
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(code:"task.modifications.failedToSave")
+
+            // Success.
             return result
 
@@ -528,44 +602,42 @@
     * Remove a previously given approval from a task.
     * @param params The params for task with id of params.id.
-    * @returns A map containing result.error=true (if any error) and result.taskInstance.
+    * @returns A map containing result.error (if any error) and result.taskInstance (if available).
     */
     def renegeApproval(params) {
         Task.withTransaction { status ->
             def result = [:]
-            result.taskInstance = Task.get(params.id)
-            if(result.taskInstance) {
-
-                // Optimistic locking check.
-                if(params.version) {
-                    def version = params.version.toLong()
-                    if(result.taskInstance.version > version) {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("version", "task.optimistic.locking.failure", "Another user has updated this Task while you were editing.")
-                        result.error = true
-                        return result
-                    }
-                }
-
-                result.taskInstance.approved = false
-
-                if(result.taskInstance.save()) {
-                    def taskModification = new TaskModification(person:authService.currentUser,
-                                                            taskModificationType: TaskModificationType.get(9),
-                                                            task: result.taskInstance)
-                    if(taskModification.save()) {
-                        // All went well.
-                        return result
-                    }
-                    else {
-                        status.setRollbackOnly()
-                        result.taskInstance.errors.rejectValue("taskModifications", "task.modifications.failedToSave")
-                        result.error = true
-                        return result
-                    }
-                }
-            }
-            // Something failed.
-            status.setRollbackOnly()
-            result.error = true
+
+            def fail = { Map m ->
+                status.setRollbackOnly()
+                if(result.taskInstance && m.field)
+                    result.taskInstance.errors.rejectValue(m.field, m.code)
+                result.error = [ code: m.code, args: ["Task", params.id] ]
+                return result
+            }
+
+            result.taskInstance = Task.get(params.id)
+
+            if(!result.taskInstance)
+                return fail(code:"default.not.found")
+
+            // Optimistic locking check.
+            if(params.version) {
+                if(result.taskInstance.version > params.version.toLong())
+                    return fail(field:"version", code:"default.optimistic.locking.failure")
+            }
+
+            result.taskInstance.approved = false
+
+            if(result.taskInstance.hasErrors() || !result.taskInstance.save())
+                return fail(code:"default.update.failure")
+
+            def taskModification = new TaskModification(person:authService.currentUser,
+                                                    taskModificationType: TaskModificationType.get(9),
+                                                    task: result.taskInstance)
+
+            if(taskModification.hasErrors() || !taskModification.save())
+                return fail(code:"task.modifications.failedToSave")
+
+            // Success.
             return result
 
@@ -574,9 +646,9 @@
 
     /**
-    * Creates a new breakin task with the given params.
+    * Creates a new immediate callout task with the given params.
     * @param params The params to use when creating the new task.
-    * @returns A map containing result.error=true (if any error) and result.taskInstance.
-    */
-    def saveBreakin(params) {
+    * @returns A map containing result.error (if any error) and result.taskInstance.
+    */
+    def saveImmediateCallout(params) {
         Task.withTransaction { status ->
             def result = [:]
@@ -596,6 +668,6 @@
             result.taskInstance = new Task(params)
 
-            // Always for a breakin.
-            result.taskInstance.taskType = TaskType.get(1) // Unscheduled Breakin.
+            // Always for an immediate callout.
+            result.taskInstance.taskType = TaskType.get(1) // Immediate Callout.
             result.taskInstance.taskBudgetStatus = TaskBudgetStatus.get(1) // Unplanned.
             result.taskInstance.taskPriority = TaskPriority.get(4) // Immediate.
@@ -624,6 +696,12 @@
             result.entryFaultInstance = faultResult.entryInstance
 
+            def causeParams = [task: result.taskInstance,
+                                            entryType: EntryType.get(2),
+                                            comment: params.entryCause.comment]
+            def causeResult = saveEntry(causeParams)
+            result.entryCauseInstance = causeResult.entryInstance
+
             def workDoneParams = [task: result.taskInstance,
-                                                    entryType: EntryType.get(2),
+                                                    entryType: EntryType.get(3),
                                                     comment: params.entryWorkDone.comment,
                                                     durationHour: params.entryWorkDone.durationHour,
@@ -635,4 +713,7 @@
                 return result
 
+            if(causeResult.error)
+                return fail(code: "default.create.failure")
+
             if(faultResult.error)
                 return fail(code: "default.create.failure")
@@ -645,5 +726,5 @@
 
         } //end withTransaction
-    } // end saveBreakin()
+    } // end saveImmediateCallout()
 
 } // end TaskService
Index: unk/grails-app/views/taskDetailed/createBreakin.gsp
===================================================================
--- /trunk/grails-app/views/taskDetailed/createBreakin.gsp	(revision 417)
+++ 	(revision )
@@ -1,132 +1,0 @@
-<html>
-    <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-        <meta name="layout" content="main" />
-        <title>Create Breakin</title>
-        <nav:resources override="true"/>
-        <resource:dateChooser />
-    </head>
-    <body onload="document.createTaskForm.description.focus();">
-        <div class="nav">
-            <nav:renderSubItems group="nav"/>
-        </div>
-        <div class="body">
-            <g:render template="/shared/messages" />
-            <g:hasErrors bean="${taskInstance}">
-            <div class="errors">
-                <g:renderErrors bean="${taskInstance}" as="list" />
-            </div>
-            </g:hasErrors>
-            <g:hasErrors bean="${entryFaultInstance}">
-            <div class="errors">
-                <g:renderErrors bean="${entryFaultInstance}" as="list" />
-            </div>
-            </g:hasErrors>
-            <g:hasErrors bean="${entryWorkDoneInstance}">
-            <div class="errors">
-                <g:renderErrors bean="${entryWorkDoneInstance}" as="list" />
-            </div>
-            </g:hasErrors>
-
-            <g:form action="saveBreakin" method="post" name="createTaskForm">
-                <div class="dialog">
-                    <table>
-                        <tbody>
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="description">Breakin Description:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'description','errors')}">
-                                    <input type="text"  class="description" maxlength="75" id="description" name="description" value="${fieldValue(bean:taskInstance,field:'description')}"/>
-                                    <g:helpBalloon class="helpballoon" code="task.description" />
-                                </td>
-                            </tr>
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="comment">${entryFaultInstance?.entryType.encodeAsHTML()}:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:entryFaultInstance,field:'comment','errors')}">
-                                    <textarea rows="5" cols="40" name="entryFault.comment">${fieldValue(bean:entryFaultInstance, field:'comment')}</textarea>
-                                        <g:helpBalloon code="entry.comment.fault" />
-                                </td>
-                            </tr>
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="durationHour">Fault Duration:</label>
-                                </td>
-
-                                <td valign="top" class="value">
-                                    <input class="time ${hasErrors(bean:entryFaultInstance,field:'durationHour','errors')}"
-                                        type="text" id="entryFault.durationHour" name="entryFault.durationHour"
-                                        value="${fieldValue(bean:entryFaultInstance,field:'durationHour')}" />
-                                    :
-                                    <input class="time ${hasErrors(bean:entryFaultInstance,field:'durationMinute','errors')}"
-                                        type="text" id="entryFault.durationMinute" name="entryFault.durationMinute" 
-                                        value="${fieldValue(bean:entryFaultInstance,field:'durationMinute')}" />
-                                    <g:helpBalloon code="entry.duration" />
-                                </td> 
-                            </tr>
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="comment">${entryWorkDoneInstance?.entryType.encodeAsHTML()}:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:entryWorkDoneInstance,field:'comment','errors')}">
-                                    <textarea rows="5" cols="40" name="entryWorkDone.comment">${fieldValue(bean:entryWorkDoneInstance, field:'comment')}</textarea>
-                                        <g:helpBalloon code="entry.comment.work.done" />
-                                </td>
-                            </tr>
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="durationHour">Work Duration:</label>
-                                </td>
-
-                                <td valign="top" class="value">
-                                    <input class="time ${hasErrors(bean:entryWorkDoneInstance,field:'durationHour','errors')}"
-                                        type="text" id="entryWorkDone.durationHour" name="entryWorkDone.durationHour"
-                                        value="${fieldValue(bean:entryWorkDoneInstance,field:'durationHour')}" />
-                                    :
-                                    <input class="time ${hasErrors(bean:entryWorkDoneInstance,field:'durationMinute','errors')}"
-                                        type="text" id="entryWorkDone.durationMinute" name="entryWorkDone.durationMinute" 
-                                        value="${fieldValue(bean:entryWorkDoneInstance,field:'durationMinute')}" />
-                                    <g:helpBalloon code="entry.duration" />
-                                </td> 
-                            </tr>
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="primaryAsset">Primary Asset:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'primaryAsset','errors')}">
-                                    <g:select optionKey="id" from="${Asset.list()}" name="primaryAsset.id" value="${taskInstance?.primaryAsset?.id}" noSelection="['null':'--None--']"></g:select>
-                                    <g:helpBalloon code="task.primaryAsset" />
-                                </td>
-                            </tr>
-
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="associatedAssets">Associated Assets:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'associatedAssets','errors')}">
-                                    <g:select id="associatedAssets" name="associatedAssets"
-                                                    from="${Asset.list()}"
-                                                    size="5" multiple="yes" optionKey="id"
-                                                    value="${taskInstance?.associatedAssets?.id}"  noSelection="['':'--None--']"/>
-                                    <g:helpBalloon code="task.associatedAssets" />
-                                </td>
-                            </tr>
-                        
-                        </tbody>
-                    </table>
-                </div>
-                <div class="buttons">
-                    <span class="button"><input class="save" type="submit" value="Create" /></span>
-                </div>
-            </g:form>
-        </div>
-    </body>
-</html>
Index: /trunk/grails-app/views/taskDetailed/createImmediateCallout.gsp
===================================================================
--- /trunk/grails-app/views/taskDetailed/createImmediateCallout.gsp	(revision 418)
+++ /trunk/grails-app/views/taskDetailed/createImmediateCallout.gsp	(revision 418)
@@ -0,0 +1,147 @@
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Create Immediate Callout</title>
+        <nav:resources override="true"/>
+        <resource:dateChooser />
+    </head>
+    <body onload="document.createTaskForm.description.focus();">
+        <div class="nav">
+            <nav:renderSubItems group="nav"/>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <g:hasErrors bean="${taskInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${taskInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:hasErrors bean="${entryFaultInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${entryFaultInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:hasErrors bean="${entryCauseInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${entryCauseInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:hasErrors bean="${entryWorkDoneInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${entryWorkDoneInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+
+            <g:form action="saveImmediateCallout" method="post" name="createTaskForm">
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="description">Callout Description:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'description','errors')}">
+                                    <input type="text"  class="description" maxlength="75" id="description" name="description" value="${fieldValue(bean:taskInstance,field:'description')}"/>
+                                    <g:helpBalloon class="helpballoon" code="task.description" />
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="durationHour">Down Time:</label>
+                                </td>
+
+                                <td valign="top" class="value">
+                                    <input class="time ${hasErrors(bean:entryFaultInstance,field:'durationHour','errors')}"
+                                        type="text" id="entryFault.durationHour" name="entryFault.durationHour"
+                                        value="${fieldValue(bean:entryFaultInstance,field:'durationHour')}" />
+                                    :
+                                    <input class="time ${hasErrors(bean:entryFaultInstance,field:'durationMinute','errors')}"
+                                        type="text" id="entryFault.durationMinute" name="entryFault.durationMinute" 
+                                        value="${fieldValue(bean:entryFaultInstance,field:'durationMinute')}" />
+                                    <g:helpBalloon code="entry.duration" />
+                                </td> 
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="comment">${entryFaultInstance?.entryType.encodeAsHTML()}:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:entryFaultInstance,field:'comment','errors')}">
+                                    <textarea rows="5" cols="40" name="entryFault.comment">${fieldValue(bean:entryFaultInstance, field:'comment')}</textarea>
+                                        <g:helpBalloon code="entry.comment.fault" />
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="comment">${entryCauseInstance?.entryType.encodeAsHTML()}:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:entryCauseInstance,field:'comment','errors')}">
+                                    <textarea rows="5" cols="40" name="entryCause.comment">${fieldValue(bean:entryCauseInstance, field:'comment')}</textarea>
+                                        <g:helpBalloon code="entry.comment.cause" />
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="comment">${entryWorkDoneInstance?.entryType.encodeAsHTML()}:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:entryWorkDoneInstance,field:'comment','errors')}">
+                                    <textarea rows="5" cols="40" name="entryWorkDone.comment">${fieldValue(bean:entryWorkDoneInstance, field:'comment')}</textarea>
+                                        <g:helpBalloon code="entry.comment.work.done" />
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="durationHour">Work Duration:</label>
+                                </td>
+
+                                <td valign="top" class="value">
+                                    <input class="time ${hasErrors(bean:entryWorkDoneInstance,field:'durationHour','errors')}"
+                                        type="text" id="entryWorkDone.durationHour" name="entryWorkDone.durationHour"
+                                        value="${fieldValue(bean:entryWorkDoneInstance,field:'durationHour')}" />
+                                    :
+                                    <input class="time ${hasErrors(bean:entryWorkDoneInstance,field:'durationMinute','errors')}"
+                                        type="text" id="entryWorkDone.durationMinute" name="entryWorkDone.durationMinute" 
+                                        value="${fieldValue(bean:entryWorkDoneInstance,field:'durationMinute')}" />
+                                    <g:helpBalloon code="entry.duration" />
+                                </td> 
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="primaryAsset">Primary Asset:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'primaryAsset','errors')}">
+                                    <g:select optionKey="id" from="${Asset.list()}" name="primaryAsset.id" value="${taskInstance?.primaryAsset?.id}" noSelection="['null':'--None--']"></g:select>
+                                    <g:helpBalloon code="task.primaryAsset" />
+                                </td>
+                            </tr>
+
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="associatedAssets">Associated Assets:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'associatedAssets','errors')}">
+                                    <g:select id="associatedAssets" name="associatedAssets"
+                                                    from="${Asset.list()}"
+                                                    size="5" multiple="yes" optionKey="id"
+                                                    value="${taskInstance?.associatedAssets?.id}"  noSelection="['':'--None--']"/>
+                                    <g:helpBalloon code="task.associatedAssets" />
+                                </td>
+                            </tr>
+                        
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><input class="save" type="submit" value="Create" /></span>
+                </div>
+            </g:form>
+        </div>
+    </body>
+</html>
Index: unk/grails-app/views/taskDetailed/list.gsp
===================================================================
--- /trunk/grails-app/views/taskDetailed/list.gsp	(revision 417)
+++ 	(revision )
@@ -1,69 +1,0 @@
-<html>
-    <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-        <meta name="layout" content="main" />
-        <title>Task List</title>
-        <nav:resources override="true"/>
-    </head>
-    <body>
-        <div class="nav">
-            <nav:renderSubItems group="nav"/>
-        </div>
-        <div class="body">
-            <g:if test="${flash.message}">
-                <div class="message">${flash.message}</div>
-            </g:if>
-            <div class="list">
-                <table>
-                    <thead>
-                        <tr>
-
-                            <g:sortableColumn defaultOrder="desc" property="id" title="Id"  />
-
-                            <g:sortableColumn property="targetStartDate" title="Target Start Date" />
-
-                            <g:sortableColumn property="description" title="Description" />
-
-                            <g:sortableColumn  property="leadPerson" title="Lead Person" />
-
-                            <g:sortableColumn  property="taskPriority" title="Task Priority" />
-
-                            <g:sortableColumn  property="taskStatus" title="Task Status" />
-
-                            <th></th>
-
-                        </tr>
-                    </thead>
-                    <tbody>
-                    <g:each in="${taskInstanceList}" status="i" var="taskInstance">
-                    <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'/>
-
-                            <td>${fieldValue(bean:taskInstance, field:'id')}</td>
-
-                            <td><g:formatDate date="${taskInstance.targetStartDate}" format="EEE, dd-MMM-yyyy"/></td>
-
-                            <td>${fieldValue(bean:taskInstance, field:'description')}</td>
-
-                            <td>${fieldValue(bean:taskInstance, field:'leadPerson')}</td>
-
-                            <td>${fieldValue(bean:taskInstance, field:'taskPriority')}</td>
-
-                            <td>${fieldValue(bean:taskInstance, field:'taskStatus')}</td>
-
-                            <td>
-                                <g:link action="show" id="${taskInstance.id}">
-                                    <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" />
-                                </g:link>
-                            </td>
-
-                        </tr>
-                    </g:each>
-                    </tbody>
-                </table>
-            </div>
-            <div class="paginateButtons">
-                <g:paginate total="${taskInstanceTotal}" />
-            </div>
-        </div>
-    </body>
-</html>
Index: /trunk/grails-app/views/taskDetailed/search.gsp
===================================================================
--- /trunk/grails-app/views/taskDetailed/search.gsp	(revision 417)
+++ /trunk/grails-app/views/taskDetailed/search.gsp	(revision 418)
@@ -14,7 +14,5 @@
 
         <div class="body">
-            <g:if test="${flash.message}">
-                <div class="message">${flash.message}</div>
-            </g:if>
+            <g:render template="/shared/messages" />
             <g:if test="${params.message}">
                 <div class="message">${params.message}</div>
@@ -91,4 +89,8 @@
                         <tr>
 
+                            <custom:sortableColumnWithImg property="attentionFlag"
+                                                                                            imgSrc="${resource(dir:'images/skin',file:'flag_red.png')}"
+                                                                                            imgAlt="Flag" params="${filterParams}" />
+
                             <g:sortableColumn property="id" title="Id" params="${filterParams}" />
 
@@ -96,6 +98,4 @@
 
                             <g:sortableColumn property="description" title="Description" params="${filterParams}" />
-
-                            <g:sortableColumn  property="leadPerson" title="Lead Person" params="${filterParams}" />
 
                             <g:sortableColumn  property="taskPriority" title="Task Priority" params="${filterParams}" />
@@ -111,11 +111,15 @@
                     <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/taskDetailed/show/${taskInstance.id}"'/>
 
-                            <td>${fieldValue(bean:taskInstance, field:'id')}</td>
+                            <td class="idColumn">
+                                <g:if test="${taskInstance.attentionFlag}">
+                                    <img  src="${resource(dir:'images/skin',file:'flag_red.png')}" alt="Flag" />
+                                </g:if>
+                            </td>
+
+                            <td class="idColumn">${fieldValue(bean:taskInstance, field:'id')}</td>
 
                             <td><g:formatDate date="${taskInstance.targetStartDate}" format="EEE, dd-MMM-yyyy"/></td>
 
                             <td>${fieldValue(bean:taskInstance, field:'description')}</td>
-
-                            <td>${fieldValue(bean:taskInstance, field:'leadPerson')}</td>
 
                             <td>${fieldValue(bean:taskInstance, field:'taskPriority')}</td>
Index: /trunk/grails-app/views/taskDetailed/show.gsp
===================================================================
--- /trunk/grails-app/views/taskDetailed/show.gsp	(revision 417)
+++ /trunk/grails-app/views/taskDetailed/show.gsp	(revision 418)
@@ -12,10 +12,8 @@
         </div>
         <div class="body">
-            <g:if test="${flash.message}">
-            <div class="message">${flash.message}</div>
-            </g:if>
+            <g:render template="/shared/messages" />
             <g:if test="${taskInstance.trash}" >
                 <div class="errors">
-                        This task is in the trash bin, but can be restored if required.
+                        <ul><li>This task is in the trash bin, but can be restored if required.<li><ul>
                 </div>
             </g:if>
@@ -26,8 +24,23 @@
             </g:hasErrors>
 
+            <div class="tabHeader">
+                <h1 class="taskHeader">
+                    Task #${taskInstance.id}
+                    <g:if test="${taskInstance.attentionFlag}" >
+                        <img  src="${resource(dir:'images/skin',file:'flag_red.png')}" alt="Flag" />
+                    </g:if>
+                    <g:if test="${taskInstance.taskStatus.id == 3}" >
+                        <img  src="${resource(dir:'images/skin',file:'tick.png')}" alt="Flag" />
+                    </g:if>
+                </h1>
+                ${fieldValue(bean:taskInstance, field:'description')}
+            </div>
+
+            <br/>
+
             <richui:tabView id="tabView">
 
                 <richui:tabLabels>
-                    <richui:tabLabel selected="${showTab.task}" title="Task #${taskInstance.id}" />
+                    <richui:tabLabel selected="${showTab.task}" title="Details" />
                     <richui:tabLabel selected="${showTab.procedure}" title="Procedure" />
                     <richui:tabLabel selected="${showTab.recurrence}" title="Recurrence" />
@@ -53,11 +66,4 @@
                                         </tr>
                                     </g:if>
-
-                                    <tr class="prop">
-                                        <td valign="top" class="name">Description:</td>
-
-                                        <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'description')}</td>
-
-                                    </tr>
 
                                     <tr class="prop">
@@ -224,5 +230,13 @@
 
                                     <g:if test="${taskInstance.taskStatus.id != 3}" >
-                                        <span class="button"><g:actionSubmit class="complete" value="Complete" /></span>
+
+                                        <g:if test="${taskInstance.attentionFlag}" >
+                                            <span class="button"><g:actionSubmit class="flag" value="Clear" action="clearAttentionFlag"/></span>
+                                        </g:if>
+                                        <g:else>
+                                            <span class="button"><g:actionSubmit class="flag" value="Unresolved" action="setAttentionFlag"/></span>
+                                        </g:else>
+
+                                        <span class="button"><g:actionSubmit class="complete" value="Resolved" action="complete"/></span>
 
                                         <g:if test="${taskInstance.approved}" >
@@ -259,5 +273,5 @@
                                             <th>Comment</th>
                                             <th>Date Done</th>
-                                            <th>Duration</th>
+                                            <th>Down Time</th>
                                             <th>Entered By</th>
                                             <th></th>
@@ -292,4 +306,53 @@
                                 <span class="button">
                                     <g:actionSubmit value="Add Fault" action="create"  class="add"/>
+                                </span>
+                            </g:form>
+                        </div>
+
+                        <br />
+
+                        <g:if test="${entryCauseList.isEmpty()}">
+                            <h1>No Causes</h1>
+                            <br />
+                        </g:if>
+                        <g:else>
+                            <div class="list">
+                                <h1>Causes</h1>
+                                <table>
+                                    <thead>
+                                        <tr>
+                                            <th>Comment</th>
+                                            <th>Date Done</th>
+                                            <th>Entered By</th>
+                                            <th></th>
+                                        </tr>
+                                    </thead>
+                                    <tbody>
+                                        <g:each in="${entryCauseList}" status="i" var="entry">
+                                                <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/entryDetailed/edit/${entry.id}"'/>
+
+                                                    <td style="width:65%">${entry.comment}</td>
+                                                    <td><g:formatDate date="${entry.dateDone}" format="EEE, dd-MMM-yyyy"/></td>
+                                                    <td>${entry.enteredBy}</td>
+
+                                                    <td>
+                                                        <g:link controller="entryDetailed" action="edit" id="${entry.id}">
+                                                            <img  src="${resource(dir:'images/skin',file:'database_edit.png')}" alt="Edit" />
+                                                        </g:link>
+                                                    </td>
+
+                                                </tr>
+                                        </g:each>
+                                    </tbody>
+                                </table>
+                            </div>
+                        </g:else>
+
+                        <div class="buttons">
+                            <g:form controller="entryDetailed">
+                                <g:hiddenField name="taskInstance.id" value="${taskInstance?.id}" />
+                                <g:hiddenField name="entryType.id" value="2" />
+                                <span class="button">
+                                    <g:actionSubmit value="Add Cause" action="create"  class="add"/>
                                 </span>
                             </g:form>
@@ -340,5 +403,5 @@
                             <g:form controller="entryDetailed">
                                 <g:hiddenField name="taskInstance.id" value="${taskInstance?.id}" />
-                                <g:hiddenField name="entryType.id" value="2" />
+                                <g:hiddenField name="entryType.id" value="3" />
                                 <span class="button">
                                     <g:actionSubmit value="Add Work Done" action="create"  class="add"/>
@@ -687,5 +750,5 @@
             </richui:tabView>
 
-        </div>
+        </div> <!--body-->
     </body>
 </html>
Index: /trunk/web-app/css/main.css
===================================================================
--- /trunk/web-app/css/main.css	(revision 417)
+++ /trunk/web-app/css/main.css	(revision 418)
@@ -57,4 +57,5 @@
 }
 
+/* Application log textarea */
 #log {
     width: 920px;
@@ -62,4 +63,21 @@
 }
 
+div.tabHeader {
+    padding: 5px 15px 40px 15px;
+    margin-bottom: -45px;
+}
+.tabHeader h1 {
+    color: #2647a0;
+    font-weight: bold;
+    font-size: 17px;
+    margin: 0 0 .3em 0;
+}
+.tabHeader h2 {
+    color: #2647a0;
+    font-weight: normal;
+    font-size: 15px;
+    margin: 0 0 .3em 0;
+}
+
 a:link, a:visited, a:hover {
     color: #006dba;
@@ -76,4 +94,18 @@
     font-weight: normal;
     font-size: 17px;
+    margin: 0 0 .3em 0;
+}
+
+h2 {
+    color: #006dba;
+    font-weight: bold;
+    font-size: 15px;
+    margin: 0 0 .3em 0;
+}
+
+h3 {
+    color: #006dba;
+    font-weight: normal;
+    font-size: 15px;
     margin: 0 0 .3em 0;
 }
@@ -241,4 +273,7 @@
     text-align: left;
     vertical-align: top;
+}
+td.idColumn {
+    width: 25px;
 }
 th {
@@ -400,4 +435,8 @@
 .buttons input.complete {
     background: transparent url(../images/skin/tick.png) 5px 50% no-repeat;
+    padding-left: 28px;
+}
+.buttons input.flag {
+    background: transparent url(../images/skin/flag_red.png) 5px 50% no-repeat;
     padding-left: 28px;
 }
