diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 25 | ||||
-rw-r--r-- | templates/web/zurich/admin/problem_row.html | 4 | ||||
-rw-r--r-- | templates/web/zurich/admin/reports.html | 2 |
3 files changed, 23 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index faad88f1f..5e177f000 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -527,10 +527,29 @@ sub reports : Path('reports') { cobrand_data => { like => $like_search }, ]; } + + if ( $c->cobrand->moniker eq 'zurich' ) { + my $type = $c->stash->{admin_type}; + my $body = $c->stash->{body}; + if ( $type eq 'super' ) { + $query = { -or => $query }; + } elsif ( $type eq 'dm' ) { + my @children = map { $_->id } $body->bodies->all; + my @all = (@children, $body->id); + $query = { + bodies_str => \@all, + -or => $query + }; + } elsif ( $type eq 'sdm' ) { + $query = { bodies_str => $body->id, -or => $query }; + } + } else { + $query = { -or => $query }; + } + + my $problems = $c->cobrand->problems->search( - { - -or => $query, - }, + $query, { prefetch => 'user', order_by => [\"(state='hidden')",'created'] diff --git a/templates/web/zurich/admin/problem_row.html b/templates/web/zurich/admin/problem_row.html index ce986cb20..f84d22711 100644 --- a/templates/web/zurich/admin/problem_row.html +++ b/templates/web/zurich/admin/problem_row.html @@ -1,9 +1,5 @@ [%- FOR problem IN problems %] [% SET p_body = problem.bodies.values.0 %] - [% IF page == 'search' %] - [% NEXT IF admin_type == 'sdm' AND p_body.id != body.id %] - [% NEXT IF admin_type == 'dm' AND p_body.id != body.id AND p_body.parent.id != body.id %] - [% END %] <tr[% SET classes = []; classes.push('adminhidden') IF problem.state == 'hidden'; diff --git a/templates/web/zurich/admin/reports.html b/templates/web/zurich/admin/reports.html index 97d0aff7b..5122f7b5a 100644 --- a/templates/web/zurich/admin/reports.html +++ b/templates/web/zurich/admin/reports.html @@ -17,7 +17,7 @@ <th>[% loc('Status') %]</th> <th>*</th> </tr> - [% INCLUDE 'admin/problem_row.html', page = 'search' %] + [% INCLUDE 'admin/problem_row.html' %] </table> [% INCLUDE 'pagination.html', admin = 1, param = 'p' IF pager %] |