aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-05-02 10:33:36 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-05-02 16:05:17 +0100
commit1f83e1aec0128a2cc52d220e5eae2c2b2fad5122 (patch)
treedfb84334cdc163d95e0112ff19ab39739b81bfbc /perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm
parent6e739457cb294f7c99ce0a5b1132292c8fc352ac (diff)
Tidy up find_closest* functions.
Allow find_closest to be called multiple times with only one lookup, and to return just its data, not a compiled string.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm b/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm
index 201742c81..fd4b2be3c 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/ExorDefects.pm
@@ -140,6 +140,7 @@ sub download : Path('download') : Args(0) {
foreach my $report (@$inspections) {
my ($eastings, $northings) = $report->local_coords;
+ my $location = "${eastings}E ${northings}N";
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')
@@ -153,7 +154,7 @@ sub download : Path('download') : Args(0) {
$activity_code, # activity code - minor carriageway, also FC (footway)
"", # empty field, can also be A (seen on MC) or B (seen on FC)
sprintf("%03d", ++$i), # randomised sequence number
- "${eastings}E ${northings}N", # defect location field, which we don't capture from inspectors
+ $location, # defect location field, which we don't capture from inspectors
$report->inspection_log_entry->whenedited->strftime("%H%M"), # defect time raised
"","","","","","","", # empty fields
$traffic_information,
@@ -227,4 +228,4 @@ sub download : Path('download') : Args(0) {
$c->res->body( join "", map { "\"$_\"\r\n" } @body );
}
-1; \ No newline at end of file
+1;