Changeset 955 for trunk/grails-app/controllers
- Timestamp:
- Jun 29, 2011, 5:07:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/SupplierDetailedController.groovy
r913 r955 3 3 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager']) 4 4 class SupplierDetailedController extends BaseController { 5 5 6 def filterService 7 6 8 def index = { redirect(action:list,params:params) } 7 9 … … 11 13 def list = { 12 14 params.max = Math.min( params.max ? params.max.toInteger() : 10, 100) 13 [ supplierInstanceList: Supplier.list( params ), supplierInstanceTotal: Supplier.count() ] 15 def associatedPropertyMax = 1000 16 def associatedPropertyValues = [:] 17 def supplierTypeNameQuery = 'select distinct a.name from SupplierType a where a.isActive = ? order by a.name' 18 associatedPropertyValues.supplierTypeList = SupplierType.executeQuery(supplierTypeNameQuery, [true], [max:associatedPropertyMax]) 19 20 if(!params.filter) { 21 return [supplierInstanceList: Supplier.list(params), 22 supplierInstanceTotal: Supplier.count(), 23 associatedPropertyValues: associatedPropertyValues, 24 filterParams: params] 25 } 26 27 // filterPane: 28 return[ supplierInstanceList: filterService.filter( params, Supplier ), 29 supplierInstanceTotal: filterService.count( params, Supplier ), 30 associatedPropertyValues: associatedPropertyValues, 31 filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params), 32 params:params ] 14 33 } 15 34 … … 71 90 def version = params.version.toLong() 72 91 if(supplierInstance.version > version) { 73 92 74 93 supplierInstance.errors.rejectValue("version", "default.optimistic.locking.failure") 75 94 render(view:'edit',model:[supplierInstance:supplierInstance])
Note: See TracChangeset
for help on using the changeset viewer.