Changeset 503


Ignore:
Timestamp:
Apr 20, 2010, 3:56:08 PM (10 years ago)
Author:
gav
Message:

Refactor TaskSearchService and associated messages.

Location:
trunk/grails-app
Files:
3 edited

Legend:

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

    r490 r503  
    265265
    266266# TaskSearch Service
    267 task.search.text.my.todays=Today''s tasks for {0}.
    268 task.search.text.my.todays.none.found=No tasks found for {0} today.
    269 task.search.text.my.yesterdays=Yesterday''s tasks for {0}.
    270 task.search.text.my.yesterdays.none.found=No tasks found for {0} yesterday.
    271 task.search.text.my.tomorrows=Tomorrow''s tasks for {0}.
    272 task.search.text.my.tomorrows.none.found=No tasks found for {0} tomorrow.
    273 task.search.text.todays=Today's tasks.
    274 task.search.text.todays.none.found=No tasks found for today.
    275 task.search.text.yesterdays=Yesterday's tasks.
    276 task.search.text.yesterdays.none.found=No tasks found for yesterday.
    277 task.search.text.tomorrows=Tomorrow's tasks.
    278 task.search.text.tomorrows.none.found=No tasks found for tomorrow.
    279 task.search.text.past.week=Tasks in the past week.
    280 task.search.text.past.week.none.found=No tasks found in the past week.
    281 task.search.text.my.past.week=Tasks in the past week for {0}.
    282 task.search.text.my.past.week.none.found=No tasks found in the past week for {0}.
    283 task.search.text.budget.unplanned=Tasks with budget status of 'Unplanned', in the past week.
    284 task.search.text.budget.unplanned.none.found=No tasks found with budget status of 'Unplanned', in the past week.
    285 task.search.text.budget.planned=Tasks with budget status of 'Planned', in the past week.
    286 task.search.text.budget.planned.none.found=No tasks found with budget status of 'Planned', in the past week.
    287 task.search.text.planners.range=Planners Range - Tasks in the past week and two weeks ahead.
    288 task.search.text.planners.range.none.found=No tasks found in the past week or two weeks ahead.
     267task.search.text.all.tasks.message=All tasks for {0}.
     268task.search.text.all.tasks.none.found=No tasks found for {0}.
     269task.search.text.all.tasks.between.message=All tasks between {0} and {1}.
     270task.search.text.all.tasks.between.none.found=No tasks found between {0} and {1}.
     271
     272task.search.text.persons.tasks.message=Tasks for {0} on {1}.
     273task.search.text.persons.tasks.none.found=No tasks found for {0} on {1}.
     274task.search.text.persons.tasks.between.message=Tasks for {0} between {1} and {2}.
     275task.search.text.persons.tasks.between.none.found=No tasks found for {0} between {1} and {2}.
     276
     277task.search.text.my.todays=Today
     278task.search.text.my.todays.description=My tasks and approved tasks that I am assigned to.
     279task.search.text.my.yesterdays=Yesterday
     280task.search.text.my.tomorrows=Tomorrow
     281task.search.text.my.past.week=Past Week
     282task.search.text.todays=Today
     283task.search.text.todays.description=All tasks that are not in the trash bin.
     284task.search.text.yesterdays=Yesterday
     285task.search.text.tomorrows=Tomorrow
     286task.search.text.past.week=Past Week
     287task.search.text.budget.unplanned=Unplanned Tasks
     288task.search.text.budget.unplanned.message=Tasks with budget status of 'Unplanned' between {0} and {1}.
     289task.search.text.budget.unplanned.none.found=No tasks found with budget status of 'Unplanned' between {0} and {1}.
     290task.search.text.budget.planned=Planned Tasks
     291task.search.text.budget.planned.description=Task with budget status of Planned, in the past week.
     292task.search.text.budget.planned.message=Tasks with budget status of 'Planned' between {0} and {1}.
     293task.search.text.budget.planned.none.found=No tasks found with budget status of 'Planned' between {0} and {1}.
     294task.search.text.planners.range=Planners Range
     295task.search.text.planners.range.description=Tasks in the past week and two weeks ahead.
    289296task.search.calendar.text.too.many.results=Too many results, only {0} are shown.
    290297task.search.text.work.done=Work Done
    291 task.search.text.work.done.none.found=No entries found for {0} on {1}.
    292298task.search.text.work.done.description=Work done by person and date.
    293299task.search.text.work.done.message=Work done by {0} on {1}.
     300task.search.text.work.done.none.found=No entries found for {0} on {1}.
    294301
    295302# InventoryItemSearch
  • trunk/grails-app/services/TaskSearchService.groovy

    r490 r503  
    2323    def getQuickSearch(params, locale) {
    2424        def result = [:]
     25        result.quickSearch = params.quickSearch ?: "plannersRange"
     26
    2527        def currentUser = authService.currentUser
    26         result.quickSearch = params.quickSearch ?: "searchPlannersRange"
     28        def startOfToday = dateUtilService.today
     29        def startOfYesterday = dateUtilService.yesterday
     30        def startOfTomorrow = dateUtilService.tomorrow
     31        def oneWeekAgo = dateUtilService.oneWeekAgo
     32
     33        def formattedStartOfToday = g.formatDate(format: "EEE, dd-MMM-yyyy", date: startOfToday)
     34        def formattedStartOfYesterday = g.formatDate(format: "EEE, dd-MMM-yyyy", date: startOfYesterday)
     35        def formattedStartOfTomorrow = g.formatDate(format: "EEE, dd-MMM-yyyy", date: startOfTomorrow)
     36        def formattedOneWeekAgo = g.formatDate(format: "EEE, dd-MMM-yyyy", date: oneWeekAgo)
    2737
    2838        def getMessage = { Map m ->
     
    3242        switch (result.quickSearch) {
    3343            case "myTodays":
    34                 result.taskInstanceList = getMyTodays(params)
    35                 if(result.taskInstanceList.totalCount > 0)
    36                     result.message = getMessage(code:"task.search.text.my.todays", args:[currentUser])
    37                 else
    38                     result.message = getMessage(code:"task.search.text.my.todays.none.found", args:[currentUser])
     44                result.taskInstanceList = getPersonsTasks(params)
     45                if(result.taskInstanceList.totalCount > 0)
     46                    result.message = getMessage(code:"task.search.text.persons.tasks.message",
     47                                                                    args:[currentUser, formattedStartOfToday])
     48                else
     49                    result.message = getMessage(code:"task.search.text.persons.tasks.none.found",
     50                                                                    args:[currentUser, formattedStartOfToday])
    3951                break
    4052            case "myYesterdays":
    41                 result.taskInstanceList = getMyTodays(params, -1)
    42                 if(result.taskInstanceList.totalCount > 0)
    43                     result.message = getMessage(code:"task.search.text.my.yesterdays", args:[currentUser])
    44                 else
    45                     result.message = getMessage(code:"task.search.text.my.yesterdays.none.found", args:[currentUser])
     53                result.taskInstanceList = getPersonsTasks(params, currentUser, startOfYesterday, startOfToday)
     54                if(result.taskInstanceList.totalCount > 0)
     55                    result.message = getMessage(code:"task.search.text.persons.tasks.message",
     56                                                                    args:[currentUser, formattedStartOfYesterday])
     57                else
     58                    result.message = getMessage(code:"task.search.text.persons.tasks.none.found",
     59                                                                    args:[currentUser, formattedStartOfYesterday])
    4660                break
    4761            case "myTomorrows":
    48                 result.taskInstanceList = getMyTodays(params, 1)
    49                 if(result.taskInstanceList.totalCount > 0)
    50                     result.message = getMessage(code:"task.search.text.my.tomorrows", args:[currentUser])
    51                 else
    52                     result.message = getMessage(code:"task.search.text.my.tomorrows.none.found", args:[currentUser])
     62                result.taskInstanceList = getPersonsTasks(params, currentUser, startOfTomorrow, startOfTomorrow+1)
     63                if(result.taskInstanceList.totalCount > 0)
     64                    result.message = getMessage(code:"task.search.text.persons.tasks.message",
     65                                                                    args:[currentUser, formattedStartOfTomorrow])
     66                else
     67                    result.message = getMessage(code:"task.search.text.persons.tasks.none.found",
     68                                                                    args:[currentUser, formattedStartOfTomorrow])
    5369                break
    5470            case "myPastWeek":
    55                 result.taskInstanceList = getMyPastWeek(params)
    56                 if(result.taskInstanceList.totalCount > 0)
    57                     result.message = getMessage(code:"task.search.text.my.past.week", args:[currentUser])
    58                 else
    59                     result.message = getMessage(code:"task.search.text.my.past.week.none.found", args:[currentUser])
     71                result.taskInstanceList = getPersonsTasks(params, currentUser, oneWeekAgo, startOfTomorrow)
     72                if(result.taskInstanceList.totalCount > 0)
     73                    result.message = getMessage(code:"task.search.text.persons.tasks.between.message",
     74                                                                    args:[currentUser, formattedOneWeekAgo, formattedStartOfToday])
     75                else
     76                    result.message = getMessage(code:"task.search.text.persons.tasks.between.none.found",
     77                                                                    args:[currentUser, formattedOneWeekAgo, formattedStartOfToday])
    6078                break
    6179            case "todays":
    62                 result.taskInstanceList = getTodays(params)
    63                 if(result.taskInstanceList.totalCount > 0)
    64                     result.message = getMessage(code:"task.search.text.todays")
    65                 else
    66                     result.message = getMessage(code:"task.search.text.todays.none.found")
     80                result.taskInstanceList = getTasks(params)
     81                if(result.taskInstanceList.totalCount > 0)
     82                    result.message = getMessage(code:"task.search.text.all.tasks.message",
     83                                                                    args:[formattedStartOfToday])
     84                else
     85                    result.message = getMessage(code:"task.search.text.all.tasks.none.found",
     86                                                                    args:[formattedStartOfToday])
    6787                break
    6888            case "yesterdays":
    69                 result.taskInstanceList = getTodays(params, -1)
    70                 if(result.taskInstanceList.totalCount > 0)
    71                     result.message = getMessage(code:"task.search.text.yesterdays")
    72                 else
    73                     result.message = getMessage(code:"task.search.text.yesterdays.none.found")
     89                result.taskInstanceList = getTasks(params, startOfYesterday, startOfToday)
     90                if(result.taskInstanceList.totalCount > 0)
     91                    result.message = getMessage(code:"task.search.text.all.tasks.message",
     92                                                                    args:[formattedStartOfYesterday])
     93                else
     94                    result.message = getMessage(code:"task.search.text.all.tasks.none.found",
     95                                                                    args:[formattedStartOfYesterday])
    7496                break
    7597            case "tomorrows":
    76                 result.taskInstanceList = getTodays(params, 1)
    77                 if(result.taskInstanceList.totalCount > 0)
    78                     result.message = getMessage(code:"task.search.text.tomorrows")
    79                 else
    80                     result.message = getMessage(code:"task.search.text.tomorrows.none.found")
     98                result.taskInstanceList = getTasks(params, startOfTomorrow, startOfTomorrow+1)
     99                if(result.taskInstanceList.totalCount > 0)
     100                    result.message = getMessage(code:"task.search.text.all.tasks.message",
     101                                                                    args:[formattedStartOfTomorrow])
     102                else
     103                    result.message = getMessage(code:"task.search.text.all.tasks.none.found",
     104                                                                    args:[formattedStartOfTomorrow])
    81105                break
    82106            case "pastWeek":
    83                 result.taskInstanceList = getPastWeek(params)
    84                 if(result.taskInstanceList.totalCount > 0)
    85                     result.message = getMessage(code:"task.search.text.past.week")
    86                 else
    87                     result.message = getMessage(code:"task.search.text.past.week.none.found")
     107                result.taskInstanceList = getTasks(params, oneWeekAgo, startOfTomorrow)
     108                if(result.taskInstanceList.totalCount > 0)
     109                    result.message = getMessage(code:"task.search.text.all.tasks.between.message",
     110                                                                    args:[formattedOneWeekAgo, formattedStartOfToday])
     111                else
     112                    result.message = getMessage(code:"task.search.text.all.tasks.between.none.found",
     113                                                                    args:[formattedOneWeekAgo, formattedStartOfToday])
    88114                break
    89115            case "budgetUnplanned":
    90                 result.taskInstanceList = getBudgetUnplanned(params)
    91                 if(result.taskInstanceList.totalCount > 0)
    92                     result.message = getMessage(code:"task.search.text.budget.unplanned")
    93                 else
    94                     result.message = getMessage(code:"task.search.text.budget.unplanned.none.found")
     116                result.taskInstanceList = getBudgetTasks(params, TaskBudgetStatus.read(1), oneWeekAgo, startOfTomorrow)
     117                if(result.taskInstanceList.totalCount > 0)
     118                    result.message = getMessage(code:"task.search.text.budget.unplanned.message",
     119                                                                    args:[formattedOneWeekAgo, formattedStartOfToday])
     120                else
     121                    result.message = getMessage(code:"task.search.text.budget.unplanned.none.found",
     122                                                                    args:[formattedOneWeekAgo, formattedStartOfToday])
    95123                break
    96124            case "budgetPlanned":
    97                 result.taskInstanceList = getBudgetPlanned(params)
    98                 if(result.taskInstanceList.totalCount > 0)
    99                     result.message = getMessage(code:"task.search.text.budget.planned")
    100                 else
    101                     result.message = getMessage(code:"task.search.text.budget.planned.none.found")
     125                result.taskInstanceList = getBudgetTasks(params, TaskBudgetStatus.read(2), oneWeekAgo, startOfTomorrow)
     126                if(result.taskInstanceList.totalCount > 0)
     127                    result.message = getMessage(code:"task.search.text.budget.planned.message",
     128                                                                    args:[formattedOneWeekAgo, formattedStartOfToday])
     129                else
     130                    result.message = getMessage(code:"task.search.text.budget.planned.none.found",
     131                                                                    args:[formattedOneWeekAgo, formattedStartOfToday])
    102132                break
    103133            default:
    104                 result.taskInstanceList = getPlannersRange(params)
    105                 if(result.taskInstanceList.totalCount > 0)
    106                     result.message = getMessage(code:"task.search.text.planners.range")
    107                 else
    108                     result.message = getMessage(code:"task.search.text.planners.range.none.found")
     134                //case "plannersRange":
     135                result.taskInstanceList = getTasks(params, oneWeekAgo, startOfToday+15)
     136                if(result.taskInstanceList.totalCount > 0)
     137                    result.message = getMessage(code:"task.search.text.all.tasks.between.message",
     138                                                                    args:[formattedOneWeekAgo,
     139                                                                            g.formatDate(format: "EEE, dd-MMM-yyyy", date: startOfToday+14)])
     140                else
     141                    result.message = getMessage(code:"task.search.text.all.tasks.between.none.found",
     142                                                                    args:[formattedOneWeekAgo,
     143                                                                            g.formatDate(format: "EEE, dd-MMM-yyyy", date: startOfToday+14)])
    109144                break
    110145        } // switch.
     
    116151
    117152    /**
    118     * Get all tasks that are not in the trash, by default today's tasks.
     153    * Get all tasks that are not in the trash bin, by default today's tasks.
    119154    * @param params The request params.
    120     * @param dayAdjustment The number of days to adjust from today, defaults to 0.
    121     */
    122     def getTodays(params, dayAdjustment=0) {
     155    * @param startDate The start date to get tasks for, defaults to the start of today and is inclusive (greater than or equal to).
     156    * @param endDate The end date to get tasks for, defaults to the start of tomorrow and is exclusive (less than).
     157    */
     158    def getTasks(params, startDate=null, endDate=null) {
    123159        params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax)
    124160        params.offset = params?.offset?.toInteger() ?: 0
    125161        params.sort = params?.sort ?: "attentionFlag"
    126162        params.order = params?.order ?: "desc"
     163
     164        startDate = startDate ?: dateUtilService.today
     165        endDate = endDate ?: dateUtilService.tomorrow
    127166
    128167        def taskInstanceList = Task.createCriteria().list(
     
    131170            sort: params.sort,
    132171            order: params.order) {
    133                 lt("targetStartDate", dateUtilService.tomorrow+dayAdjustment)
    134                 ge("targetCompletionDate", dateUtilService.today+dayAdjustment)
     172                lt("targetStartDate", endDate)
     173                ge("targetCompletionDate", startDate)
    135174                eq("trash", false)
    136175            } // createCriteria
    137     }
    138 
    139     /**
    140     * Get current user's tasks, by default today's tasks.
    141     * "Approved tasks where I am the lead or have been assigned"
     176    } // getTasks()
     177
     178    /**
     179    * Get a person's tasks, by default current user and today's tasks.
     180    * "My tasks and approved tasks that I am assigned to"
    142181    * @param params The request params.
    143     * @param dayAdjustment The number of days to adjust from today, defaults to 0.
    144     */
    145     def getMyTodays(params, dayAdjustment=0) {
     182    * @param person The person to get tasks for, defaults to current user.
     183    * @param startDate The start date to get tasks for, defaults to the start of today and is inclusive (greater than or equal to).
     184    * @param endDate The end date to get tasks for, defaults to the start of tomorrow and is exclusive (less than).
     185    */
     186    def getPersonsTasks(params, person=null, startDate=null, endDate=null) {
    146187        def paginateParams = [:]
    147188        paginateParams.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax)
     
    153194
    154195        def namedParams = [:]
    155         namedParams.currentUser = authService.currentUser
    156         namedParams.startOfDay = dateUtilService.today+dayAdjustment
    157         namedParams.startOfNextDay = dateUtilService.tomorrow+dayAdjustment
     196        namedParams.person = person ?: authService.currentUser
     197        namedParams.startDate = startDate ?: dateUtilService.today
     198        namedParams.endDate = endDate ?: dateUtilService.tomorrow
    158199
    159200        def baseQuery = "from Task as task \
     
    166207                                                    and task.approved = true \
    167208                                                    and ( \
    168                                                             task.targetStartDate < :startOfNextDay \
    169                                                             and task.targetCompletionDate >= :startOfDay \
     209                                                            task.targetStartDate < :endDate \
     210                                                            and task.targetCompletionDate >= :startDate \
    170211                                                        ) \
    171212                                                    and ( \
    172                                                             task.leadPerson = :currentUser \
    173                                                             or assignedPerson = :currentUser \
    174                                                             or assignedPersonViaGroup = :currentUser \
     213                                                            task.leadPerson = :person \
     214                                                            or assignedPerson = :person \
     215                                                            or assignedPersonViaGroup = :person \
    175216                                                            ) \
    176217                                                    )"
     
    184225        def taskInstanceList = new PagedResultList(list, totalCount)
    185226        return taskInstanceList
    186     } // getMyTodays
    187 
    188     /**
    189     * Get all tasks that are not in the trash, during the past week.
     227    } // getPersonsTasks()
     228
     229    /**
     230    * Get tasks by budget status, by default planned in the last week.
    190231    * @param params The request params.
    191     */
    192     def getPastWeek(params) {
    193         params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax)
    194         params.offset = params?.offset?.toInteger() ?: 0
    195         params.sort = params?.sort ?: "attentionFlag"
    196         params.order = params?.order ?: "desc"
    197 
    198         def taskInstanceList = Task.createCriteria().list(
    199             max: params.max,
    200             offset: params.offset,
    201             sort: params.sort,
    202             order: params.order) {
    203                 lt("targetStartDate", dateUtilService.tomorrow)
    204                 ge("targetCompletionDate", dateUtilService.oneWeekAgo)
    205                 eq("trash", false)
    206             } // createCriteria
    207     }
    208 
    209     /**
    210     * Get current user's tasks in the past week.
    211     * "Approved tasks where I am the lead or have been assigned"
    212     * @param params The request params.
    213     */
    214     def getMyPastWeek(params) {
    215         def paginateParams = [:]
    216         paginateParams.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax)
    217         paginateParams.offset = params?.offset?.toInteger() ?: 0
    218 
    219         def sort = "task." + (params?.sort ?: "attentionFlag")
    220         def order = params?.order == "asc" ? "asc" : "desc"
    221         def orderBy = " order by " + sort + ' ' + order
    222 
    223         def namedParams = [:]
    224         namedParams.currentUser = authService.currentUser
    225         namedParams.startOfDay = dateUtilService.oneWeekAgo
    226         namedParams.startOfNextDay = dateUtilService.tomorrow
    227 
    228         def baseQuery = "from Task as task \
    229                                         left join task.assignedPersons as assignedPersonOfTask \
    230                                         left join assignedPersonOfTask.person as assignedPerson \
    231                                         left join task.assignedGroups as assignedGroupOfTask \
    232                                         left join assignedGroupOfTask.personGroup as personGroup \
    233                                         left join personGroup.persons as assignedPersonViaGroup \
    234                                         where (task.trash = false \
    235                                                     and task.approved = true \
    236                                                     and ( \
    237                                                             task.targetStartDate < :startOfNextDay \
    238                                                             and task.targetCompletionDate >= :startOfDay \
    239                                                         ) \
    240                                                     and ( \
    241                                                             task.leadPerson = :currentUser \
    242                                                             or assignedPerson = :currentUser \
    243                                                             or assignedPersonViaGroup = :currentUser \
    244                                                             ) \
    245                                                     )"
    246 
    247         def searchQuery = "select distinct task " + baseQuery + orderBy
    248         def list = Task.executeQuery(searchQuery, namedParams, paginateParams)
    249 
    250         def countQuery = "select count(distinct task) as taskCount " + baseQuery
    251         def totalCount = Task.executeQuery(countQuery, namedParams)[0].toInteger()
    252 
    253         def taskInstanceList = new PagedResultList(list, totalCount)
    254         return taskInstanceList
    255     } // getMyTodays
    256 
    257     /**
    258     * "Tasks with budget status of Planned, in the past week."
    259     * @param params The request params.
    260     */
    261     def getBudgetPlanned(params) {
     232    * @param budgetStatus Defaults to planned.
     233    * @param startDate The start date to get tasks for, defaults to the start of today and is inclusive (greater than or equal to).
     234    * @param endDate The end date to get tasks for, defaults to the start of tomorrow and is exclusive (less than).
     235    */
     236    def getBudgetTasks(params, budgetStatus=null, startDate=null, endDate=null) {
    262237        params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax)
    263238        params.offset = params?.offset?.toInteger() ?: 0
    264239        params.sort = params?.sort ?: "targetStartDate"
    265240        params.order = params?.order ?: "asc"
     241
     242        budgetStatus = budgetStatus ?: TaskBudgetStatus.read(2) // Planned.
     243        startDate = startDate ?: dateUtilService.today
     244        endDate = endDate ?: dateUtilService.tomorrow
    266245
    267246        def taskInstanceList = Task.createCriteria().list(
     
    270249            sort: params.sort,
    271250            order: params.order) {
    272                 eq("taskBudgetStatus", TaskBudgetStatus.read(2))
     251                eq("taskBudgetStatus", budgetStatus)
    273252                lt("targetStartDate", dateUtilService.tomorrow)
    274253                ge("targetCompletionDate", dateUtilService.oneWeekAgo)
    275254                eq("trash", false)
    276255            } // createCriteria
    277     }
    278 
    279     /**
    280     * "Tasks with budget status of Unplanned, in the past week."
    281     * @param params The request params.
    282     */
    283     def getBudgetUnplanned(params) {
    284         params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax)
    285         params.offset = params?.offset?.toInteger() ?: 0
    286         params.sort = params?.sort ?: "targetStartDate"
    287         params.order = params?.order ?: "asc"
    288 
    289         def taskInstanceList = Task.createCriteria().list(
    290             max: params.max,
    291             offset: params.offset,
    292             sort: params.sort,
    293             order: params.order) {
    294                 eq("taskBudgetStatus", TaskBudgetStatus.read(1))
    295                 lt("targetStartDate", dateUtilService.tomorrow)
    296                 ge("targetCompletionDate", dateUtilService.oneWeekAgo)
    297                 eq("trash", false)
    298             } // createCriteria
    299     }
    300 
    301     /**
    302     * "Tasks in the past week and two weeks ahead."
    303     * @param params The request params.
    304     */
    305     def getPlannersRange(params) {
    306         params.max = Math.min(params?.max?.toInteger() ?: 10, paramsMax)
    307         params.offset = params?.offset?.toInteger() ?: 0
    308         params.sort = params?.sort ?: "targetStartDate"
    309         params.order = params?.order ?: "asc"
    310 
    311         def taskInstanceList = Task.createCriteria().list(
    312             max: params.max,
    313             offset: params.offset,
    314             sort: params.sort,
    315             order: params.order) {
    316                 ge("targetStartDate", dateUtilService.oneWeekAgo)
    317                 lt("targetStartDate", dateUtilService.today + 15)
    318                 eq("trash", false)
    319             } // createCriteria
    320     }
     256    } // getBudgetTasks()
    321257
    322258    /**
    323259    * 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.
     260    * A person ID and date may be specified in params otherwise the current user and today are used.
    325261    * @param params The request params.
    326262    * @returns A map containing entries, totalEntries, startOfDay, person, totalHours, totalMinutes.
     
    370306
    371307        return result
    372     }
     308    } // getWorkDone()
    373309
    374310} // end class
  • trunk/grails-app/views/taskDetailed/_quickSearchPane.gsp

    r490 r503  
    1414                                        action="${actionName}"
    1515                                        params="[quickSearch: 'myTodays']">
    16                                         Today
    17                         </g:link> - Approved tasks where I am the lead or have been assigned.
     16                                        <g:message code="task.search.text.my.todays" />
     17                        </g:link> - <g:message code="task.search.text.my.todays.description" />
    1818                        <br />
    1919                        <g:link controller="taskDetailed"
    2020                                        action="${actionName}"
    2121                                        params="[quickSearch: 'myYesterdays']">
    22                                         Yesterday
     22                                        <g:message code="task.search.text.my.yesterdays" />
    2323                        </g:link>
    2424                        <br />
     
    2626                                        action="${actionName}"
    2727                                        params="[quickSearch: 'myTomorrows']">
    28                                         Tomorrow
     28                                        <g:message code="task.search.text.my.tomorrows" />
    2929                        </g:link>
    3030                        <br />
     
    3232                                        action="${actionName}"
    3333                                        params="[quickSearch: 'myPastWeek']">
    34                                         Past Week
     34                                        <g:message code="task.search.text.my.past.week" />
    3535                        </g:link>
    3636                    </td>
     
    4545                                        action="${actionName}"
    4646                                        params="[quickSearch: 'todays']">
    47                                         Today
    48                         </g:link> - All tasks that are not in the trash.
     47                                        <g:message code="task.search.text.todays" />
     48                        </g:link> - <g:message code="task.search.text.todays.description" />
    4949                        <br />
    5050                        <g:link controller="taskDetailed"
    5151                                        action="${actionName}"
    5252                                        params="[quickSearch: 'yesterdays']">
    53                                         Yesterday
     53                                        <g:message code="task.search.text.yesterdays" />
    5454                        </g:link>
    5555                        <br />
     
    5757                                        action="${actionName}"
    5858                                        params="[quickSearch: 'tomorrows']">
    59                                         Tomorrow
     59                                        <g:message code="task.search.text.tomorrows" />
    6060                        </g:link>
    6161                        <br />
     
    6363                                        action="${actionName}"
    6464                                        params="[quickSearch: 'pastWeek']">
    65                                         Past Week
     65                                        <g:message code="task.search.text.past.week" />
    6666                        </g:link>
    6767                        <br />
     
    6969                                        action="${actionName}"
    7070                                        params="[quickSearch: 'plannersRange']">
    71                                         Planners Range
    72                         </g:link> - Tasks in the past week and two weeks ahead.
     71                                        <g:message code="task.search.text.planners.range" />
     72                        </g:link> - <g:message code="task.search.text.planners.range.description" />
    7373                    </td>
    7474                </tr>
     
    8282                                        action="${actionName}"
    8383                                        params="[quickSearch: 'budgetPlanned']">
    84                                         Planned Tasks
    85                         </g:link> - Task with budget status of Planned, in the past week.
     84                                        <g:message code="task.search.text.budget.planned" />
     85                        </g:link> - <g:message code="task.search.text.budget.planned.description" />
    8686                        <br />
    8787                        <g:link controller="taskDetailed"
    8888                                        action="${actionName}"
    8989                                        params="[quickSearch: 'budgetUnplanned']">
    90                                         Unplanned Tasks
     90                                        <g:message code="task.search.text.budget.unplanned" />
    9191                        </g:link>
    9292                    </td>
     
    100100                        <g:link controller="taskDetailed"
    101101                                        action="workDone">
    102                             <g:message code="task.search.text.work.done" />
     102                                        <g:message code="task.search.text.work.done" />
    103103                        </g:link> - <g:message code="task.search.text.work.done.description" />
    104104                        <br />
Note: See TracChangeset for help on using the changeset viewer.