Changeset 573 for trunk/grails-app/controllers
- Timestamp:
- Jun 7, 2010, 12:33:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/MaintenanceActionDetailedController.groovy
r403 r573 8 8 9 9 @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'])19 10 def show = { 20 11 def maintenanceActionInstance = MaintenanceAction.get( params.id ) … … 22 13 if(!maintenanceActionInstance) { 23 14 flash.message = "MaintenanceAction not found with id ${params.id}" 24 redirect( action:list)15 redirect(controller: "appCore", action:"start") 25 16 } 26 17 else { return [ maintenanceActionInstance : maintenanceActionInstance ] } … … 31 22 if(maintenanceActionInstance) { 32 23 try { 24 def taskProcedure = maintenanceActionInstance.taskProcedure 33 25 maintenanceActionInstance.delete(flush:true) 34 26 flash.message = "MaintenanceAction ${params.id} deleted" 35 redirect( action:list)27 redirect(controller: "taskProcedureDetailed", action:"show", id:taskProcedure.id) 36 28 } 37 29 catch(org.springframework.dao.DataIntegrityViolationException e) { … … 42 34 else { 43 35 flash.message = "MaintenanceAction not found with id ${params.id}" 44 redirect( action:list)36 redirect(controller: "appCore", action:"start") 45 37 } 46 38 } … … 51 43 if(!maintenanceActionInstance) { 52 44 flash.message = "MaintenanceAction not found with id ${params.id}" 53 redirect( action:list)45 redirect(controller: "appCore", action:"start") 54 46 } 55 47 else { … … 81 73 else { 82 74 flash.message = "MaintenanceAction not found with id ${params.id}" 83 redirect( action:list)75 redirect(controller: "appCore", action:"start") 84 76 } 85 77 }
Note: See TracChangeset
for help on using the changeset viewer.