Changeset 681 for trunk/grails-app


Ignore:
Timestamp:
Oct 5, 2010, 2:24:33 AM (13 years ago)
Author:
gav
Message:

Improvements to assetRegister report, adding site and section to page header.

Location:
trunk/grails-app
Files:
3 edited

Legend:

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

    r679 r681  
    161161        params.logoUrl = grailsApplication.mainContext.getResource('images/logo.png').getURL()
    162162        params.currentUser = authService.currentUser
    163         if(params.section.id == 'all')
    164             params.section = "All"
    165         else
    166             params.section = Section.get(params.section.id.toLong())
    167163
    168164        def dataModel = assetReportService.getAssetRegister(params, RCU.getLocale(request))
  • trunk/grails-app/services/AssetReportService.groovy

    r679 r681  
    2424        def result = [:]
    2525
     26        result.section = Section.get(params.section.id.toLong())
     27        result.site = result.section.site
     28
    2629        // Inner join used to return only attribTypes that are used by AssetExtendedAttributes.
    2730        // So the result is only asset extendedAttributeTypes.
     
    4447                    'left join asset.assetExtendedAttributes as attrib',
    4548                    'left join attrib.extendedAttributeType as attribT'
    46             if(params.section instanceof Section) {
    47                 namedParams.section = params.section
    48                 where 'asset.section = :section'
    49             }
     49            where 'asset.section = :section'
     50                    namedParams.section = result.section
    5051            order 'by asset.name asc, attribT.name asc'
    5152        }
  • trunk/grails-app/views/appCore/start.gsp

    r679 r681  
    156156                                                <g:select optionKey="id"
    157157                                                                    from="${Section.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
    158                                                                     name="section.id"
    159                                                                     noSelection="['all':/${g.message(code:'default.all.select.text')}/]">
     158                                                                    name="section.id">
    160159                                                </g:select>
    161160                                            </g:jasperReport>
Note: See TracChangeset for help on using the changeset viewer.