Changeset 490
- Timestamp:
- Apr 18, 2010, 10:03:40 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/TaskDetailedController.groovy
r488 r490 748 748 749 749 } 750 751 /** 752 * Render a users total work done hours. 753 */ 754 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_TaskManager', 'ROLE_TaskUser']) 755 def workDone = { 756 def result = taskSearchService.getWorkDone(params, RCU.getLocale(request)) 757 758 params.message = result.message 759 760 return[entries: result.entries, 761 totalEntries : result.totalEntries, 762 startOfDay: result.startOfDay, 763 person: result.person, 764 totalHours: result.totalHours, 765 totalMinutes: result.totalMinutes] 766 } // workDone 750 767 751 768 /** -
trunk/grails-app/i18n/messages.properties
r489 r490 288 288 task.search.text.planners.range.none.found=No tasks found in the past week or two weeks ahead. 289 289 task.search.calendar.text.too.many.results=Too many results, only {0} are shown. 290 task.search.text.work.done=Work Done 291 task.search.text.work.done.none.found=No entries found for {0} on {1}. 292 task.search.text.work.done.description=Work done by person and date. 293 task.search.text.work.done.message=Work done by {0} on {1}. 290 294 291 295 # InventoryItemSearch -
trunk/grails-app/services/TaskSearchService.groovy
r483 r490 11 11 def dateUtilService 12 12 def messageSource 13 14 def g = new org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib() 13 15 14 16 def paramsMax = 100000 … … 317 319 } // createCriteria 318 320 } 319 } 321 322 /** 323 * Get work done by person and date. 324 * A person ID and date may be specified in params otherwise the currentUser and today are used. 325 * @param params The request params. 326 * @returns A map containing entries, totalEntries, startOfDay, person, totalHours, totalMinutes. 327 */ 328 def getWorkDone(params, locale) { 329 def result = [:] 330 result.person = params.person?.id ? Person.get(params.person.id.toInteger()) : authService.currentUser 331 332 if(params.date_year && params.date_month && params.date_day) 333 result.startOfDay = dateUtilService.makeDate(params.date_year, params.date_month, params.date_day) 334 else 335 result.startOfDay = dateUtilService.today 336 337 result.startOfNextDay = result.startOfDay + 1 338 339 def formattedStartOfDay = g.formatDate(format: "EEE, dd-MMM-yyyy", date: result.startOfDay) 340 341 def getMessage = { Map m -> 342 messageSource.getMessage(m.code, m.args == null ? null : m.args.toArray(), locale) 343 } 344 345 result.entries = Entry.createCriteria().list() { 346 eq("enteredBy", result.person) 347 ge("dateDone", result.startOfDay) 348 lt("dateDone", result.startOfNextDay) 349 entryType { 350 eq("id", 3L) 351 } 352 } // createCriteria 353 354 result.totalEntries = result.entries.size() 355 356 if(result.totalEntries > 0) 357 result.message = getMessage(code:"task.search.text.work.done.message", 358 args:[result.person, formattedStartOfDay]) 359 else 360 result.message = getMessage(code:"task.search.text.work.done.none.found", 361 args:[result.person, formattedStartOfDay]) 362 363 result.totalHours = 0 364 result.totalMinutes = 0 365 result.entries.each() { 366 result.totalMinutes += (it.durationHour*60) + it.durationMinute 367 } 368 result.totalHours = (result.totalMinutes / 60).toInteger() 369 result.totalMinutes = result.totalMinutes % 60 370 371 return result 372 } 373 374 } // end class -
trunk/grails-app/views/taskDetailed/_quickSearchPane.gsp
r479 r490 93 93 </tr> 94 94 95 <tr class="prop"> 96 <td valign="top" class="name"> 97 <label>Links:</label> 98 </td> 99 <td valign="top" class="value"> 100 <g:link controller="taskDetailed" 101 action="workDone"> 102 <g:message code="task.search.text.work.done" /> 103 </g:link> - <g:message code="task.search.text.work.done.description" /> 104 <br /> 105 </td> 106 </tr> 107 95 108 </tbody> 96 109 </table> -
trunk/web-app/css/main.css
r453 r490 261 261 vertical-align: top; 262 262 } 263 tr.total { 264 background: #EDEDED; 265 } 266 tr.total td{ 267 color: #555; 268 font-size: 14px; 269 font-weight: bold; 270 } 263 271 td.idColumn { 264 272 width: 25px; … … 304 312 background: #fff; 305 313 cursor: pointer; 314 } 315 .clickableEven td.notClickable { 316 cursor: default; 317 } 318 .clickableOdd td.notClickable { 319 cursor: default; 306 320 } 307 321
Note: See TracChangeset
for help on using the changeset viewer.