Changeset 737 for trunk/grails-app
- Timestamp:
- Dec 8, 2010, 12:04:47 PM (14 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/i18n/messages.properties
r732 r737 429 429 task.search.text.all.tasks.between.none.found=No tasks found between {0} and {1}. 430 430 431 task.search.text.budget.planned=Budget Planned432 task.search.text.budget.planned.help=Tasks with a budget status of 'Planned'.433 task.search.text.budget.planned.message=Tasks with a budget status of 'Planned' for {0}.434 task.search.text.budget.planned.none.found=No tasks found with a budget status of 'Planned' for {0}.435 task.search.text.budget.planned.between.message=Tasks with a budget status of 'Planned' between {0} and {1}.436 task.search.text.budget.planned.between.none.found=No tasks found with a budget status of 'Planned' between {0} and {1}.437 438 task.search.text.budget.unplanned=Budget Unplanned439 task.search.text.budget.unplanned.help=Tasks with a budget status of 'Unplanned'.440 task.search.text.budget.unplanned.message=Tasks with a budget status of 'Unplanned' for {0}.441 task.search.text.budget.unplanned.none.found=No tasks found with a budget status of 'Unplanned' for {0}.442 task.search.text.budget.unplanned.between.message=Tasks with a budget status of 'Unplanned' between {0} and {1}.443 task.search.text.budget.unplanned.between.none.found=No tasks found with a budget status of 'Unplanned' between {0} and {1}.444 445 431 task.search.text.persons.tasks=Person's Tasks 446 432 task.search.text.persons.tasks.help=Approved tasks that a person is assigned to. -
trunk/grails-app/services/TaskSearchService.groovy
r736 r737 21 21 def getQuickSearchSelection() { 22 22 [ 'allTasks': g.message(code: 'task.search.text.all.tasks'), 23 'budgetPlanned': g.message(code: 'task.search.text.budget.planned'),24 'budgetUnplanned': g.message(code: 'task.search.text.budget.unplanned'),25 23 'personsImmediateCallouts': g.message(code: 'task.search.text.persons.immediate.callouts'), 26 24 'personsTasks': g.message(code: 'task.search.text.persons.tasks') … … 188 186 case "allTasks": 189 187 allTasks() 190 break191 case "budgetUnplanned":192 result.taskInstanceList = getBudgetTasks(params, TaskBudgetStatus.read(1), result.startDate, result.endDate+1)193 if(result.taskInstanceList.totalCount > 0) {194 if(result.startDate == result.endDate)195 result.message = getMessage(code:"task.search.text.budget.unplanned.message",196 args:[ formatted(result.startDate) ])197 else198 result.message = getMessage(code:"task.search.text.budget.unplanned.between.message",199 args:[ formatted(result.startDate), formatted(result.endDate) ])200 }201 else {202 if(result.startDate == result.endDate)203 result.message = getMessage(code:"task.search.text.budget.unplanned.none.found",204 args:[ formatted(result.startDate) ])205 else206 result.message = getMessage(code:"task.search.text.budget.unplanned.between.none.found",207 args:[ formatted(result.startDate), formatted(result.endDate) ])208 }209 break210 case "budgetPlanned":211 result.taskInstanceList = getBudgetTasks(params, TaskBudgetStatus.read(2), result.startDate, result.endDate+1)212 if(result.taskInstanceList.totalCount > 0) {213 if(result.startDate == result.endDate)214 result.message = getMessage(code:"task.search.text.budget.planned.message",215 args:[ formatted(result.startDate) ])216 else217 result.message = getMessage(code:"task.search.text.budget.planned.between.message",218 args:[ formatted(result.startDate), formatted(result.endDate) ])219 }220 else {221 if(result.startDate == result.endDate)222 result.message = getMessage(code:"task.search.text.budget.planned.none.found",223 args:[ formatted(result.startDate) ])224 else225 result.message = getMessage(code:"task.search.text.budget.planned.between.none.found",226 args:[ formatted(result.startDate), formatted(result.endDate) ])227 }228 188 break 229 189 default: … … 402 362 403 363 /** 404 * Get tasks by budget status, by default planned in the last week.405 * @param params The request params.406 * @param budgetStatus Defaults to planned.407 * @param startDate The start date to get tasks for, defaults to the start of today and is inclusive (greater than or equal to).408 * @param endDate The end date to get tasks for, defaults to the start of tomorrow and is exclusive (less than).409 */410 def getBudgetTasks(params, taskBudgetStatus=null, startDate=null, endDate=null) {411 def paginateParams = [:]412 paginateParams.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax)413 paginateParams.offset = params?.offset?.toInteger() ?: 0414 415 def sort = "task." + (params?.sort ?: "targetStartDate")416 def order = params?.order == "desc" ? "desc" : "asc"417 def orderBy = " order by " + sort + ' ' + order418 419 def namedParams = [:]420 namedParams.taskBudgetStatus = taskBudgetStatus ?: TaskBudgetStatus.read(2) // Planned.421 namedParams.startDate = startDate ?: dateUtilService.today422 namedParams.endDate = endDate ?: dateUtilService.tomorrow423 424 def baseQuery = "from Task as task \425 where (task.trash = false \426 and task.taskBudgetStatus = :taskBudgetStatus \427 and task.targetStartDate < :endDate \428 and task.targetCompletionDate >= :startDate \429 )"430 431 def searchQuery = "select distinct task " + baseQuery + orderBy432 def list = Task.executeQuery(searchQuery, namedParams, paginateParams)433 434 def countQuery = "select count(distinct task) as taskCount " + baseQuery435 def totalCount = Task.executeQuery(countQuery, namedParams)[0].toInteger()436 437 def taskInstanceList = new PagedResultList(list, totalCount)438 return taskInstanceList439 } // getBudgetTasks()440 441 /**442 364 * Get work done by person and date. 443 365 * A person ID and date may be specified in params otherwise the current user and today are used. -
trunk/grails-app/views/taskDetailed/_quickSearchPane.gsp
r713 r737 20 20 <span id="allTasksHelp"> 21 21 <g:helpBalloon class="helpballoon" code="task.search.text.all.tasks" /> 22 </span>23 <span id="budgetPlannedHelp">24 <g:helpBalloon class="helpballoon" code="task.search.text.budget.planned" />25 </span>26 <span id="budgetUnplannedHelp">27 <g:helpBalloon class="helpballoon" code="task.search.text.budget.unplanned" />28 22 </span> 29 23 <span id="personsTasksHelp"> -
trunk/grails-app/views/taskDetailed/edit.gsp
r728 r737 137 137 </td> 138 138 </tr> 139 140 <tr class="prop">141 <td valign="top" class="name">142 <label for="taskBudgetStatus">Budget Status:</label>143 </td>144 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'taskBudgetStatus','errors')}">145 <g:select optionKey="id"146 from="${TaskBudgetStatus.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"147 name="taskBudgetStatus.id"148 value="${taskInstance?.taskBudgetStatus?.id}" >149 </g:select>150 </td>151 </tr>152 139 153 140 <tr class="prop">
Note: See TracChangeset
for help on using the changeset viewer.