Changeset 387 for trunk/grails-app
- Timestamp:
- Feb 18, 2010, 8:10:41 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/Config.groovy
r386 r387 280 280 ] 281 281 ], 282 [order:140, controller:'extendedAttributeTypeDetailed', title:'extendedAttribute ', action:'list',282 [order:140, controller:'extendedAttributeTypeDetailed', title:'extendedAttributeType', action:'list', 283 283 subItems: [ 284 284 [order:10, controller:'extendedAttributeTypeDetailed', title:'Attribute Type List', action:'list', isVisible: { true }], -
trunk/grails-app/controllers/AssetDetailedController.groovy
r375 r387 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 import org.codehaus.groovy.grails.commons.ConfigurationHolder 3 import org.apache.commons.lang.WordUtils 3 4 4 5 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager']) … … 288 289 assetInstance.properties = params 289 290 291 use(WordUtils) { 292 assetInstance.name = assetInstance.name.capitalize() 293 assetInstance.description = assetInstance.description.capitalize() 294 } 295 290 296 assetInstance.setAssetSubItemsFromCheckBoxList(params.assetSubItems) 291 297 292 298 if(!assetInstance.hasErrors() && assetInstance.save(flush: true)) { 293 flash.message = "Asset ${params.id}updated"299 flash.message = "Asset '${assetInstance.name}' updated" 294 300 redirect(action:show,id:assetInstance.id) 295 301 } … … 335 341 def save = { 336 342 def result = assetService.save(params) 343 344 if(!result.error) { 345 flash.message = g.message(code: "default.create.success", args: ["Asset", "'${result.assetInstance.name}'"]) 346 redirect(action:show, id: result.assetInstance.id) 347 return 348 } 349 350 render(view:'create', model:[assetInstance: result.assetInstance]) 351 } 352 353 /** 354 * Copy save action. 355 */ 356 def saveCopy = { 357 def result = assetService.saveCopy(params) 337 358 338 359 if(!result.error) { … … 342 363 } 343 364 344 render(view:'create', model:[assetInstance: result.assetInstance])345 }346 347 /**348 * Copy save action.349 */350 def saveCopy = {351 def result = assetService.saveCopy(params)352 353 if(!result.error) {354 flash.message = g.message(code: "default.create.success", args: ["Asset", result.assetInstance.id])355 redirect(action:show, id: result.assetInstance.id)356 return357 }358 359 365 if(result.error.code == "default.not.found") { 360 366 flash.message = g.message(code: result.error.code, args: ["Asset", params.assetToCopy?.id]) -
trunk/grails-app/controllers/AssetSubItemDetailedController.groovy
r375 r387 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 import org.codehaus.groovy.grails.commons.ConfigurationHolder 3 import org.apache.commons.lang.WordUtils 3 4 4 5 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager']) … … 165 166 assetSubItemInstance.properties = params 166 167 168 use(WordUtils) { 169 assetSubItemInstance.name = assetSubItemInstance.name.capitalize() 170 assetSubItemInstance.description = assetSubItemInstance.description.capitalize() 171 } 172 167 173 if(assetSubItemInstance.assets) { 168 174 assetSubItemInstance.parentItem = null … … 170 176 171 177 if(!assetSubItemInstance.hasErrors() && assetSubItemInstance.save(flush: true)) { 172 flash.message = " AssetSubItem ${params.id}updated"178 flash.message = "Sub Item '${assetSubItemInstance.name}' updated" 173 179 174 180 if(assetSubItemInstance.assets) … … 217 223 if(!result.error) { 218 224 // Success. 219 flash.message = g.message(code: "default.create.success", args: [" AssetSubItem", result.assetSubItemInstance.name])225 flash.message = g.message(code: "default.create.success", args: ["Sub Item", "'${result.assetSubItemInstance.name}'"]) 220 226 221 227 /// @todo: This just grabs the first parent in an unsorted list and needs improving. -
trunk/grails-app/services/AssetService.groovy
r360 r387 1 2 import org.apache.commons.lang.WordUtils 3 1 4 class AssetService { 2 5 … … 116 119 result.assetInstance = new Asset(params) 117 120 121 use(WordUtils) { 122 result.assetInstance.name = result.assetInstance.name.capitalize() 123 result.assetInstance.description = result.assetInstance.description.capitalize() 124 } 125 118 126 if(result.assetInstance.hasErrors() || !result.assetInstance.save(flush: true)) 119 127 return fail(code:"default.create.failure") -
trunk/grails-app/services/AssetSubItemService.groovy
r360 r387 1 2 import org.apache.commons.lang.WordUtils 3 1 4 class AssetSubItemService { 2 5 … … 93 96 result.assetSubItemInstance = new AssetSubItem(params) 94 97 98 use(WordUtils) { 99 result.assetSubItemInstance.name = result.assetSubItemInstance.name.capitalize() 100 result.assetSubItemInstance.description = result.assetSubItemInstance.description.capitalize() 101 } 102 95 103 if(params.asset?.id) { 96 104 result.assetInstance = Asset.get(params.asset.id)
Note: See TracChangeset
for help on using the changeset viewer.