Ignore:
Timestamp:
Feb 18, 2010, 8:10:41 PM (15 years ago)
Author:
gav
Message:

Capitalise asset and sub items during creation and update.
Small correction to alt menu.

Location:
trunk/grails-app/services
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/AssetService.groovy

    r360 r387  
     1
     2import org.apache.commons.lang.WordUtils
     3
    14class AssetService {
    25
     
    116119        result.assetInstance = new Asset(params)
    117120
     121        use(WordUtils) {
     122            result.assetInstance.name = result.assetInstance.name.capitalize()
     123            result.assetInstance.description = result.assetInstance.description.capitalize()
     124        }
     125
    118126        if(result.assetInstance.hasErrors() || !result.assetInstance.save(flush: true))
    119127            return fail(code:"default.create.failure")
  • trunk/grails-app/services/AssetSubItemService.groovy

    r360 r387  
     1
     2import org.apache.commons.lang.WordUtils
     3
    14class AssetSubItemService {
    25
     
    9396            result.assetSubItemInstance = new AssetSubItem(params)
    9497
     98            use(WordUtils) {
     99                result.assetSubItemInstance.name = result.assetSubItemInstance.name.capitalize()
     100                result.assetSubItemInstance.description = result.assetSubItemInstance.description.capitalize()
     101            }
     102
    95103            if(params.asset?.id) {
    96104                result.assetInstance = Asset.get(params.asset.id)
Note: See TracChangeset for help on using the changeset viewer.