diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 11 | ||||
-rw-r--r-- | templates/web/default/admin/council_contacts.html | 4 | ||||
-rw-r--r-- | templates/web/default/admin/search_users.html | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index acdaf7c04..55372afb5 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -483,6 +483,10 @@ sub search_reports : Path('search_reports') { $query = [ 'me.id' => int($1), ]; + } elsif ($search =~ /^area:(\d+)$/) { + $query = [ + 'me.areas' => { like => ",$1," } + ]; } else { $query = [ 'me.id' => $search_n, @@ -523,6 +527,8 @@ sub search_reports : Path('search_reports') { 'problem.id' => int($1), %{ $site_restriction }, ]; + } elsif ($search =~ /^area:(\d+)$/) { + $query = []; } else { $query = [ 'me.id' => $search_n, @@ -534,7 +540,8 @@ sub search_reports : Path('search_reports') { %{ $site_restriction }, ]; } - my $updates = $c->model('DB::Comment')->search( + my $updates; + $updates = $c->model('DB::Comment')->search( { -or => $query, }, @@ -543,7 +550,7 @@ sub search_reports : Path('search_reports') { prefetch => [qw/user problem/], order_by => [\"(me.state='hidden')",\"(problem.state='hidden')",'me.created'] } - ); + ) if @$query; $c->stash->{updates} = [ $updates->all ]; diff --git a/templates/web/default/admin/council_contacts.html b/templates/web/default/admin/council_contacts.html index acfec3ed4..da7223aa6 100644 --- a/templates/web/default/admin/council_contacts.html +++ b/templates/web/default/admin/council_contacts.html @@ -10,7 +10,11 @@ [% IF example_pc %] <a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> | [% END %] +[% IF c.cobrand.moniker == 'emptyhomes' %] +<a href="[% c.uri_for( 'search_reports', search => 'area:' _ area_id ) %]">[% loc('List all reported problems' ) %]</a> +[% ELSE %] <a href="[% c.uri_for_email( '/reports/' _ area_id ) %]">[% loc('List all reported problems' ) %]</a> +[% END %] <a href="[% c.uri_for( 'council_contacts', area_id, { text => 1 } ) %]">[% loc('Text only version') %]</a> </p> diff --git a/templates/web/default/admin/search_users.html b/templates/web/default/admin/search_users.html index 98723e6ef..18c964dfe 100644 --- a/templates/web/default/admin/search_users.html +++ b/templates/web/default/admin/search_users.html @@ -18,7 +18,7 @@ [%- FOREACH user IN users %] <tr> <td>[% PROCESS value_or_nbsp value=user.name %]</td> - <td><a href="[% c.uri_for( 'search_reports', user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td> + <td><a href="[% c.uri_for( 'search_reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td> <td>[% PROCESS value_or_nbsp value=user.from_council %]</td> <td>[% user.flagged ? loc('Yes') : ' ' %]</td> <td><a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('Edit') %]</a></td> |