aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdmund von der Burg <evdb@mysociety.org>2011-02-09 12:28:15 +0000
committerEdmund von der Burg <evdb@mysociety.org>2011-02-09 12:28:15 +0000
commit00aadee36735bb75d039943ae54d2c6522fc9a0c (patch)
tree5bbce0a800563edd6203f17876c1d0ecce41ce37
parent7a96ac1718dcdacd10a41dbbb8494e52cda7e03c (diff)
Add eastings and northings back into problem report email if in UK
-rwxr-xr-xbin/send-reports16
-rw-r--r--templates/emails/submit-brent2
-rw-r--r--templates/emails/submit-council4
3 files changed, 19 insertions, 3 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') {
diff --git a/templates/emails/submit-brent b/templates/emails/submit-brent
index a93f59fcb..f3a9e5bb8 100644
--- a/templates/emails/submit-brent
+++ b/templates/emails/submit-brent
@@ -21,7 +21,7 @@ Email: <?=$values['email']?>
Details: <?=$values['detail']?>
-Latitude: <?=$values['latitude']?>
+<?=$values['easting_northing']?>Latitude: <?=$values['latitude']?>
Longitude: <?=$values['longitude']?>
diff --git a/templates/emails/submit-council b/templates/emails/submit-council
index 6281e6b94..aa72b4dd3 100644
--- a/templates/emails/submit-council
+++ b/templates/emails/submit-council
@@ -21,7 +21,7 @@ Email: <?=$values['email']?>
Details: <?=$values['detail']?>
-Latitude: <?=$values['latitude']?>
+<?=$values['easting_northing']?>Latitude: <?=$values['latitude']?>
Longitude: <?=$values['longitude']?>
@@ -29,7 +29,7 @@ Longitude: <?=$values['longitude']?>
Replies to this email will go to the user who submitted the problem.
-Yours,
+Yours,
The FixMyStreet team
[ This message was sent via FixMyStreet, a project of UKCOD, registered charity