- Timestamp:
- Jul 1, 2011, 6:13:37 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryLocationDetailedController.groovy
r913 r958 3 3 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager']) 4 4 class InventoryLocationDetailedController extends BaseController { 5 6 def filterService 5 7 6 8 // the delete, save and update actions only accept POST requests … … 13 15 def list = { 14 16 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 15 [ inventoryLocationInstanceList: InventoryLocation.list( params ), inventoryLocationInstanceTotal: InventoryLocation.count() ] 17 def associatedPropertyMax = 1000 18 def associatedPropertyValues = [:] 19 def inventoryStoreNameQuery = 'select distinct a.name from InventoryStore a where a.isActive = ? order by a.name' 20 associatedPropertyValues.inventoryStoreList = InventoryStore.executeQuery(inventoryStoreNameQuery, [true], [max:associatedPropertyMax]) 21 22 if(!params.filter) { 23 return [inventoryLocationInstanceList: InventoryLocation.list(params), 24 inventoryLocationInstanceTotal: InventoryLocation.count(), 25 associatedPropertyValues: associatedPropertyValues, 26 filterParams: params] 27 } 28 29 // filterPane: 30 return[ inventoryLocationInstanceList: filterService.filter( params, InventoryLocation ), 31 inventoryLocationInstanceTotal: filterService.count( params, InventoryLocation ), 32 associatedPropertyValues: associatedPropertyValues, 33 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 34 params:params ] 16 35 } 17 36 … … 74 93 def version = params.version.toLong() 75 94 if(inventoryLocationInstance.version > version) { 76 95 77 96 inventoryLocationInstance.errors.rejectValue("version", "default.optimistic.locking.failure") 78 97 render(view:'edit',model:[inventoryLocationInstance:inventoryLocationInstance])
Note: See TracChangeset
for help on using the changeset viewer.