Changeset 165
- Timestamp:
- Oct 23, 2009, 1:00:23 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/application.properties
r151 r165 1 1 #utf-8 2 #Mon Oct 12 09:03:21 EST 2009 2 #Fri Oct 23 11:43:54 EST 2009 3 plugins.export=0.4 3 4 plugins.acegi=0.5.1 4 5 plugins.navigation=1.1 -
trunk/grails-app/conf/Config.groovy
r155 r165 19 19 css: 'text/css', 20 20 csv: 'text/csv', 21 pdf: 'application/pdf', 22 rtf: 'application/rtf', 23 excel: 'application/vnd.ms-excel', 24 ods: 'application/vnd.oasis.opendocument.spreadsheet', 21 25 all: '*/*', 22 26 json: ['application/json','text/json'], -
trunk/grails-app/controllers/TaskDetailedController.groovy
r155 r165 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 import org.codehaus.groovy.grails.commons.ConfigurationHolder 2 3 3 4 class TaskDetailedController extends BaseController { … … 7 8 def taskSearchService 8 9 def filterService 10 def exportService 9 11 10 12 // the delete, save and update actions only accept POST requests … … 102 104 return[ taskInstanceList: filterService.filter( params, Task ), 103 105 taskInstanceTotal: taskInstanceTotal, 106 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 107 params:params ] 108 } 109 110 def budget = { 111 // println params 112 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100 ) 113 114 // Quick Search: 115 if(!params.filter) 116 { 117 def taskInstanceList = [] 118 def personInstance = Person.get(authenticateService.userDomain().id) 119 120 if(params.quickSearch == "budgetUnplanned") { 121 taskInstanceList = taskSearchService.getBudgetUnplanned(params) 122 if(taskInstanceList.totalCount > 0) { params.message = "Budget unplanned tasks in the last week." } 123 else { params.message = "No tasks found." } 124 } 125 //else if(params.quickSearch == "budgetPlanned") { 126 else { 127 //Default: 128 taskInstanceList = taskSearchService.getBudgetPlanned(params) 129 if(taskInstanceList.totalCount > 0) { params.message = "Budget planned Tasks in the last week." } 130 else { params.message = "No tasks found.." } 131 } 132 // export plugin: 133 if(params?.format && params.format != "html") { 134 response.contentType = ConfigurationHolder.config.grails.mime.types[params.format] 135 response.setHeader("Content-disposition", "attachment; filename=tasks.${params.extension}") 136 List fields = ["id", "targetStartDate", "description", "leadPerson", "taskStatus", "taskType"] 137 Map labels = ["id": "ID", "targetStartDate": "Target Start Date", "description": "Description", 138 "leadPerson": "Lead Person", "taskStatus": "Task Status", "taskType": "Task Type"] 139 Map formatters = [:] 140 String title = "${params.quickSearch} tasks in the last week." 141 Map parameters = [title: title] 142 143 exportService.export(params.format, response.outputStream, taskInstanceList, fields, labels, formatters, parameters) 144 } 145 return[taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceList.totalCount, filterParams: params] 146 } 147 // filterPane: 148 return[ taskInstanceList: filterService.filter( params, Task ), 149 taskInstanceTotal: filterService.count( params, Task ), 104 150 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 105 151 params:params ] -
trunk/grails-app/services/TaskSearchService.groovy
r144 r165 76 76 } 77 77 } 78 79 def getBudgetPlanned(params) { 80 params.max = Math.min(params?.max?.toInteger() ?: 10, 100) 81 params.offset = params?.offset?.toInteger() ?: 0 82 params.sort = params?.sort ?: "id" 83 params.order = params?.order ?: "desc" 84 85 def taskInstanceList = Task.createCriteria().list( 86 max: params.max, 87 offset: params.offset, 88 sort: params.sort, 89 order: params.order) { 90 ne("taskType", TaskType.findByName("Unscheduled Breakin")) 91 ge("targetStartDate", dateUtilService.getToday()-7) 92 lt("targetStartDate", dateUtilService.getTomorrow()) 93 eq("isActive", true) 94 } 95 } 96 97 def getBudgetUnplanned(params) { 98 params.max = Math.min(params?.max?.toInteger() ?: 10, 100) 99 params.offset = params?.offset?.toInteger() ?: 0 100 params.sort = params?.sort ?: "id" 101 params.order = params?.order ?: "desc" 102 103 def taskInstanceList = Task.createCriteria().list( 104 max: params.max, 105 offset: params.offset, 106 sort: params.sort, 107 order: params.order) { 108 eq("taskType", TaskType.findByName("Unscheduled Breakin")) 109 ge("targetStartDate", dateUtilService.getToday()-7) 110 lt("targetStartDate", dateUtilService.getTomorrow()) 111 eq("isActive", true) 112 } 113 } 78 114 } -
trunk/grails-app/views/appCore/manager.gsp
r147 r165 29 29 <tr class="prop"> 30 30 <td valign="top" class="name"> 31 <label>Budget:</label> 32 </td> 33 <td valign="top" class="value"> 34 <g:link controller="taskDetailed" 35 action="budget" 36 params="[quickSearch: 'budgetPlanned']"> 37 Planned Tasks 38 </g:link> 39 <br /> 40 <g:link controller="taskDetailed" 41 action="budget" 42 params="[quickSearch: 'budgetUnplanned']"> 43 Unplanned Tasks 44 </g:link> 45 </td> 46 </tr> 47 48 <tr class="prop"> 49 <td valign="top" class="name"> 31 50 <label>Entity Relationship Diagram:</label> 32 51 </td>
Note: See TracChangeset
for help on using the changeset viewer.