- Timestamp:
- Jan 12, 2010, 1:09:03 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/TaskDetailedController.groovy
r253 r260 22 22 } 23 23 24 def setTaskSearchParamsMax = { 25 if(params.newMax.isInteger()) 26 def i = params.newMax.toInteger() 27 if(params.newMax.toInteger() > 0) 28 session.taskSearchParamsMax = params.newMax 29 params.max = params.newMax 30 forward(action: 'search', params: params) 31 } 32 24 33 def search = { 25 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100 ) 34 35 if(session.taskSearchParamsMax) 36 params.max = session.taskSearchParamsMax 37 38 // TaskSearchService protects itself but filterPane does not. 39 params.max = Math.min( params.max ? params.max.toInteger() : 10, 99999 ) 40 41 def taskInstanceList = [] 42 def taskInstanceTotal 43 def filterParams = [:] 44 def personInstance = personService.currentUser 26 45 27 46 // Quick Search: 28 47 if(!FilterUtils.isFilterApplied(params)) { 29 def taskInstanceList = []30 def personInstance = personService.currentUser31 48 32 49 if(params.quickSearch == "searchMyTodays") { … … 52 69 params.quickSearch = "searchTodays" 53 70 } 54 return[taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceList.totalCount, filterParams: params] 55 } 56 // filterPane: 57 return[ taskInstanceList: filterService.filter( params, Task ), 58 taskInstanceTotal: filterService.count( params, Task ), 59 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 60 params:params ] 61 } 71 72 taskInstanceTotal = taskInstanceList.totalCount 73 filterParams.quickSearch = params.quickSearch 74 } 75 else { 76 // filterPane: 77 taskInstanceList = filterService.filter( params, Task ) 78 taskInstanceTotal = filterService.count( params, Task ) 79 filterParams = com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params) 80 } 81 82 // export plugin: 83 if(params?.format && params.format != "html") { 84 85 def dateFmt = { date -> 86 formatDate(format: "EEE, dd-MMM-yyyy", date: date) 87 } 88 89 String title 90 if(params.quickSearch) 91 title = "${params.quickSearch} tasks." 92 else 93 title = "Filtered tasks." 94 95 response.contentType = ConfigurationHolder.config.grails.mime.types[params.format] 96 response.setHeader("Content-disposition", "attachment; filename=tasks.${params.extension}") 97 List fields = ["id", "targetStartDate", "description", "leadPerson", "taskPriority", "taskStatus"] 98 Map labels = ["id": "ID", "targetStartDate": "Target Start Date", "description": "Description", 99 "leadPerson": "Lead Person", "taskPriority": "Task Priority", "taskStatus": "Task Status"] 100 Map formatters = [ targetStartDate: dateFmt] 101 Map parameters = [title: title, separator: ","] 102 103 exportService.export(params.format, response.outputStream, taskInstanceList, fields, labels, formatters, parameters) 104 } 105 106 // Add some basic params to filterParams. 107 filterParams.max = params.max 108 filterParams.offset = params.offset?.toInteger() ?: 0 109 filterParams.sort = params.sort ?: "id" 110 filterParams.order = params.order ?: "desc" 111 112 return[ taskInstanceList: taskInstanceList, 113 taskInstanceTotal: taskInstanceTotal, 114 filterParams: filterParams ] 115 116 } // end search() 62 117 63 118 def searchCalendar = { … … 128 183 // export plugin: 129 184 if(params?.format && params.format != "html") { 185 186 def dateFmt = { date -> 187 formatDate(format: "EEE, dd-MMM-yyyy", date: date) 188 } 130 189 response.contentType = ConfigurationHolder.config.grails.mime.types[params.format] 131 190 response.setHeader("Content-disposition", "attachment; filename=tasks.${params.extension}") … … 133 192 Map labels = ["id": "ID", "targetStartDate": "Target Start Date", "description": "Description", 134 193 "leadPerson": "Lead Person", "taskStatus": "Task Status", "taskType": "Task Type"] 135 Map formatters = [ :]194 Map formatters = [ targetStartDate: dateFmt] 136 195 String title = "${params.quickSearch} tasks in the last week." 137 Map parameters = [title: title ]196 Map parameters = [title: title, separator: ","] 138 197 139 198 exportService.export(params.format, response.outputStream, taskInstanceList, fields, labels, formatters, parameters) -
trunk/grails-app/services/TaskSearchService.groovy
r252 r260 6 6 def authenticateService 7 7 8 def paramsMax = 99999 9 8 10 def getTodays(params) { 9 params.max = Math.min(params?.max?.toInteger() ?: 10, 100)11 params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax) 10 12 params.offset = params?.offset?.toInteger() ?: 0 11 13 params.sort = params?.sort ?: "id" … … 24 26 25 27 def getMyTodays(params) { 26 params.max = Math.min(params?.max?.toInteger() ?: 10, 100)28 params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax) 27 29 params.offset = params?.offset?.toInteger() ?: 0 28 30 params.sort = params?.sort ?: "id" … … 42 44 43 45 def getInTheLastWeek(params) { 44 params.max = Math.min(params?.max?.toInteger() ?: 10, 100)46 params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax) 45 47 params.offset = params?.offset?.toInteger() ?: 0 46 48 params.sort = params?.sort ?: "id" … … 59 61 60 62 def getMyInTheLastWeek(params) { 61 params.max = Math.min(params?.max?.toInteger() ?: 10, 100)63 params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax) 62 64 params.offset = params?.offset?.toInteger() ?: 0 63 65 params.sort = params?.sort ?: "id" … … 77 79 78 80 def getBudgetPlanned(params) { 79 params.max = Math.min(params?.max?.toInteger() ?: 10, 100)81 params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax) 80 82 params.offset = params?.offset?.toInteger() ?: 0 81 83 params.sort = params?.sort ?: "id" … … 95 97 96 98 def getBudgetUnplanned(params) { 97 params.max = Math.min(params?.max?.toInteger() ?: 10, 100)99 params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax) 98 100 params.offset = params?.offset?.toInteger() ?: 0 99 101 params.sort = params?.sort ?: "id" -
trunk/grails-app/views/appCore/appAdmin.gsp
r258 r260 79 79 <div class="dialog"> 80 80 <ul> 81 <g:each var="c" in="${grailsApplication.controllerClasses }">81 <g:each var="c" in="${grailsApplication.controllerClasses.sort { p1, p2 -> p1.fullName.compareToIgnoreCase(p2.fullName) } }"> 82 82 <li class="controller"><g:link controller="${c.logicalPropertyName}">${c.fullName}</g:link></li> 83 83 </g:each>
Note: See TracChangeset
for help on using the changeset viewer.