Changeset 124 for trunk/grails-app/controllers
- Timestamp:
- May 4, 2009, 1:59:11 PM (16 years ago)
- Location:
- trunk/grails-app/controllers
- Files:
-
- 1 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/AssetDetailedController.groovy
r122 r124 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 3 class Asset Controller extends BaseAppAdminController {3 class AssetDetailedController extends BaseController { 4 4 5 5 def index = { redirect(action:list,params:params) } -
trunk/grails-app/controllers/AssetExtendedAttributeDetailedController.groovy
r122 r124 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 3 class AssetExtendedAttribute Controller extends BaseAppAdminController {3 class AssetExtendedAttributeDetailedController extends BaseController { 4 4 5 5 def index = { redirect(action:list,params:params) } -
trunk/grails-app/controllers/MaintenanceActionDetailedController.groovy
r122 r124 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 3 class MaintenanceAction Controller extends BaseAppAdminController {3 class MaintenanceActionDetailedController extends BaseController { 4 4 5 5 def index = { redirect(action:list,params:params) } … … 82 82 83 83 def create = { 84 def maintenanceActionInstance = new MaintenanceAction() 85 maintenanceActionInstance.properties = params 86 return ['maintenanceActionInstance':maintenanceActionInstance] 84 try { 85 def plannedMaintenanceInstance = PlannedMaintenance.get(params.plannedMaintenanceInstance.id) 86 def maintenanceActionInstance = new MaintenanceAction() 87 maintenanceActionInstance.plannedMaintenance = plannedMaintenanceInstance 88 return ['maintenanceActionInstance':maintenanceActionInstance] 89 } 90 catch(Exception e) { 91 flash.message = "Please select a PlannedMaintenance, then 'Add action'" 92 redirect(controller:"plannedMaintenanceDetailed", action:"list") 93 } 87 94 } 88 95 … … 91 98 if(!maintenanceActionInstance.hasErrors() && maintenanceActionInstance.save()) { 92 99 flash.message = "MaintenanceAction ${maintenanceActionInstance.id} created" 93 redirect( action:show,id:maintenanceActionInstance.id)100 redirect(controller:"plannedMaintenanceDetailed", action:"show", id: params.plannedMaintenance.id) 94 101 } 95 102 else { -
trunk/grails-app/controllers/PlannedMaintenanceDetailedController.groovy
r122 r124 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 3 class PlannedMaintenance Controller extends BaseAppAdminController {3 class PlannedMaintenanceDetailedController extends BaseController { 4 4 5 5 def index = { redirect(action:list,params:params) } … … 14 14 15 15 def show = { 16 // Use this to return a list of the maintenanceActions 17 // def list = { 18 // params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 19 // [ maintenanceActionInstanceList: MaintenanceAction.list( params ), maintenanceActionInstanceTotal: MaintenanceAction.count() ] 20 // } 16 21 def plannedMaintenanceInstance = PlannedMaintenance.get( params.id ) 17 22 -
trunk/grails-app/controllers/RecurringScheduleDetailedController.groovy
r122 r124 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 3 class RecurringSchedule Controller extends BaseAppAdminController {3 class RecurringScheduleDetailedController extends BaseController { 4 4 5 5 def index = { redirect(action:list,params:params) } -
trunk/grails-app/controllers/SystemSectionDetailedController.groovy
r122 r124 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 3 class SystemSection Controller extends BaseAppAdminController {3 class SystemSectionDetailedController extends BaseController { 4 4 5 5 def index = { redirect(action:list,params:params) } -
trunk/grails-app/controllers/TaskDetailedController.groovy
r106 r124 8 8 static allowedMethods = [delete:'POST', save:'POST', update:'POST'] 9 9 10 // def list = { 11 // params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 12 // def taskInstanceActives = Task.findAllByIsActive( true ).list( params ) 13 // // def taskInstanceList = taskInstanceActives.list( params ) 14 // return [ taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceActives.count() ] 15 // } 16 10 17 def list = { 11 18 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 12 def taskInstanceList = Task.findAllByIsActive( true ) 13 return [ taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceList.count() ] 19 [ taskInstanceList: Task.list( params ), taskInstanceTotal: Task.count() ] 14 20 } 15 21
Note: See TracChangeset
for help on using the changeset viewer.