Changeset 687 for trunk/grails-app


Ignore:
Timestamp:
Oct 6, 2010, 1:55:47 AM (14 years ago)
Author:
gav
Message:

Change assetDetail report to allow reporting by section and display site in report.

Location:
trunk/grails-app
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/AppCoreController.groovy

    r627 r687  
    6363        def plugins = pluginProperties.collect{ it.key + '-' + it.value }.join(", ")
    6464
     65        def sections = Section.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }
     66
    6567        return [grailsVersion: grailsVersion,
    6668                    applicationString: applicationString,
    67                     plugins: plugins]
     69                    plugins: plugins,
     70                    sections: sections]
    6871    }
    6972
  • trunk/grails-app/controllers/ReportController.groovy

    r681 r687  
    144144        params.logoUrl = grailsApplication.mainContext.getResource('images/logo.png').getURL()
    145145        params.currentUser = authService.currentUser
    146         if(params.asset.id == 'all')
    147             params.asset = "All"
    148         else
    149             params.asset = Asset.get(params.asset.id.toLong())
     146        if(params.section.id == 'all') {
     147            params.section = "All"
     148            params.site = "All"
     149        }
     150        else {
     151            params.section = Section.get(params.section.id.toLong())
     152            params.site = params.section.site
     153        }
    150154
    151155        def dataModel = assetReportService.getAssetDetail(params, RCU.getLocale(request))
  • trunk/grails-app/services/AssetReportService.groovy

    r686 r687  
    111111                    'left join asset.assetExtendedAttributes as attrib',
    112112                    'left join attrib.extendedAttributeType as attribT'
    113             if(params.asset instanceof Asset) {
    114                 namedParams.asset = params.asset
    115                 where 'asset = :asset'
     113            if(params.section instanceof Section) {
     114                namedParams.section = params.section
     115                where 'asset.section = :section'
    116116            }
    117117            order 'by asset.name asc, attribT.name asc'
  • trunk/grails-app/views/appCore/start.gsp

    r681 r687  
    143143                                                                            format="PDF, XLS">
    144144                                                <g:select optionKey="id"
    145                                                                     from="${Asset.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
    146                                                                     name="asset.id"
     145                                                                    from="${sections}"
     146                                                                    name="section.id"
    147147                                                                    noSelection="['all':/${g.message(code:'default.all.select.text')}/]">
    148148                                                </g:select>
     
    155155                                                                            format="PDF, XLS">
    156156                                                <g:select optionKey="id"
    157                                                                     from="${Section.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
     157                                                                    from="${sections}"
    158158                                                                    name="section.id">
    159159                                                </g:select>
     
    166166                                                                            format="PDF, XLS">
    167167                                                <g:select optionKey="id"
    168                                                                     from="${Section.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
     168                                                                    from="${sections}"
    169169                                                                    name="section.id">
    170170                                                </g:select>
Note: See TracChangeset for help on using the changeset viewer.