aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-04-16 17:26:12 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-04-23 15:00:27 +0100
commit0c4e267f43c573f638dd4771e5c39f6b3861dd3d (patch)
tree415e8be0e20f1ea3bb70ccf3be1f5809ae8b9ce1
parentce4d1c9214d211dc33444c900e759cd1cb4377b2 (diff)
Add hook to alter list of bodies on /reports page.
This allows a cobrand to e.g. display a subset of bodies based on a query parameter.
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 037458538..20381bb85 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -93,6 +93,7 @@ sub index : Path : Args(0) {
}
} else {
my @bodies = $c->model('DB::Body')->active->translated->with_area_count->all_sorted;
+ @bodies = @{$c->cobrand->call_hook('reports_hook_restrict_bodies_list', \@bodies) || \@bodies };
$c->stash->{bodies} = \@bodies;
}