aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2019-09-19 18:12:46 +0100
committerStruan Donald <struan@exo.org.uk>2019-09-27 17:43:38 +0100
commit4668f81a8242e6c00bb68ff8d85b05ab1bcdec8d (patch)
treef9b8b5a5a3c15ea96b1d9de6a0cce5a83ee7b5a7 /perllib/FixMyStreet/Cobrand/FixMyStreet.pm
parent6b01232a4108accdb4bc5f2cbca1044c1b317972 (diff)
[IsleOfWight] limit filter category on national around page
Only display non triage categories on this because getting the category expansion to work if we use the triage categories isn't in place and may not be. This is because when we get the list of reports using /around/ajax there's no way to know which body it is for so we don't know how to expand a triage category to the list of 'child' categories. So, just display the non triage ones for now.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/FixMyStreet.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/FixMyStreet.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
index bfa991b09..705b623d4 100644
--- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
+++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
@@ -38,6 +38,20 @@ sub restriction {
return {};
}
+sub munge_around_category_where {
+ my ($self, $where) = @_;
+
+ my $user = $self->{c}->user;
+ my @iow = grep { $_->name eq 'Isle of Wight Council' } @{ $self->{c}->stash->{bodies} };
+ return unless @iow;
+
+ # display all the categories on Isle of Wight at the moment as there's no way to
+ # do the expand bit later as we fetch it using ajax which uses a bounding box so
+ # can't determine the body
+ $where->{send_method} = [ { '!=' => 'Triage' }, undef ];
+ return $where;
+}
+
sub munge_reports_categories_list {
my ($self, $categories) = @_;