Changeset 689


Ignore:
Timestamp:
Oct 6, 2010, 5:31:07 AM (14 years ago)
Author:
gav
Message:

Add admin feature to create recommended extended attributes for assets and level 1 assetSubItems, part 2.

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

Legend:

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

    r688 r689  
    246246
    247247        def assets = Asset.list()
    248         def locationDescription = ExtendedAttributeType.get(5)
    249         def ecr = ExtendedAttributeType.get(9)
    250         def assetNumber = ExtendedAttributeType.get(17)
    251         def assetCondition = ExtendedAttributeType.get(16)
    252         def maintenancePercentComplete = ExtendedAttributeType.get(13)
    253         def registrationRequired = ExtendedAttributeType.get(14)
    254         def registrationExpiryDate =  ExtendedAttributeType.get(15)
    255         def regulatoryRequirement = ExtendedAttributeType.get(12)
    256         def riskLevel = ExtendedAttributeType.get(10)
    257         def safeWorkProcedure = ExtendedAttributeType.get(11)
     248        def locationDescription = ExtendedAttributeType.findByName("Location Description")
     249        def ecr = ExtendedAttributeType.findByName("ecr")
     250        def assetNumber = ExtendedAttributeType.findByName("Asset Number")
     251        def assetCondition = ExtendedAttributeType.findByName("Asset Condition")
     252        def maintenancePercentComplete = ExtendedAttributeType.findByName("Maintenance % Completion")
     253        def registrationRequired = ExtendedAttributeType.findByName("Registration Required")
     254        def registrationExpiryDate =  ExtendedAttributeType.findByName("Registration Expiry Date")
     255        def regulatoryRequirement = ExtendedAttributeType.findByName("Regulatory Requirement")
     256        def riskLevel = ExtendedAttributeType.findByName("Risk Level")
     257        def safeWorkProcedure = ExtendedAttributeType.findByName("Safe Work Procedure")
    258258
    259259        for(asset in assets) {
  • trunk/grails-app/services/AssetSubItemService.groovy

    r688 r689  
    150150        def assetSubItems = getLevel1AssetSubItems()
    151151
    152         def manufacturer = ExtendedAttributeType.get(8)
    153         def modelNumber = ExtendedAttributeType.get(1)
    154         def serialNumber = ExtendedAttributeType.get(3)
    155         def manufacturedDate = ExtendedAttributeType.get(4)
     152        def manufacturer = ExtendedAttributeType.findByName("Manufacturer")
     153        def modelNumber = ExtendedAttributeType.findByName("Model Number")
     154        def serialNumber = ExtendedAttributeType.findByName("Serial Number")
     155        def manufacturedDate = ExtendedAttributeType.findByName("Manufactured Date")
    156156
    157157        for(assetSubItem in assetSubItems) {
Note: See TracChangeset for help on using the changeset viewer.