Index: trunk/grails-app/controllers/AssetDetailedController.groovy
===================================================================
--- trunk/grails-app/controllers/AssetDetailedController.groovy	(revision 615)
+++ trunk/grails-app/controllers/AssetDetailedController.groovy	(revision 749)
@@ -11,4 +11,5 @@
     def assetService
     def assetTreeService
+    def taskService
 
     // the delete, save and update actions only accept POST requests
@@ -235,6 +236,9 @@
             flash.message = "Asset not found with id ${params.id}"
             redirect(action:search)
-        }
-        else { return [ assetInstance : assetInstance ] }
+            return
+        }
+
+        return [ assetInstance : assetInstance,
+                        parentPMs: taskService.getParentPMs(assetInstance)]
     }
 
@@ -275,8 +279,11 @@
             flash.message = "Asset not found with id ${params.id}"
             redirect(action:search)
-        }
-        else {
-            return [ assetInstance : assetInstance, possibleAssetSubItems: assetService.possibleAssetSubItems() ]
-        }
+            return
+        }
+
+        return [ assetInstance : assetInstance,
+                        possibleAssetSubItems: assetService.possibleAssetSubItems(),
+                        parentPMs: taskService.getParentPMs(assetInstance) ]
+
     }
 
@@ -286,36 +293,42 @@
     def update = {
         def assetInstance = Asset.get( params.id )
-        if(assetInstance) {
-            if(params.version) {
-                def version = params.version.toLong()
-                if(assetInstance.version > version) {
-
-                    assetInstance.errors.rejectValue("version", "default.optimistic.locking.failure")
-                    render(view:'edit',model:[assetInstance:assetInstance, possibleAssetSubItems: assetService.possibleAssetSubItems()])
-                    return
-                }
+
+        if(!assetInstance) {
+            flash.message = "Asset not found with id ${params.id}"
+            redirect(action:search)
+            return
+        }
+
+        if(params.version) {
+            def version = params.version.toLong()
+            if(assetInstance.version > version) {
+
+                assetInstance.errors.rejectValue("version", "default.optimistic.locking.failure")
+                render(view:'edit',model:[assetInstance:assetInstance,
+                                                            possibleAssetSubItems: assetService.possibleAssetSubItems(),
+                                                            parentPMs: taskService.getParentPMs(assetInstance)] )
+                return
             }
-
-            assetInstance.properties = params
-
-            use(WordUtils) {
-                assetInstance.name = assetInstance.name.capitalize()
-                assetInstance.description = assetInstance.description.capitalize()
-            }
-
-            assetInstance.setAssetSubItemsFromCheckBoxList(params.assetSubItems)
-
-            if(!assetInstance.hasErrors() && assetInstance.save(flush: true)) {
-                flash.message = "Asset '${assetInstance.name}' updated"
-                redirect(action:show,id:assetInstance.id)
-            }
-            else {
-                render(view:'edit',model:[assetInstance:assetInstance, possibleAssetSubItems: assetService.possibleAssetSubItems()])
-            }
+        }
+
+        assetInstance.properties = params
+
+        use(WordUtils) {
+            assetInstance.name = assetInstance.name.capitalize()
+            assetInstance.description = assetInstance.description.capitalize()
+        }
+
+        assetInstance.setAssetSubItemsFromCheckBoxList(params.assetSubItems)
+
+        if(!assetInstance.hasErrors() && assetInstance.save(flush: true)) {
+            flash.message = "Asset '${assetInstance.name}' updated"
+            redirect(action:show,id:assetInstance.id)
         }
         else {
-            flash.message = "Asset not found with id ${params.id}"
-            redirect(action:search)
-        }
+            render(view:'edit',model:[assetInstance:assetInstance,
+                                                        possibleAssetSubItems: assetService.possibleAssetSubItems(),
+                                                        parentPMs: taskService.getParentPMs(assetInstance)] )
+        }
+
     }
 
