Changeset 133 for trunk/grails-app/controllers
- Timestamp:
- May 8, 2009, 11:51:25 PM (16 years ago)
- Location:
- trunk/grails-app/controllers
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/MaintenanceActionDetailedController.groovy
r132 r133 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 3 class MaintenanceActionDetailedController extends Base AppAdminController {3 class MaintenanceActionDetailedController extends BaseController { 4 4 5 5 def index = { redirect(action:list,params:params) } -
trunk/grails-app/controllers/TaskDetailedController.groovy
r131 r133 20 20 } 21 21 22 // def show = { 23 // def taskInstance = Task.get( params.id ) 24 // 25 // if(!taskInstance) { 26 // flash.message = "Task not found with id ${params.id}" 27 // redirect(action:list) 28 // } 29 // else { 30 // def taskProcedureInstance = TaskProcedure.get(taskInstance?.taskProcedure?.id) 31 // return [ taskInstance : taskInstance, taskProcedureInstance: taskProcedureInstance] 32 // 33 // } 34 // } 35 22 36 def show = { 23 37 def taskInstance = Task.get( params.id ) … … 27 41 redirect(action:list) 28 42 } 29 else { 30 def taskProcedureInstance = TaskProcedure.get(taskInstance?.taskProcedure?.id) 31 return [ taskInstance : taskInstance, taskProcedureInstance: taskProcedureInstance] 43 else { 44 def taskProcedureInstance = TaskProcedure.get(taskInstance.taskProcedure?.id) 45 def taskProcedureExits = new Boolean("true") 46 def showTaskTab = new String("true") 32 47 48 if(!taskProcedureInstance) { 49 taskProcedureExits = false 50 } 51 return [ taskInstance : taskInstance, 52 taskProcedureInstance: taskProcedureInstance, 53 taskProcedureExits: taskProcedureExits, 54 showTaskTab: showTaskTab] 33 55 } 34 56 } … … 114 136 } 115 137 } 138 139 //Generate a new TaskProcedure for a taskInstance. 140 def generateProcedure = { 141 def taskProcedureInstance = new TaskProcedure() 142 taskProcedureInstance.properties = params 143 144 def taskInstance = Task.get(params.taskInstance.id) 145 def taskProcedureExits = new Boolean("true") 146 def showProcedureTab = new String("true") 147 148 if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save()) { 149 taskProcedureInstance.addToTasks(taskInstance) 150 flash.message = "Procedure created, you can now add steps to the procedure" 151 // redirect(action:show, id:params.taskInstance.id) 152 } 153 else { 154 taskProcedureExits = false 155 } 156 157 render(view:'show',model:[ taskInstance : taskInstance, 158 taskProcedureInstance: taskProcedureInstance, 159 taskProcedureExits: taskProcedureExits, 160 showProcedureTab: showProcedureTab]) 161 } 162 163 def findProcedure = { 164 redirect(controller:"taskProcedureDetailed", action:"list", id:params.taskInstance.id) 165 } 166 116 167 }
Note: See TracChangeset
for help on using the changeset viewer.