aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Script/Reports.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-06-22 18:18:38 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-06-22 18:20:35 +0100
commit19241c52172aec0c797a00b35a090e28f7858e1d (patch)
tree21a81d44f5c10ce8ffbbc862b113280ccaef3a5b /perllib/FixMyStreet/Script/Reports.pm
parent368d980d25c00248f46b7e8ca8fec287e5dff58d (diff)
Tidy up some UK specific easting/northing handling
Diffstat (limited to 'perllib/FixMyStreet/Script/Reports.pm')
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm16
1 files changed, 2 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index 278c58af1..30d24f640 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -108,8 +108,6 @@ sub send(;$) {
$h{user_details} .= sprintf(_('Email: %s'), $row->user->email) . "\n\n";
}
- $h{easting_northing} = '';
-
if ($cobrand->can('process_additional_metadata_for_email')) {
$cobrand->process_additional_metadata_for_email($row, \%h);
}
@@ -150,19 +148,9 @@ sub send(;$) {
$reporters{ $sender }->add_body( $body, $sender_info->{config} );
}
- # If we are in the UK include eastings and northings, and nearest stuff
+ # If we are in the UK include eastings and northings
if ( $cobrand->country eq 'GB' && !$h{easting} ) {
- my $coordsyst = 'G';
- my $first_area = $body->body_areas->first->area_id;
- my $area_info = mySociety::MaPit::call('area', $first_area);
- $coordsyst = 'I' if $area_info->{type} eq 'LGD';
-
- ( $h{easting}, $h{northing} ) = Utils::convert_latlon_to_en( $h{latitude}, $h{longitude}, $coordsyst );
-
- # email templates don't have conditionals so we need to format this here
- $h{easting_northing} = "Easting/Northing";
- $h{easting_northing} .= " (IE)" if $coordsyst eq 'I';
- $h{easting_northing} .= ": $h{easting}/$h{northing}\n\n";
+ ( $h{easting}, $h{northing}, $h{coordsyst} ) = $row->local_coords;
}
}