Ignore:
Timestamp:
Feb 8, 2010, 4:30:14 AM (10 years ago)
Author:
gav
Message:

Add options control to asset search view.

File:
1 edited

Legend:

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

    r325 r326  
    1616    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser'])
    1717    def index = { redirect(action:search,params:params) }
     18
     19    /**
     20    * Set session.assetSearchParamsMax
     21    */
     22    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser'])
     23    def setSearchParamsMax = {
     24        def max = 1000
     25        if(params.newMax.isInteger()) {
     26            def i = params.newMax.toInteger()
     27            if(i > 0 && i <= max)
     28                session.assetSearchParamsMax = params.newMax
     29            if(i > max)
     30                session.assetSearchParamsMax = max
     31        }
     32        forward(action: 'search', params: params)
     33    }
    1834
    1935    /**
     
    167183
    168184            response.contentType = ConfigurationHolder.config.grails.mime.types[params.format]
    169             response.setHeader("Content-disposition", "attachment; filename=tasks.${params.extension}")
     185            response.setHeader("Content-disposition", "attachment; filename=assets.${params.extension}")
    170186            List fields = ["section.site",
    171187                                "section",
Note: See TracChangeset for help on using the changeset viewer.