diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-02-09 12:28:15 +0000 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-02-09 12:28:15 +0000 |
commit | 00aadee36735bb75d039943ae54d2c6522fc9a0c (patch) | |
tree | 5bbce0a800563edd6203f17876c1d0ecce41ce37 /bin/send-reports | |
parent | 7a96ac1718dcdacd10a41dbbb8494e52cda7e03c (diff) |
Add eastings and northings back into problem report email if in UK
Diffstat (limited to 'bin/send-reports')
-rwxr-xr-x | bin/send-reports | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/send-reports b/bin/send-reports index 3e6a7fef6..6254337c6 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -27,6 +27,7 @@ use mySociety::Config; use mySociety::DBHandle qw(dbh); use mySociety::Email; use mySociety::EmailUtil; +use mySociety::GeoUtil; use mySociety::Locale; use mySociety::MaPit; use mySociety::Random qw(random_bytes); @@ -97,6 +98,21 @@ foreach my $row (@$unsent) { : _('The user could not locate the problem on a map, but to see the area around the location they entered'); $h{closest_address} = ''; $h{closest_address_machine} = ''; + + # If we are in the UK include eastings and northings + $h{easting_northing} = ''; + if ( mySociety::Config::get('COUNTRY') eq 'GB' ) { + + ( $h{easting}, $h{northing} ) = + mySociety::GeoUtil::wgs84_to_national_grid( # + $h{latitude}, $h{longitude}, 'G' + ); + + # email templates don't have conditionals so we need to farmat this here + $h{easting_northing} # + = "Easting: $h{easting}\n\n" # + . "Northing: $h{northing}\n\n"; + } my (@to, @recips, $template, $areas_info); if ($site eq 'emptyhomes') { |