diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-10-05 16:35:22 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-10-06 18:05:51 +0100 |
commit | f32e0900dd8c0a97c2b2214c973394e1fda2cb0e (patch) | |
tree | 131537542c9f2f58d54921319849f4ea5a9e9fa4 /perllib/FixMyStreet | |
parent | 7135fb0076664cdc13d2af537a2a00b37d61fa54 (diff) |
[Peterborough] Add USRN, nearest address to CSV.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Peterborough.pm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Peterborough.pm b/perllib/FixMyStreet/Cobrand/Peterborough.pm index cb7da18af..16c3a01e4 100644 --- a/perllib/FixMyStreet/Cobrand/Peterborough.pm +++ b/perllib/FixMyStreet/Cobrand/Peterborough.pm @@ -98,4 +98,26 @@ around 'open311_config' => sub { $self->$orig($row, $h, $params); }; +sub dashboard_export_problems_add_columns { + my ($self, $csv) = @_; + + $csv->add_csv_columns( + usrn => 'USRN', + nearest_address => 'Nearest address', + ); + + $csv->csv_extra_data(sub { + my $report = shift; + + my $address = ''; + $address = $report->geocode->{resourceSets}->[0]->{resources}->[0]->{name} + if $report->geocode; + + return { + usrn => $report->get_extra_field_value('site_code'), + nearest_address => $address, + }; + }); +} + 1; |