Ignore:
Timestamp:
Dec 4, 2009, 2:05:27 PM (15 years ago)
Author:
gav
Message:

Replace personService.currentUser() with the more groovy personService.getCurrentUser() so that personService.currentUser can be called.

Location:
trunk/grails-app/controllers
Files:
3 edited

Legend:

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

    r185 r216  
    1717    */
    1818    def welcome = {
    19         def personInstance = personService.currentUser()
     19        def personInstance = personService.currentUser
    2020        flash.message = "Welcome, ${personInstance.firstName} ${personInstance.lastName}."
    2121
     
    3030    def changeSessionTimeout = {
    3131        if (request.method == 'GET') {
    32             def personInstance = personService.currentUser()
     32            def personInstance = personService.currentUser
    3333            return [ personInstance : personInstance ]       
    3434        }
    3535        if (request.method == 'POST') {
    36             def personInstance = personService.currentUser()
     36            def personInstance = personService.currentUser
    3737                personInstance.properties = params
    3838                if (!personInstance.hasErrors() && personInstance.save(flush: true)) {
     
    5353
    5454        if (request.method == 'GET') {
    55             def personInstance = personService.currentUser()
     55            def personInstance = personService.currentUser
    5656            return [ personInstance : personInstance ]       
    5757        }
    5858
    5959        if (request.method == 'POST') {
    60             def personInstance = personService.currentUser()
     60            def personInstance = personService.currentUser
    6161
    6262            if(params.confirmPass == params.pass) {
  • trunk/grails-app/controllers/EntryDetailedController.groovy

    r191 r216  
    2929        def entryInstance = Entry.get( params.id )
    3030        if(entryInstance) {
    31             if(entryInstance.enteredBy.loginName == personService.currentUser().loginName) {
     31            if(entryInstance.enteredBy.loginName == personService.currentUser.loginName) {
    3232                def taskID = entryInstance.task.id
    3333                entryInstance.delete(flush:true)
     
    5555        else {
    5656
    57             if(entryInstance.enteredBy.loginName == personService.currentUser().loginName) {
     57            if(entryInstance.enteredBy.loginName == personService.currentUser.loginName) {
    5858                return [ entryInstance : entryInstance ]
    5959            }
     
    7070        if(entryInstance) {
    7171            // 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) {
    7373                entryInstance.properties = params
    7474                if(!entryInstance.hasErrors() && entryInstance.save(flush: true)) {
  • trunk/grails-app/controllers/TaskDetailedController.groovy

    r214 r216  
    2828        if(!FilterUtils.isFilterApplied(params)) {
    2929            def taskInstanceList = []
    30             def personInstance = personService.currentUser()
     30            def personInstance = personService.currentUser
    3131
    3232            if(params.quickSearch == "searchMyTodays") {
     
    6767        if(!FilterUtils.isFilterApplied(params)) {
    6868            def taskInstanceList = []
    69             def personInstance = personService.currentUser()
     69            def personInstance = personService.currentUser
    7070
    7171            if(params.quickSearch == "searchMyTodays") {
     
    112112        if(!FilterUtils.isFilterApplied(params)) {
    113113            def taskInstanceList = []
    114             def personInstance = personService.currentUser()
     114            def personInstance = personService.currentUser
    115115
    116116            if(params.quickSearch == "budgetUnplanned") {
     
    416416
    417417        // Default leadPerson to current user, unless supplied in params.
    418         taskInstance.leadPerson = personService.currentUser()
     418        taskInstance.leadPerson = personService.currentUser
    419419        taskInstance.properties = params
    420420        return ['taskInstance': taskInstance]
Note: See TracChangeset for help on using the changeset viewer.