Changeset 144 for trunk/grails-app/controllers
- Timestamp:
- Oct 3, 2009, 4:05:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/TaskDetailedController.groovy
r143 r144 19 19 20 20 def search = { 21 // println params 21 22 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100 ) 22 23 24 // Search urls: 23 25 if(!params.filter) 24 26 { 25 // if(params.searchMyTodays) { def taskInstanceList = taskSearchService.getMyTodays(params) } 26 // else { def taskInstanceList = taskSearchService.getTodays(params) } 27 28 def taskInstanceList = taskSearchService.getTodays(params) 29 30 if(taskInstanceList.totalCount > 0) { params.message = "Today's tasks" } 31 else { params.message = "No tasks found for today" } 27 def taskInstanceList = [] 28 def personInstance = Person.get(authenticateService.userDomain().id) 29 30 if(params.searchMyTodays) { 31 taskInstanceList = taskSearchService.getMyTodays(params) 32 if(taskInstanceList.totalCount > 0) { params.message = "Today's tasks for ${personInstance.firstName} ${personInstance.lastName}." } 33 else { params.message = "No tasks found for today." } 34 } 35 else if(params.searchInTheLastWeek) { 36 taskInstanceList = taskSearchService.getInTheLastWeek(params) 37 if(taskInstanceList.totalCount > 0) { params.message = "Tasks with Target Start Date in the last week." } 38 else { params.message = "No tasks found for today." } 39 } 40 else if(params.searchMyInTheLastWeek) { 41 taskInstanceList = taskSearchService.getMyInTheLastWeek(params) 42 if(taskInstanceList.totalCount > 0) { params.message = "Tasks with Target Start Date in the last week for ${personInstance.firstName} ${personInstance.lastName}." } 43 else { params.message = "No tasks found for today." } 44 } 45 else { 46 //Default: 47 taskInstanceList = taskSearchService.getTodays(params) 48 if(taskInstanceList.totalCount > 0) { params.message = "Today's tasks." } 49 else { params.message = "No tasks found for today." } 50 } 51 32 52 return[ taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceList.totalCount] 33 53 }
Note: See TracChangeset
for help on using the changeset viewer.