Ignore:
Timestamp:
Apr 16, 2010, 2:10:52 PM (15 years ago)
Author:
gav
Message:

Add recentlyUsed inventoryItem quick search.

File:
1 edited

Legend:

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

    r485 r489  
    136136        // Restore search unless a new search is being requested.
    137137        if(!params.quickSearch && !filterParams) {
    138             if(session.inventoryItemQuickSearch)
     138            if(session.inventoryItemQuickSearch) {
    139139                params.quickSearch = session.inventoryItemQuickSearch
     140                if(session.inventoryItemQuickSearchDaysBack)
     141                    params.daysBack = session.inventoryItemQuickSearchDaysBack.toString()
     142            }
    140143            else if(session.inventoryItemSearchFilterParams) {
    141144                session.inventoryItemSearchFilterParams.each() { params[it.key] = it.value }
     
    163166            session.inventoryItemSearchFilterParams = new LinkedHashMap(filterParams)
    164167            session.inventoryItemSearchFilter = new LinkedHashMap(params.filter)
    165             session.inventoryItemQuickSearch = null
     168            session.removeAttribute("inventoryItemQuickSearch")
     169            session.removeAttribute("inventoryItemQuickSearchDaysBack")
    166170        }
    167171        else {
     
    174178            filterParams.quickSearch = result.quickSearch
    175179            // Remember search.
    176             session.inventoryItemSearchFilterParams = null
    177             session.inventoryItemSearchFilter = null
     180            session.removeAttribute("inventoryItemSearchFilterParams")
     181            session.removeAttribute("inventoryItemSearchFilter")
    178182            session.inventoryItemQuickSearch = result.quickSearch
     183            if(result.daysBack)
     184                session.inventoryItemQuickSearchDaysBack = result.daysBack
    179185        }
    180186
Note: See TracChangeset for help on using the changeset viewer.