Changeset 633 for trunk/grails-app/controllers
- Timestamp:
- Jul 19, 2010, 8:47:38 AM (14 years ago)
- Location:
- trunk/grails-app/controllers
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/CostCodeDetailedController.groovy
r632 r633 78 78 } 79 79 costCodeInstance.properties = params 80 // Trim name to avoid spaces. 81 costCodeInstance.name = costCodeInstance.name.trim() 80 82 if(!costCodeInstance.hasErrors() && costCodeInstance.save(flush: true)) { 81 83 flash.message = "CostCode ${params.id} updated" … … 100 102 def save = { 101 103 def costCodeInstance = new CostCode(params) 104 // Trim name to avoid spaces. 105 costCodeInstance.name = costCodeInstance.name.trim() 102 106 if(!costCodeInstance.hasErrors() && costCodeInstance.save(flush: true)) { 103 107 flash.message = "CostCode ${costCodeInstance.id} created" -
trunk/grails-app/controllers/InventoryItemPurchaseDetailedController.groovy
r615 r633 226 226 params.returnTo = params.returnTo ?: 'inventoryItem' 227 227 228 if(!result.error) 229 return [ inventoryItemPurchaseInstance : result.inventoryItemPurchaseInstance ] 228 def costCodes = [] 229 230 if(!result.error) { 231 if(inventoryPurchaseService.isPersonInPurchasingGroup(result.inventoryItemPurchaseInstance.costCode.purchasingGroup)) 232 costCodes = inventoryPurchaseService.getCostCodesByPerson() 233 234 return [ inventoryItemPurchaseInstance : result.inventoryItemPurchaseInstance, 235 'costCodes': costCodes ] 236 } 230 237 231 238 flash.errorMessage = g.message(code: result.error.code, args: result.error.args) … … 248 255 } 249 256 250 render(view:'edit', model:[inventoryItemPurchaseInstance: result.inventoryItemPurchaseInstance.attach()]) 257 result.inventoryItemPurchaseInstance.attach() 258 result.inventoryItemPurchaseInstance.costCode.attach() 259 result.inventoryItemPurchaseInstance.costCode.purchasingGroup.attach() 260 261 def costCodes = [] 262 if(inventoryPurchaseService.isPersonInPurchasingGroup(result.inventoryItemPurchaseInstance.costCode.purchasingGroup)) 263 costCodes = inventoryPurchaseService.getCostCodesByPerson() 264 265 render(view:'edit', model:[inventoryItemPurchaseInstance: result.inventoryItemPurchaseInstance, 266 'costCodes': costCodes]) 251 267 } 252 268 … … 262 278 } 263 279 264 return ['inventoryItemPurchaseInstance':inventoryItemPurchaseInstance] 280 def costCodes = inventoryPurchaseService.getCostCodesByPerson() 281 282 return ['inventoryItemPurchaseInstance': inventoryItemPurchaseInstance, 283 'costCodes': costCodes] 265 284 } 266 285 … … 282 301 } 283 302 303 def costCodes = inventoryPurchaseService.getCostCodesByPerson() 304 284 305 params.errorMessage = g.message(code: result.error.code, args: result.error.args) 285 render(view:'create', model:['inventoryItemPurchaseInstance': result.inventoryItemPurchaseInstance]) 306 render(view:'create', model:['inventoryItemPurchaseInstance': result.inventoryItemPurchaseInstance, 307 'costCodes': costCodes]) 286 308 } 287 309 -
trunk/grails-app/controllers/PersonController.groovy
r628 r633 157 157 person.properties = params 158 158 person.setPersonGroupsFromCheckBoxList(params.personGroups) 159 person.setPurchasingGroupsFromCheckBoxList(params.purchasingGroups) 159 160 160 161 if(params.pass == "") { … … 194 195 person.password = authenticateService.encodePassword(params.pass) 195 196 person.setPersonGroupsFromCheckBoxList(params.personGroups) 197 person.setPurchasingGroupsFromCheckBoxList(params.purchasingGroups) 196 198 if (person.save(flush: true)) { 197 199 addRemoveAuthorities(person)
Note: See TracChangeset
for help on using the changeset viewer.