aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2017-11-13 17:19:01 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-05-09 09:55:10 +0100
commit22815e994510659870987609d244b3f6324bab22 (patch)
tree7bc911a45036293dfed878827a02415d0c5b860f
parent4d8a7441a706a86e01f474dfed620922338e32ad (diff)
Allow cobrand override of admin reports search.
This is to enable custom reporting for cobrands on the reports page.
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 535a8d08e..8f8d7cc47 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -644,6 +644,9 @@ sub category : Chained('body') : PathPart('') {
sub reports : Path('reports') {
my ( $self, $c ) = @_;
+ $c->stash->{edit_body_contacts} = 1
+ if grep { $_ eq 'body' } keys %{$c->stash->{allowed_pages}};
+
my $query = {};
if ( $c->cobrand->moniker eq 'zurich' ) {
my $type = $c->stash->{admin_type};
@@ -666,6 +669,8 @@ sub reports : Path('reports') {
my $p_page = $c->get_param('p') || 1;
my $u_page = $c->get_param('u') || 1;
+ return if $c->cobrand->call_hook(report_search_query => $query, $p_page, $u_page, $order);
+
if (my $search = $c->get_param('search')) {
$c->stash->{searched} = $search;
@@ -786,10 +791,6 @@ sub reports : Path('reports') {
$c->stash->{problems} = [ $problems->all ];
$c->stash->{problems_pager} = $problems->pager;
}
-
- $c->stash->{edit_body_contacts} = 1
- if ( grep {$_ eq 'body'} keys %{$c->stash->{allowed_pages}});
-
}
sub update_user : Private {