- Timestamp:
- Jun 2, 2010, 4:31:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryItemDetailedController.groovy
r554 r562 134 134 def isFilterApplied = FilterUtils.isFilterApplied(params) 135 135 136 // Restore default sort if a new text search is requested 137 if(params.newTextSearch) { 138 params.sort = 'id' 139 params.order = 'desc' 140 } 141 136 142 // Restore search unless a new search is being requested. 137 if(!params.quickSearch && !filterParams) { 138 if(session.inventoryItemQuickSearch) { 143 if(!params.searchText && !params.quickSearch && !filterParams) { 144 if(session.inventoryItemSearchText) { 145 params.searchText = session.inventoryItemSearchText 146 params.searchName = session.inventoryItemSearchName 147 params.searchDescription = session.inventoryItemSearchDescription 148 params.searchComment = session.inventoryItemSearchComment 149 params.searchLocation = session.inventoryItemSearchLocation 150 params.searchSpareFor = session.inventoryItemSearchSpareFor 151 } 152 else if(session.inventoryItemQuickSearch) { 139 153 params.quickSearch = session.inventoryItemQuickSearch 140 154 if(session.inventoryItemQuickSearchDaysBack) … … 166 180 session.inventoryItemSearchFilterParams = new LinkedHashMap(filterParams) 167 181 session.inventoryItemSearchFilter = new LinkedHashMap(params.filter) 182 // Clear any previous search. 183 session.removeAttribute("inventoryItemSearchText") 184 session.removeAttribute("inventoryItemSearchName") 185 session.removeAttribute("inventoryItemSearchDescription") 186 session.removeAttribute("inventoryItemSearchComment") 187 session.removeAttribute("inventoryItemSearchLocation") 188 session.removeAttribute("inventoryItemSearchSpareFor") 168 189 session.removeAttribute("inventoryItemQuickSearch") 169 190 session.removeAttribute("inventoryItemQuickSearchDaysBack") 170 191 } 192 else if(params.searchText) { 193 // Quick Search Text: 194 def result = inventoryItemSearchService.getTextSearch(params, RCU.getLocale(request)) 195 inventoryItemInstanceList = result.inventoryItemList 196 inventoryItemInstanceTotal = result.inventoryItemList.totalCount 197 params.message = result.message 198 filterParams.searchText = result.searchText 199 // Remember search. 200 session.inventoryItemSearchText = params.searchText 201 session.inventoryItemSearchName = params.searchName 202 session.inventoryItemSearchDescription = params.searchDescription 203 session.inventoryItemSearchComment = params.searchComment 204 session.inventoryItemSearchLocation = params.searchLocation 205 session.inventoryItemSearchSpareFor = params.searchSpareFor 206 // Clear any previous search. 207 session.removeAttribute("inventoryItemQuickSearch") 208 session.removeAttribute("inventoryItemQuickSearchDaysBack") 209 session.removeAttribute("inventoryItemSearchFilterParams") 210 session.removeAttribute("inventoryItemSearchFilter") 211 } 171 212 else { 172 // Quick Search :213 // Quick Search Links: 173 214 if(!params.quickSearch) params.quickSearch = "all" 174 215 def result = inventoryItemSearchService.getQuickSearch(params, RCU.getLocale(request)) … … 178 219 filterParams.quickSearch = result.quickSearch 179 220 // Remember search. 180 session.removeAttribute("inventoryItemSearchFilterParams")181 session.removeAttribute("inventoryItemSearchFilter")182 221 session.inventoryItemQuickSearch = result.quickSearch 183 222 if(result.daysBack) 184 223 session.inventoryItemQuickSearchDaysBack = result.daysBack 224 // Clear any previous search. 225 session.removeAttribute("inventoryItemSearchText") 226 session.removeAttribute("inventoryItemSearchName") 227 session.removeAttribute("inventoryItemSearchDescription") 228 session.removeAttribute("inventoryItemSearchComment") 229 session.removeAttribute("inventoryItemSearchLocation") 230 session.removeAttribute("inventoryItemSearchSpareFor") 231 session.removeAttribute("inventoryItemSearchFilterParams") 232 session.removeAttribute("inventoryItemSearchFilter") 185 233 } 186 234
Note: See TracChangeset
for help on using the changeset viewer.