Changeset 684


Ignore:
Timestamp:
Oct 6, 2010, 12:48:17 AM (9 years ago)
Author:
gav
Message:

Change flow of asset and assetSubItem extendedAttribute controllers to return to show views after edit/update or delete.

Location:
trunk/grails-app/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/AssetExtendedAttributeDetailedController.groovy

    r656 r684  
    2222        def assetExtendedAttributeInstance = AssetExtendedAttribute.get( params.id )
    2323        if(assetExtendedAttributeInstance) {
     24            def asset = assetExtendedAttributeInstance.asset
    2425            try {
    2526                assetExtendedAttributeInstance.delete(flush:true)
    2627                flash.message = "AssetExtendedAttribute ${params.id} deleted"
    27                 redirect(controller: "assetDetailed", action: "search")
     28                redirect(controller: "assetDetailed", action: 'show', id: asset.id)
    2829            }
    2930            catch(org.springframework.dao.DataIntegrityViolationException e) {
     
    6566            if(!assetExtendedAttributeInstance.hasErrors() && assetExtendedAttributeInstance.save(flush: true)) {
    6667                flash.message = "AssetExtendedAttribute ${params.id} updated"
    67                 redirect(action:show,id:assetExtendedAttributeInstance.id)
     68                //redirect(action:show,id:assetExtendedAttributeInstance.id)
     69                redirect(controller: 'assetDetailed', action: 'show', id: assetExtendedAttributeInstance.asset.id)
    6870            }
    6971            else {
  • trunk/grails-app/controllers/AssetSubItemExtendedAttributeDetailedController.groovy

    r663 r684  
    2222        def assetSubItemExtendedAttributeInstance = AssetSubItemExtendedAttribute.get( params.id )
    2323        if(assetSubItemExtendedAttributeInstance) {
     24            def assetSubItem = assetSubItemExtendedAttributeInstance.assetSubItem
    2425            try {
    2526                assetSubItemExtendedAttributeInstance.delete(flush:true)
    2627                flash.message = "AssetSubItemExtendedAttribute ${params.id} deleted"
    27                 redirect(controller: "assetDetailed", action: "search")
     28                redirect(controller: "assetSubItemDetailed", action: 'show', id: assetSubItem.id)
    2829            }
    2930            catch(org.springframework.dao.DataIntegrityViolationException e) {
     
    6566            if(!assetSubItemExtendedAttributeInstance.hasErrors() && assetSubItemExtendedAttributeInstance.save(flush: true)) {
    6667                flash.message = "AssetSubItemExtendedAttribute ${params.id} updated"
    67                 redirect(action:show,id:assetSubItemExtendedAttributeInstance.id)
     68                //redirect(action:show,id:assetSubItemExtendedAttributeInstance.id)
     69                redirect(controller: 'assetSubItemDetailed', action: 'show', id: assetSubItemExtendedAttributeInstance.assetSubItem.id)
    6870            }
    6971            else {
Note: See TracChangeset for help on using the changeset viewer.