Changeset 737


Ignore:
Timestamp:
Dec 8, 2010, 12:04:47 PM (9 years ago)
Author:
gav
Message:

Remove task budget status from task views.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/i18n/messages.properties

    r732 r737  
    429429task.search.text.all.tasks.between.none.found=No tasks found between {0} and {1}.
    430430
    431 task.search.text.budget.planned=Budget Planned
    432 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 Unplanned
    439 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 
    445431task.search.text.persons.tasks=Person's Tasks
    446432task.search.text.persons.tasks.help=Approved tasks that a person is assigned to.
  • trunk/grails-app/services/TaskSearchService.groovy

    r736 r737  
    2121    def getQuickSearchSelection() {
    2222        [ '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'),
    2523        'personsImmediateCallouts': g.message(code: 'task.search.text.persons.immediate.callouts'),
    2624        'personsTasks': g.message(code: 'task.search.text.persons.tasks')
     
    188186            case "allTasks":
    189187                allTasks()
    190                 break
    191             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                     else
    198                         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                     else
    206                         result.message = getMessage(code:"task.search.text.budget.unplanned.between.none.found",
    207                                                                         args:[ formatted(result.startDate), formatted(result.endDate) ])
    208                 }
    209                 break
    210             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                     else
    217                         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                     else
    225                         result.message = getMessage(code:"task.search.text.budget.planned.between.none.found",
    226                                                                         args:[ formatted(result.startDate), formatted(result.endDate) ])
    227                 }
    228188                break
    229189            default:
     
    402362
    403363    /**
    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() ?: 0
    414 
    415         def sort = "task." + (params?.sort ?: "targetStartDate")
    416         def order = params?.order == "desc" ? "desc" : "asc"
    417         def orderBy = " order by " + sort + ' ' + order
    418 
    419         def namedParams = [:]
    420         namedParams.taskBudgetStatus = taskBudgetStatus ?: TaskBudgetStatus.read(2) // Planned.
    421         namedParams.startDate = startDate ?: dateUtilService.today
    422         namedParams.endDate = endDate ?: dateUtilService.tomorrow
    423 
    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 + orderBy
    432         def list = Task.executeQuery(searchQuery, namedParams, paginateParams)
    433 
    434         def countQuery = "select count(distinct task) as taskCount " + baseQuery
    435         def totalCount = Task.executeQuery(countQuery, namedParams)[0].toInteger()
    436 
    437         def taskInstanceList = new PagedResultList(list, totalCount)
    438         return taskInstanceList
    439     } // getBudgetTasks()
    440 
    441     /**
    442364    * Get work done by person and date.
    443365    * 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  
    2020                            <span id="allTasksHelp">
    2121                                <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" />
    2822                            </span>
    2923                            <span id="personsTasksHelp">
  • trunk/grails-app/views/taskDetailed/edit.gsp

    r728 r737  
    137137                                </td>
    138138                            </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>
    152139                       
    153140                            <tr class="prop">
  • trunk/web-app/js/taskQuickSearchPane.js

    r713 r737  
    22function updateQuickSearchSelection() {
    33    var personsTasksSelectionIds = ['personLabel', 'personSelection', 'completedLabel', 'completedSelection'];
    4     var helpBalloonSpanIds = ['allTasksHelp', 'budgetPlannedHelp', 'budgetUnplannedHelp', 'personsTasksHelp', 'personsImmediateCalloutsHelp'];
     4    var helpBalloonSpanIds = ['allTasksHelp', 'personsTasksHelp', 'personsImmediateCalloutsHelp'];
    55    var val = $("quickSearchSelect").value;
    66
     
    1212        case 'allTasks':
    1313            showUtil('allTasksHelp');
    14             hideArrayUtil(personsTasksSelectionIds);
    15             break;
    16         case 'budgetPlanned':
    17             showUtil('budgetPlannedHelp');
    18             hideArrayUtil(personsTasksSelectionIds);
    19             break;
    20         case 'budgetUnplanned':
    21             showUtil('budgetUnplannedHelp');
    2214            hideArrayUtil(personsTasksSelectionIds);
    2315            break;
Note: See TracChangeset for help on using the changeset viewer.