diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-01-13 10:25:24 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-01-13 10:25:24 +0000 |
commit | 1750fb706ff9a88b3d3ddee78333ecb5f8d66cef (patch) | |
tree | d1647592e504c5204e18573eb6e076ff8add385d /perllib/FixMyStreet | |
parent | eea513cc0ffc4f494f5adec0b8032f661a75a789 (diff) | |
parent | 197c942e43eed14268f684151b0f088d926cf588 (diff) |
Merge branch 'tfl-no-resend'
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Reports.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/TfL.pm | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Reports.pm b/perllib/FixMyStreet/App/Controller/Admin/Reports.pm index c57b207e2..ef9736ff6 100644 --- a/perllib/FixMyStreet/App/Controller/Admin/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Admin/Reports.pm @@ -485,6 +485,7 @@ sub categories_for_point : Private { my $prefetched_all_areas = [ grep { $_ } split ',', $c->stash->{report}->areas ]; $c->forward('/around/check_location_is_acceptable', [ $prefetched_all_areas ]); # As with a new report, fetch the bodies/categories + $c->stash->{categories_for_point} = 1; $c->forward('/report/new/setup_categories_and_bodies'); # Remove the "Pick a category" option diff --git a/perllib/FixMyStreet/Cobrand/TfL.pm b/perllib/FixMyStreet/Cobrand/TfL.pm index 797b872a4..e32711a02 100644 --- a/perllib/FixMyStreet/Cobrand/TfL.pm +++ b/perllib/FixMyStreet/Cobrand/TfL.pm @@ -83,7 +83,9 @@ sub base_url_for_report { sub categories_restriction { my ($self, $rs) = @_; - return $rs->search( { 'body.name' => 'TfL' } ); + $rs = $rs->search( { 'body.name' => 'TfL' } ); + return $rs unless $self->{c}->stash->{categories_for_point}; # Admin page + return $rs->search( { category => { -not_in => $self->_tfl_no_resend_categories } } ); } sub admin_user_domain { 'tfl.gov.uk' } @@ -498,4 +500,10 @@ sub _cleaning_groups { [ 'Street cleaning' ] } sub _tfl_council_category { 'General Litter / Rubbish Collection' } +sub _tfl_no_resend_categories { [ + 'General Litter / Rubbish Collection', + 'Other (TfL)', + 'Timings', +] } + 1; |