Changeset 710
- Timestamp:
- Nov 16, 2010, 7:56:10 AM (14 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/ReportController.groovy
r709 r710 199 199 params.endDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: params.endDate) 200 200 201 def dataModel = assetReportService.getEquipmentRegister(params, RCU.getLocale(request)) 202 203 // Jasper plugin controller expects data to be a Collection. 204 chain(controller:'jasper', action:'index', model:[data: [dataModel]], params:params) 201 def result = assetReportService.getEquipmentRegister(params, RCU.getLocale(request)) 202 203 if(!result.error) { 204 // Jasper plugin controller expects data to be a Collection. 205 chain(controller:'jasper', action:'index', model:[data: [result]], params:params) 206 return 207 } 208 209 flash.errorMessage = g.message(code: result.error.code, args: result.error.args) 210 redirect(action: 'equipmentRegisterOhsGsp') 205 211 206 212 // render { -
trunk/grails-app/services/AssetReportService.groovy
r706 r710 134 134 def result = [:] 135 135 136 def fail = { Map m -> 137 result.error = [ code: m.code, args: [] ] 138 return result 139 } 140 136 141 result.section = Section.get(params.section.id.toLong()) 137 142 result.site = result.section.site … … 149 154 params.endDate = dateUtilService.today 150 155 151 // Normalise date range.152 156 if(params.endDate < params.startDate) 153 params.endDate = params.startDate157 return fail(code: "default.end.date.before.start.date") 154 158 155 159 // Inner join used to return only attribTypes that are used by AssetSubItemExtendedAttributes.
Note: See TracChangeset
for help on using the changeset viewer.