Changeset 216
- Timestamp:
- Dec 4, 2009, 2:05:27 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/AppCoreController.groovy
r185 r216 17 17 */ 18 18 def welcome = { 19 def personInstance = personService.currentUser ()19 def personInstance = personService.currentUser 20 20 flash.message = "Welcome, ${personInstance.firstName} ${personInstance.lastName}." 21 21 … … 30 30 def changeSessionTimeout = { 31 31 if (request.method == 'GET') { 32 def personInstance = personService.currentUser ()32 def personInstance = personService.currentUser 33 33 return [ personInstance : personInstance ] 34 34 } 35 35 if (request.method == 'POST') { 36 def personInstance = personService.currentUser ()36 def personInstance = personService.currentUser 37 37 personInstance.properties = params 38 38 if (!personInstance.hasErrors() && personInstance.save(flush: true)) { … … 53 53 54 54 if (request.method == 'GET') { 55 def personInstance = personService.currentUser ()55 def personInstance = personService.currentUser 56 56 return [ personInstance : personInstance ] 57 57 } 58 58 59 59 if (request.method == 'POST') { 60 def personInstance = personService.currentUser ()60 def personInstance = personService.currentUser 61 61 62 62 if(params.confirmPass == params.pass) { -
trunk/grails-app/controllers/EntryDetailedController.groovy
r191 r216 29 29 def entryInstance = Entry.get( params.id ) 30 30 if(entryInstance) { 31 if(entryInstance.enteredBy.loginName == personService.currentUser ().loginName) {31 if(entryInstance.enteredBy.loginName == personService.currentUser.loginName) { 32 32 def taskID = entryInstance.task.id 33 33 entryInstance.delete(flush:true) … … 55 55 else { 56 56 57 if(entryInstance.enteredBy.loginName == personService.currentUser ().loginName) {57 if(entryInstance.enteredBy.loginName == personService.currentUser.loginName) { 58 58 return [ entryInstance : entryInstance ] 59 59 } … … 70 70 if(entryInstance) { 71 71 // The update method only accepts post requests, so this is just in case. 72 if(entryInstance.enteredBy.loginName == personService.currentUser ().loginName) {72 if(entryInstance.enteredBy.loginName == personService.currentUser.loginName) { 73 73 entryInstance.properties = params 74 74 if(!entryInstance.hasErrors() && entryInstance.save(flush: true)) { -
trunk/grails-app/controllers/TaskDetailedController.groovy
r214 r216 28 28 if(!FilterUtils.isFilterApplied(params)) { 29 29 def taskInstanceList = [] 30 def personInstance = personService.currentUser ()30 def personInstance = personService.currentUser 31 31 32 32 if(params.quickSearch == "searchMyTodays") { … … 67 67 if(!FilterUtils.isFilterApplied(params)) { 68 68 def taskInstanceList = [] 69 def personInstance = personService.currentUser ()69 def personInstance = personService.currentUser 70 70 71 71 if(params.quickSearch == "searchMyTodays") { … … 112 112 if(!FilterUtils.isFilterApplied(params)) { 113 113 def taskInstanceList = [] 114 def personInstance = personService.currentUser ()114 def personInstance = personService.currentUser 115 115 116 116 if(params.quickSearch == "budgetUnplanned") { … … 416 416 417 417 // Default leadPerson to current user, unless supplied in params. 418 taskInstance.leadPerson = personService.currentUser ()418 taskInstance.leadPerson = personService.currentUser 419 419 taskInstance.properties = params 420 420 return ['taskInstance': taskInstance] -
trunk/grails-app/services/PersonService.groovy
r198 r216 13 13 * @returns The current user or the 'system' person (Person #1) if userDomain() is not active. 14 14 */ 15 def currentUser() {15 def getCurrentUser() { 16 16 if(authenticateService.userDomain()) { 17 17 return Person.get(authenticateService.userDomain().id) -
trunk/grails-app/services/TaskService.groovy
r208 r216 46 46 47 47 if(taskInstance.save()) { 48 def taskModification = new TaskModification(person: personService.currentUser (),48 def taskModification = new TaskModification(person: personService.currentUser, 49 49 taskModificationType: TaskModificationType.get(1), 50 50 task: taskInstance) … … 119 119 def result = [:] 120 120 result.entryInstance = new Entry(params) 121 result.entryInstance.enteredBy = personService.currentUser ()121 result.entryInstance.enteredBy = personService.currentUser 122 122 123 123 if(result.entryInstance.validate()) { … … 143 143 144 144 // Create the "Started" task modification, this provides the "Actual started date". 145 def taskModification = new TaskModification(person: personService.currentUser (),145 def taskModification = new TaskModification(person: personService.currentUser, 146 146 taskModificationType: TaskModificationType.get(2), 147 147 task: taskInstance) … … 215 215 return fail() 216 216 217 def taskModification = new TaskModification(person:personService.currentUser (),217 def taskModification = new TaskModification(person:personService.currentUser, 218 218 taskModificationType: TaskModificationType.get(3), 219 219 task: result.taskInstance) … … 254 254 255 255 if(result.taskInstance.save()) { 256 def taskModification = new TaskModification(person:personService.currentUser (),256 def taskModification = new TaskModification(person:personService.currentUser, 257 257 taskModificationType: TaskModificationType.get(4), 258 258 task: result.taskInstance) … … 303 303 304 304 if(result.taskInstance.save()) { 305 def taskModification = new TaskModification(person:personService.currentUser (),305 def taskModification = new TaskModification(person:personService.currentUser, 306 306 taskModificationType: TaskModificationType.get(5), 307 307 task: result.taskInstance) … … 352 352 353 353 if(result.taskInstance.save()) { 354 def taskModification = new TaskModification(person:personService.currentUser (),354 def taskModification = new TaskModification(person:personService.currentUser, 355 355 taskModificationType: TaskModificationType.get(6), 356 356 task: result.taskInstance) … … 400 400 401 401 if(result.taskInstance.save()) { 402 def taskModification = new TaskModification(person:personService.currentUser (),402 def taskModification = new TaskModification(person:personService.currentUser, 403 403 taskModificationType: TaskModificationType.get(7), 404 404 task: result.taskInstance) … … 448 448 449 449 if(result.taskInstance.save()) { 450 def taskModification = new TaskModification(person:personService.currentUser (),450 def taskModification = new TaskModification(person:personService.currentUser, 451 451 taskModificationType: TaskModificationType.get(8), 452 452 task: result.taskInstance) … … 496 496 497 497 if(result.taskInstance.save()) { 498 def taskModification = new TaskModification(person:personService.currentUser (),498 def taskModification = new TaskModification(person:personService.currentUser, 499 499 taskModificationType: TaskModificationType.get(9), 500 500 task: result.taskInstance)
Note: See TracChangeset
for help on using the changeset viewer.