- Timestamp:
- Jun 30, 2011, 7:55:55 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryStoreDetailedController.groovy
r913 r957 3 3 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager']) 4 4 class InventoryStoreDetailedController extends BaseController { 5 5 6 def filterService 7 6 8 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser']) 7 9 def index = { redirect(action:list,params:params) } … … 12 14 def list = { 13 15 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 14 [ inventoryStoreInstanceList: InventoryStore.list( params ), inventoryStoreInstanceTotal: InventoryStore.count() ] 16 def associatedPropertyMax = 1000 17 def associatedPropertyValues = [:] 18 def siteNameQuery = 'select distinct a.name from Site a where a.isActive = ? order by a.name' 19 associatedPropertyValues.siteList = Site.executeQuery(siteNameQuery, [true], [max:associatedPropertyMax]) 20 21 if(!params.filter) { 22 return [inventoryStoreInstanceList: InventoryStore.list(params), 23 inventoryStoreInstanceTotal: InventoryStore.count(), 24 associatedPropertyValues: associatedPropertyValues, 25 filterParams: params] 26 } 27 28 // filterPane: 29 return[ inventoryStoreInstanceList: filterService.filter( params, InventoryStore ), 30 inventoryStoreInstanceTotal: filterService.count( params, InventoryStore ), 31 associatedPropertyValues: associatedPropertyValues, 32 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 33 params:params ] 15 34 } 16 35 … … 73 92 def version = params.version.toLong() 74 93 if(inventoryStoreInstance.version > version) { 75 94 76 95 inventoryStoreInstance.errors.rejectValue("version", "default.optimistic.locking.failure") 77 96 render(view:'edit',model:[inventoryStoreInstance:inventoryStoreInstance])
Note: See TracChangeset
for help on using the changeset viewer.