Changeset 713 for trunk/grails-app/controllers
- Timestamp:
- Nov 22, 2010, 10:33:51 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/TaskDetailedController.groovy
r701 r713 61 61 params.max = Math.min( params.max ? params.max.toInteger() : 100, 1000 ) 62 62 63 // View main data. 63 64 def taskInstanceList = [] 64 65 def taskInstanceTotal … … 68 69 // Restore search unless a new search is being requested. 69 70 if(!params.quickSearch && !filterParams) { 70 if(session.taskSearchQuickSearch) 71 params.quickSearch = session.taskSearchQuickSearch 72 else if(session.taskSearchFilterParams) { 71 if(session.taskSearchFilterParams) { 73 72 session.taskSearchFilterParams.each() { params[it.key] = it.value } 74 73 params.filter = session.taskSearchFilter 75 74 isFilterApplied = FilterUtils.isFilterApplied(params) 75 } 76 } 77 if(!params.quickSearch) { 78 if(session.taskSearchQuickSearch) { 79 params.quickSearch = session.taskSearchQuickSearch 80 params.person = Person.get(session.taskQuickSearchPersonId.toLong()) 81 params.startDate = session.taskQuickSearchStartDate 82 params.endDate = session.taskQuickSearchEndDate 83 params.includeCompleted = session.taskQuickSearchIncludeCompleted 76 84 } 77 85 } … … 114 122 session.taskSearchFilterParams = new LinkedHashMap(filterParams) 115 123 session.taskSearchFilter = new LinkedHashMap(params.filter) 116 session.removeAttribute("taskSearchQuickSearch")117 124 } 118 125 else { 119 126 // Quick Search: 120 if(!params.quickSearch) params.quickSearch = "myTodays"121 127 def result = taskSearchService.getQuickSearch(params, RCU.getLocale(request)) 122 128 taskInstanceList = result.taskInstanceList 123 129 taskInstanceTotal = result.taskInstanceList.totalCount 124 130 params.message = result.message 125 filterParams.quickSearch = result.quickSearch 131 params.quickSearch = result.quickSearch 132 params.person = result.person 133 params.startDate = result.startDate 134 params.endDate = result.endDate 135 params.includeCompleted = result.includeCompleted 126 136 // Remember search. 127 137 session.removeAttribute("taskSearchFilterParams") 128 138 session.removeAttribute("taskSearchFilter") 129 139 session.taskSearchQuickSearch = result.quickSearch 140 session.taskQuickSearchPersonId = result.person.id 141 session.taskQuickSearchStartDate = result.startDate 142 session.taskQuickSearchEndDate = result.endDate 143 session.taskQuickSearchIncludeCompleted = result.includeCompleted 130 144 } 131 145 … … 181 195 filterParams: filterParams, 182 196 params: params, 183 associatedPropertyValues: associatedPropertyValues ] 197 associatedPropertyValues: associatedPropertyValues, 198 quickSearchSelection: taskSearchService.quickSearchSelection] 184 199 185 200 } // search … … 206 221 // Restore search unless a new search is being requested. 207 222 if(!params.quickSearch && !filterParams) { 208 if(session.taskSearchCalendarQuickSearch) 209 params.quickSearch = session.taskSearchCalendarQuickSearch 210 else if(session.taskSearchCalendarFilterParams) { 223 if(session.taskSearchCalendarFilterParams) { 211 224 session.taskSearchCalendarFilterParams.each() { params[it.key] = it.value } 212 225 params.filter = session.taskSearchCalendarFilter 213 226 isFilterApplied = FilterUtils.isFilterApplied(params) 227 } 228 } 229 if(!params.quickSearch) { 230 if(session.taskSearchCalendarQuickSearch) { 231 params.quickSearch = session.taskSearchCalendarQuickSearch 232 params.person = Person.get(session.taskCalendarQuickSearchPersonId.toLong()) 233 params.startDate = session.taskCalendarQuickSearchStartDate 234 params.endDate = session.taskCalendarQuickSearchEndDate 235 params.includeCompleted = session.taskCalendarQuickSearchIncludeCompleted 214 236 } 215 237 } … … 250 272 session.taskSearchCalendarFilterParams = new LinkedHashMap(filterParams) 251 273 session.taskSearchCalendarFilter = new LinkedHashMap(params.filter) 252 session.removeAttribute("taskSearchCalendarQuickSearch")253 274 } 254 275 else { … … 258 279 taskInstanceTotal = result.taskInstanceList.totalCount 259 280 params.message = result.message 260 filterParams.quickSearch = result.quickSearch 281 params.quickSearch = result.quickSearch 282 params.person = result.person 283 params.startDate = result.startDate 284 params.endDate = result.endDate 285 params.includeCompleted = result.includeCompleted 261 286 // Remember search. 262 287 session.removeAttribute("taskSearchCalendarFilterParams") 263 288 session.removeAttribute("taskSearchCalendarFilter") 264 289 session.taskSearchCalendarQuickSearch = result.quickSearch 290 session.taskCalendarQuickSearchPersonId = result.person.id 291 session.taskCalendarQuickSearchStartDate = result.startDate 292 session.taskCalendarQuickSearchEndDate = result.endDate 293 session.taskCalendarQuickSearchIncludeCompleted = result.includeCompleted 265 294 } 266 295 … … 329 358 nextMonth: calendarMonthControls.nextMonth, 330 359 previousYear: calendarMonthControls.previousYear, 331 nextYear: calendarMonthControls.nextYear] 360 nextYear: calendarMonthControls.nextYear, 361 quickSearchSelection: taskSearchService.quickSearchSelection] 332 362 333 363 } // searchCalendar
Note: See TracChangeset
for help on using the changeset viewer.