Changeset 585 for trunk/grails-app
- Timestamp:
- Jun 8, 2010, 10:41:21 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/TaskDetailedController.groovy
r582 r585 10 10 def taskService 11 11 def taskSearchService 12 def taskReportService 12 13 def filterService 13 14 def exportService … … 197 198 params.max = Math.min( params.max ? params.max.toInteger() : 100, 1000 ) 198 199 200 def displayList = [] 199 201 def taskInstanceList = [] 200 202 def taskInstanceTotal … … 261 263 } 262 264 265 displayList = taskReportService.getWorkLoadSummary( 266 [taskInstanceList: taskInstanceList], RCU.getLocale(request) 267 ).displayList 268 263 269 // export plugin: 264 270 if(params?.format && params.format != "html") { … … 286 292 } 287 293 288 if(taskInstanceTotal > params.max)289 params.errorMessage = g.message(code:"task.search.calendar.text.too.many.results", args:[params.max])294 // if(taskInstanceTotal > params.max) 295 // params.errorMessage = g.message(code:"task.search.calendar.text.too.many.results", args:[params.max]) 290 296 291 297 // Add some basic params to filterParams. … … 293 299 filterParams.offset = params.offset?.toInteger() ?: 0 294 300 295 return[taskInstanceList: taskInstanceList, 301 return[displayList: displayList, 302 taskInstanceList: taskInstanceList, 296 303 taskInstanceTotal: taskInstanceTotal, 297 304 filterParams: filterParams, -
trunk/grails-app/services/TaskReportService.groovy
r545 r585 1 import org.gnumims.RichUiCalendarItem 1 2 2 3 /** … … 256 257 } // getImmediateCallouts() 257 258 259 /** 260 * Builds and returns a list of RichUiCalendarItem's. 261 * @param params The request params, may contain params to specify the search. 262 * @param locale The locale to use when generating result.message. 263 */ 264 def getWorkLoadSummary(params, locale) { 265 266 def result = [:] 267 result.displayList = [] 268 269 def listItem 270 271 def dayMap = [:] 272 def assignedGroupMap = [:] 273 274 params.taskInstanceList.each { task -> 275 def dayKey = task.targetStartDate /// @todo: make this key more stable. 276 def assignedTime = 0 277 278 task.assignedGroups.each{ assignedGroup -> 279 assignedTime = assignedGroup.estimatedHour*60 + assignedGroup.estimatedMinute 280 } 281 282 if(dayMap.containsKey(dayKey)) { 283 if(task.description) { 284 dayMap[dayKey] = dayMap[dayKey] + assignedTime 285 } 286 } 287 else { 288 dayMap[(dayKey)] = assignedTime 289 } 290 } 291 292 dayMap.each { k, v -> 293 listItem = new RichUiCalendarItem(date:k, text:('assignedTime: '+v.toString())) 294 result.displayList << listItem 295 } 296 297 // Success. 298 return result 299 300 } // getWorkLoadSummary() 258 301 259 302 } // end class -
trunk/grails-app/views/taskDetailed/searchCalendar.gsp
r570 r585 101 101 <br /> 102 102 103 <richui:calendarMonthView items="${taskInstanceList}" 104 createLink="true" 105 constraintDateFields="['targetStartDate']" 103 <richui:calendarMonthView items="${displayList}" 104 displayField="text" 105 createLink="false" 106 constraintDateFields="['date']" 106 107 month="${showDate}" 107 108 controller="taskDetailed"
Note: See TracChangeset
for help on using the changeset viewer.