Changeset 573


Ignore:
Timestamp:
Jun 7, 2010, 12:33:16 PM (10 years ago)
Author:
gav
Message:

Small correction to MaintenanceActionController, since there is no list view.

File:
1 edited

Legend:

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

    r403 r573  
    88
    99    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser'])
    10     def index = { redirect(action:list,params:params) }
    11 
    12     @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser'])
    13     def list = {
    14         params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
    15         [ maintenanceActionInstanceList: MaintenanceAction.list( params ), maintenanceActionInstanceTotal: MaintenanceAction.count() ]
    16     }
    17 
    18     @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser'])
    1910    def show = {
    2011        def maintenanceActionInstance = MaintenanceAction.get( params.id )
     
    2213        if(!maintenanceActionInstance) {
    2314            flash.message = "MaintenanceAction not found with id ${params.id}"
    24             redirect(action:list)
     15            redirect(controller: "appCore", action:"start")
    2516        }
    2617        else { return [ maintenanceActionInstance : maintenanceActionInstance ] }
     
    3122        if(maintenanceActionInstance) {
    3223            try {
     24                def taskProcedure = maintenanceActionInstance.taskProcedure
    3325                maintenanceActionInstance.delete(flush:true)
    3426                flash.message = "MaintenanceAction ${params.id} deleted"
    35                 redirect(action:list)
     27                redirect(controller: "taskProcedureDetailed", action:"show", id:taskProcedure.id)
    3628            }
    3729            catch(org.springframework.dao.DataIntegrityViolationException e) {
     
    4234        else {
    4335            flash.message = "MaintenanceAction not found with id ${params.id}"
    44             redirect(action:list)
     36            redirect(controller: "appCore", action:"start")
    4537        }
    4638    }
     
    5143        if(!maintenanceActionInstance) {
    5244            flash.message = "MaintenanceAction not found with id ${params.id}"
    53             redirect(action:list)
     45            redirect(controller: "appCore", action:"start")
    5446        }
    5547        else {
     
    8173        else {
    8274            flash.message = "MaintenanceAction not found with id ${params.id}"
    83             redirect(action:list)
     75            redirect(controller: "appCore", action:"start")
    8476        }
    8577    }
Note: See TracChangeset for help on using the changeset viewer.