diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-05-02 11:08:03 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-05-02 16:07:59 +0100 |
commit | b9e02f9568c14a9a63e4e5b0a6dcedfa37eab085 (patch) | |
tree | a3a2c9a5871b1c309b550acc902fa6eddc2bd9f8 /perllib | |
parent | 1f83e1aec0128a2cc52d220e5eae2c2b2fad5122 (diff) |
[Oxfordshire] Include nearest info in RDI output.
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm b/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm index fd4b2be3c..31638662f 100644 --- a/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm +++ b/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm @@ -140,7 +140,15 @@ sub download : Path('download') : Args(0) { foreach my $report (@$inspections) { my ($eastings, $northings) = $report->local_coords; - my $location = "${eastings}E ${northings}N"; + + my $location = "${eastings}E ${northings}N."; + $location = "[DID NOT USE MAP] $location" unless $report->used_map; + my $closest_address = $c->cobrand->find_closest($report, 1); + if (%$closest_address) { + $location .= " Nearest road: $closest_address->{road}." if $closest_address->{road}; + $location .= " Nearest postcode: $closest_address->{postcode}{postcode}." if $closest_address->{postcode}; + } + my $description = sprintf("%s %s", $report->external_id || "", $report->get_extra_metadata('detailed_information') || ""); my $activity_code = $report->defect_type ? $report->defect_type->get_extra_metadata('activity_code') |