From 6a1ad33c07de846f15af48c7a01eb567d9263da3 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Mon, 9 Sep 2019 17:43:59 +0100 Subject: [IsleOfWight] correctly filter categories on report page If it's a standard user only display the Triage category list but if one of these is selected then look up all the categories in that group and use those to select the reports to display. It it's a staff user then ignore the Triage categories. --- perllib/FixMyStreet/App/Controller/Reports.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/App/Controller') diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 9b33b42b4..8e167a70d 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -165,10 +165,13 @@ sub ward : Path : Args(2) { $c->stash->{stats} = $c->cobrand->get_report_stats(); my @categories = $c->stash->{body}->contacts->not_deleted->search( undef, { - columns => [ 'id', 'category', 'extra' ], + columns => [ 'id', 'category', 'extra', 'body_id', 'send_method' ], distinct => 1, order_by => [ 'category' ], } )->all; + + $c->cobrand->call_hook('munge_reports_category_list', \@categories); + $c->stash->{filter_categories} = \@categories; $c->stash->{filter_category} = { map { $_ => 1 } $c->get_param_list('filter_category', 1) }; -- cgit v1.2.3