Changeset 582 for trunk/grails-app
- Timestamp:
- Jun 8, 2010, 4:28:09 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/TaskDetailedController.groovy
r567 r582 78 78 // Remember sort if supplied, otherwise try to restore. 79 79 if(params.sort && params.order) { 80 session.taskSearchSort = params.sort 81 session.taskSearchOrder = params.order 80 // Reset to defaultSort if requested. 81 if(params.sort == 'defaultSort') { 82 params.sort = null 83 params.order = null 84 session.removeAttribute("taskSearchSort") 85 session.removeAttribute("taskSearchOrder") 86 } 87 else { 88 session.taskSearchSort = params.sort 89 session.taskSearchOrder = params.order 90 } 82 91 } 83 92 else if(session.taskSearchSort && session.taskSearchOrder) { … … 88 97 if(isFilterApplied) { 89 98 // filterPane: 99 params.sort = params.sort ?: "id" 100 params.order = params.order ?: "desc" 90 101 if(params.sort == "attentionFlag") // See ticket #64 in Trac. 91 102 params.sort = "id" … … 146 157 filterParams.max = params.max 147 158 filterParams.offset = params.offset?.toInteger() ?: 0 148 filterParams.sort = params.sort ?: " attentionFlag"159 filterParams.sort = params.sort ?: "id" 149 160 filterParams.order = params.order ?: "desc" 150 161 -
trunk/grails-app/services/TaskSearchService.groovy
r529 r582 161 161 paginateParams.offset = params?.offset?.toInteger() ?: 0 162 162 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" 166 173 167 174 def namedParams = [:] … … 198 205 paginateParams.offset = params?.offset?.toInteger() ?: 0 199 206 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" 203 217 204 218 def namedParams = [:] -
trunk/grails-app/taglib/CustomTagLib.groovy
r417 r582 173 173 174 174 // Image. 175 def imgSrc = attrs.remove("imgSrc") 176 def imgAlt = attrs.remove("imgAlt") 177 def img = "<img src=${imgSrc} alt=${imgAlt} />" 175 def img = "<img " 176 def imgAttrs = [:] 177 imgAttrs.src = attrs.remove("imgSrc") 178 imgAttrs.alt = attrs.remove("imgAlt") 179 imgAttrs.title = attrs.remove("imgTitle") 180 imgAttrs.each { k, v -> 181 if(v) 182 img += "${k}=\"${v.encodeAsHTML()}\" " 183 } 184 img += "/>" 178 185 179 186 writer << "<th " … … 184 191 } 185 192 writer << ">${link(action:action, params:linkParams) { img } }" 186 // writer << body()187 193 writer << "</th>" 188 } 194 195 } // sortableColumnWithImg 189 196 190 197 } // end class -
trunk/grails-app/views/taskDetailed/search.gsp
r570 r582 89 89 <custom:sortableColumnWithImg property="attentionFlag" 90 90 imgSrc="${resource(dir:'images/skin',file:'flag_red.png')}" 91 imgAlt="Flag" params="${filterParams}" /> 91 imgAlt="Flag" 92 params="${filterParams}" /> 92 93 93 94 <g:sortableColumn property="id" title="Id" params="${filterParams}" /> … … 103 104 <g:sortableColumn property="taskStatus" title="Status" params="${filterParams}" /> 104 105 105 <th></th> 106 <custom:sortableColumnWithImg property="defaultSort" 107 imgSrc="${resource(dir:'images/skin',file:'table_sort.png')}" 108 imgAlt="Sort" 109 imgTitle="Default Sort" 110 params="${filterParams}" /> 106 111 107 112 </tr>
Note: See TracChangeset
for help on using the changeset viewer.