Changeset 435 for trunk/grails-app/controllers
- Timestamp:
- Mar 8, 2010, 10:58:13 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryItemDetailedController.groovy
r425 r435 240 240 if(!result.error) { 241 241 def possibleAlternateItems = inventoryItemService.getPossibleAlternateItems(result.inventoryItemInstance) 242 return [ inventoryItemInstance : result.inventoryItemInstance, possibleAlternateItems: possibleAlternateItems] 242 def suppliers = Supplier.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 243 def manufacturers = Manufacturer.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 244 245 return [ inventoryItemInstance : result.inventoryItemInstance, 246 possibleAlternateItems: possibleAlternateItems, 247 suppliers: suppliers, 248 manufacturers: manufacturers] 243 249 } 244 250 … … 263 269 264 270 def possibleAlternateItems = inventoryItemService.getPossibleAlternateItems(result.inventoryItemInstance) 265 render(view:'edit', model:[inventoryItemInstance: result.inventoryItemInstance.attach(), possibleAlternateItems: possibleAlternateItems]) 271 def suppliers = Supplier.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 272 def manufacturers = Manufacturer.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 273 render(view:'edit', model:[inventoryItemInstance: result.inventoryItemInstance.attach(), 274 possibleAlternateItems: possibleAlternateItems, 275 suppliers: suppliers, 276 manufacturers: manufacturers]) 266 277 } 267 278 268 279 def create = { 269 280 def result = inventoryItemService.create(params) 281 def suppliers = Supplier.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 282 def manufacturers = Manufacturer.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 270 283 271 284 if(!result.error) 272 return [inventoryItemInstance: result.inventoryItemInstance] 285 return [inventoryItemInstance: result.inventoryItemInstance, 286 suppliers: suppliers, 287 manufacturers: manufacturers] 273 288 274 289 //flash.errorMessage = g.message(code: result.error.code, args: result.error.args) … … 285 300 } 286 301 302 def suppliers = Supplier.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 303 def manufacturers = Manufacturer.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } 304 287 305 //flash.errorMessage = g.message(code: result.error.code, args: result.error.args) 288 render(view:'create', model:[inventoryItemInstance: result.inventoryItemInstance]) 306 render(view:'create', model:[inventoryItemInstance: result.inventoryItemInstance, 307 suppliers: suppliers, 308 manufacturers: manufacturers]) 289 309 } 290 310
Note: See TracChangeset
for help on using the changeset viewer.