Index: trunk/grails-app/i18n/messages.properties
===================================================================
--- trunk/grails-app/i18n/messages.properties	(revision 801)
+++ trunk/grails-app/i18n/messages.properties	(revision 802)
@@ -144,8 +144,17 @@
 task.delete.failure.production=Tasks may not be deleted in production mode, \
     set the trash flag instead.
+task.trash.confirm=Trash, are you sure? \
+    If authorised, recurrence will be disabled and Sub Task links will be forever removed!
 task.notFound=Could not complete operation, task not found.
 task.operationNotPermittedOnCompleteTask=This operation is not permitted on a complete task.
 task.operationNotPermittedOnTaskInTrash=This operation is not permitted on a task that is in the trash.
-task.operationNotPermittedOnRecurringTaskWithoutAuth=This operation is not permitted on a recurring task without authorisation.
+task.operationNotPermittedOnRecurringTaskWithoutAuth=This operation is not permitted \
+    on a recurring task without authorisation.
+task.operationNotPermittedOnTaskHavingSubTasksWithoutAuth=This operation is not permitted \
+    on a task that has sub tasks without authorisation.
+task.operationNotPermittedOnTaskLinkedToProcedure=This operation is not permitted \
+    on a task that is linked to a procedure.
+task.operationNotPermittedOnParentPmTask=This operation is not permitted \
+    on a Parent PM task.
 task.failedToSave=Could not complete operation, task failed to save.
 task.modifications.failedToSave=Could not complete operation, as task modification record failed to save.
Index: trunk/grails-app/services/TaskService.groovy
===================================================================
--- trunk/grails-app/services/TaskService.groovy	(revision 801)
+++ trunk/grails-app/services/TaskService.groovy	(revision 802)
@@ -685,7 +685,24 @@
             }
 
+            // Check for authorisation on tasks having subTasks.
+            if(result.taskInstance.subTasks) {
+                if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager'))
+                    return fail(field:"subTasks", code:"task.operationNotPermittedOnTaskHavingSubTasksWithoutAuth")
+            }
+
+            // Check for taskProcedure using this task as linkedTask.
+            if(result.taskInstance.taskProcedure?.linkedTask?.id == result.taskInstance.id)
+                return fail(field:"taskProcedure", code:"task.operationNotPermittedOnTaskLinkedToProcedure")
+
+            // Check for Parent PM task type.
+            if(result.taskInstance.taskType.id == 6)
+                return fail(field:"taskProcedure", code:"task.operationNotPermittedOnParentPmTask")
+
             result.taskInstance.trash = true
             result.taskInstance.attentionFlag = false
             result.taskInstance.taskRecurringSchedule?.enabled = false
+            result.taskInstance.subTasks.each {
+                it.parentTask = null
+            }
 
             if(result.taskInstance.hasErrors() || !result.taskInstance.save())
Index: trunk/grails-app/views/taskDetailed/show.gsp
===================================================================
--- trunk/grails-app/views/taskDetailed/show.gsp	(revision 801)
+++ trunk/grails-app/views/taskDetailed/show.gsp	(revision 802)
@@ -282,5 +282,9 @@
 
                                         <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
-                                        <span class="button"><g:actionSubmit class="trash" onclick="return confirm('Are you sure?');" value="Trash" /></span>
+                                        <span class="button">
+                                            <g:actionSubmit class="trash"
+                                                                        onclick="return confirm('${message(code:'task.trash.confirm')}');"
+                                                                        value="Trash" />
+                                        </span>
 
                                     </g:if>
