Ignore:
Timestamp:
Jun 8, 2010, 4:28:09 PM (15 years ago)
Author:
gav
Message:

New defaultSort for Tasks, sort by status then priority then target start date.
Small improvement to custom:sortableColumnWithImg to allow imgTitle to be specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/TaskSearchService.groovy

    r529 r582  
    161161        paginateParams.offset = params?.offset?.toInteger() ?: 0
    162162
    163         def sort = "task." + (params?.sort ?: "attentionFlag")
    164         def order = params?.order == "asc" ? "asc" : "desc"
    165         def orderBy = " order by " + sort + ' ' + order
     163        def orderBy = ''
     164        if(params.sort?.contains('.')) // protect against filterpane bug.
     165            params.sort = null
     166        if(params.sort && params.order) {
     167            def sort = "task." + params.sort
     168            def order = (params.order == "asc") ? "asc" : "desc"
     169            orderBy = " order by " + sort + ' ' + order
     170        }
     171        else
     172            orderBy = " order by task.taskStatus, task.taskPriority, task.targetStartDate"
    166173
    167174        def namedParams = [:]
     
    198205        paginateParams.offset = params?.offset?.toInteger() ?: 0
    199206
    200         def sort = "task." + (params?.sort ?: "attentionFlag")
    201         def order = params?.order == "asc" ? "asc" : "desc"
    202         def orderBy = " order by " + sort + ' ' + order
     207        def orderBy = ''
     208        if(params.sort?.contains('.')) // protect against filterpane bug.
     209            params.sort = null
     210        if(params.sort && params.order) {
     211            def sort = "task." + params.sort
     212            def order = (params.order == "asc") ? "asc" : "desc"
     213            orderBy = " order by " + sort + ' ' + order
     214        }
     215        else
     216            orderBy = " order by task.taskStatus, task.taskPriority, task.targetStartDate"
    203217
    204218        def namedParams = [:]
Note: See TracChangeset for help on using the changeset viewer.