Changeset 732 for trunk/grails-app
- Timestamp:
- Nov 30, 2010, 10:24:52 AM (14 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/ReportController.groovy
r710 r732 85 85 def reactiveRatio = { 86 86 87 def result = taskReportService.getReactiveRatio(params, RCU.getLocale(request)) 88 87 89 params.reportTitle = "Reactive Ratio Report" 88 90 params.logoUrl = grailsApplication.mainContext.getResource('images/logo.png').getURL() 89 91 params.currentUser = authService.currentUser 90 params.startDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: params.startDate) 91 params.endDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: params.endDate) 92 93 def result = taskReportService.getReactiveRatio(params, RCU.getLocale(request)) 92 params.startDateString = result.startDateString 93 params.endDateString = result.endDateString 94 94 95 95 if(!result.error) { … … 106 106 def immediateCallouts = { 107 107 108 def result = taskReportService.getImmediateCallouts(params, RCU.getLocale(request)) 109 108 110 params.reportTitle = "Immediate Callouts" 109 111 params.logoUrl = grailsApplication.mainContext.getResource('images/logo.png').getURL() 110 112 params.currentUser = authService.currentUser 111 params.startDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: params.startDate) 112 params.endDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: params.endDate) 113 114 def result = taskReportService.getImmediateCallouts(params, RCU.getLocale(request)) 113 params.startDateString = result.startDateString 114 params.endDateString = result.endDateString 115 115 116 116 if(!result.error) { -
trunk/grails-app/i18n/messages.properties
r728 r732 312 312 default.file.no.header=The supplied file does not have the correct header lines, please see the template file. 313 313 default.not.development.environment.failure=Could not complete operation, dev environment not detected. 314 default.end.date.before.start.date=The end date must be equal to or greater than \315 the start date.316 314 317 315 default.doesnt.match.message=Property [{0}] of class [{1}] with value [{2}] does not match the required pattern [{3}] -
trunk/grails-app/services/AssetReportService.groovy
r728 r732 154 154 params.endDate = dateUtilService.today 155 155 156 if(params.endDate < params.startDate) 157 return fail(code: "default.end.date.before.start.date") 156 // Auto swap date range. 157 if(params.startDate > params.endDate) { 158 def tempStartDate = params.startDate 159 params.startDate = params.endDate 160 params.endDate = tempStartDate 161 } 158 162 159 163 // Inner join used to return only attribTypes that are used by AssetSubItemExtendedAttributes. -
trunk/grails-app/services/TaskReportService.groovy
r709 r732 33 33 namedParams.endDate = params.endDate ?: dateUtilService.today 34 34 35 if(namedParams.endDate < namedParams.startDate) 36 return fail(code: "default.end.date.before.start.date") 35 // Auto swap date range. 36 if(namedParams.startDate > namedParams.endDate) { 37 def tempStartDate = namedParams.startDate 38 namedParams.startDate = namedParams.endDate 39 namedParams.endDate = tempStartDate 40 } 41 42 result.startDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: namedParams.startDate) 43 result.endDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: namedParams.endDate) 37 44 38 45 namedParams.endDate++ // Start of next day required. … … 178 185 namedParams.endDate = params.endDate ?: dateUtilService.today 179 186 180 if(namedParams.endDate < namedParams.startDate) 181 return fail(code: "default.end.date.before.start.date") 187 // Auto swap date range. 188 if(namedParams.startDate > namedParams.endDate) { 189 def tempStartDate = namedParams.startDate 190 namedParams.startDate = namedParams.endDate 191 namedParams.endDate = tempStartDate 192 } 193 194 result.startDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: namedParams.startDate) 195 result.endDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: namedParams.endDate) 182 196 183 197 namedParams.endDate++ // Start of next day required.
Note: See TracChangeset
for help on using the changeset viewer.