Ignore:
Timestamp:
Jun 9, 2010, 12:51:59 PM (14 years ago)
Author:
gav
Message:

Improvements to task search filter pane.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/TaskDetailedController.groovy

    r588 r589  
    234234        if(isFilterApplied) {
    235235            // filterPane:
     236            params.sort = params.sort ?: "id"
     237            params.order = params.order ?: "desc"
    236238            if(params.sort == "attentionFlag") // See ticket #64 in Trac.
    237239                params.sort = "id"
     
    298300        filterParams.max = params.max
    299301        filterParams.offset = params.offset?.toInteger() ?: 0
     302        filterParams.sort = params.sort ?: "id"
     303        filterParams.order = params.order ?: "desc"
     304
     305        // Get some associatedProperty values for filterpane.
     306        def associatedPropertyValues = [:]
     307        def associatedPropertyMax = 10000
     308        associatedPropertyValues.taskPriorityList = TaskPriority.findAllByIsActive(true, [max:associatedPropertyMax, sort:'name'])
     309        def lastNameQuery = 'select distinct p.lastName from Person p where p.isActive = ? order by p.lastName'
     310        associatedPropertyValues.lastNameList = Person.executeQuery(lastNameQuery, [true], [max:associatedPropertyMax])
     311        def firstNameQuery = 'select distinct p.firstName from Person p where p.isActive = ? order by p.firstName'
     312        associatedPropertyValues.firstNameList = Person.executeQuery(firstNameQuery, [true], [max:associatedPropertyMax])
     313        associatedPropertyValues.taskGroupList = TaskGroup.findAllByIsActive(true, [max:associatedPropertyMax, sort:'name'])
     314        associatedPropertyValues.assetList = Asset.findAllByIsActive(true, [max:associatedPropertyMax, sort:'name'])
     315        associatedPropertyValues.taskStatusList = TaskStatus.findAllByIsActive(true, [max:associatedPropertyMax, sort:'name'])
     316        associatedPropertyValues.taskTypeList = TaskType.findAllByIsActive(true, [max:associatedPropertyMax, sort:'name'])
     317        def startOfYearRange = dateUtilService.getYearFromDate(dateUtilService.plusYear(new Date(), -10))
     318        def endOfYearRange = dateUtilService.getYearFromDate(dateUtilService.plusYear(new Date(), 10))
     319        associatedPropertyValues.yearRange = startOfYearRange..endOfYearRange
    300320
    301321        return[taskInstanceList: taskInstanceList,
     
    303323                        filterParams: filterParams,
    304324                        params: params,
     325                        associatedPropertyValues: associatedPropertyValues,
    305326                        showDate: showDate,
    306327                        today: calendarMonthControls.today,
Note: See TracChangeset for help on using the changeset viewer.