diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-02-05 14:26:26 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-02-17 13:44:11 +0000 |
commit | d01b3c306f4b65ddfb0151cb890a7e3da96c4b97 (patch) | |
tree | 8ae0f73259afc427a5886ffabe5f98c6d12b81ed /perllib/FixMyStreet | |
parent | 2e9b93e1dc9c2e42d99b514e79689971830f7866 (diff) |
[TfL] Include borough name in report lists.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/TfL.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/TfL.pm b/perllib/FixMyStreet/Cobrand/TfL.pm index 5c08cb540..1fa0aabe0 100644 --- a/perllib/FixMyStreet/Cobrand/TfL.pm +++ b/perllib/FixMyStreet/Cobrand/TfL.pm @@ -22,6 +22,19 @@ sub council_url { return 'tfl'; } sub area_types { [ 'LBO' ] } sub is_council { 0 } +sub borough_for_report { + my ($self, $problem) = @_; + + # Get relevant area ID from report + my %areas = map { $_ => 1 } split ',', $problem->areas; + my ($council_match) = grep { $areas{$_} } @{ $self->council_area_id }; + return unless $council_match; + + # Look up area names if not already fetched + my $areas = $self->{c}->stash->{children} ||= $self->fetch_area_children; + return $areas->{$council_match}{name}; +} + sub abuse_reports_only { 1 } sub send_questionnaires { 0 } |