Changeset 359 for trunk/grails-app


Ignore:
Timestamp:
Feb 16, 2010, 9:57:56 AM (15 years ago)
Author:
gav
Message:

Add options div to AssetSubItem? search view, part 2.

File:
1 edited

Legend:

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

    r352 r359  
    1515    def index = { redirect(action:search,params:params) }
    1616
     17    /**
     18    * Set session.assetSubItemSearchParamsMax
     19    */
     20    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser'])
     21    def setSearchParamsMax = {
     22        def max = 1000
     23        if(params.newMax.isInteger()) {
     24            def i = params.newMax.toInteger()
     25            if(i > 0 && i <= max)
     26                session.assetSubItemSearchParamsMax = params.newMax
     27            if(i > max)
     28                session.assetSubItemSearchParamsMax = max
     29        }
     30        forward(action: 'search', params: params)
     31    }
     32
    1733    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser'])
    1834    def search = {
    1935
    20         if(session.assetSearchParamsMax)
    21             params.max = session.assetSearchParamsMax
     36        if(session.assetSubItemSearchParamsMax)
     37            params.max = session.assetSubItemSearchParamsMax
    2238
    2339        params.max = Math.min( params.max ? params.max.toInteger() : 10,  1000)
Note: See TracChangeset for help on using the changeset viewer.