aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-07-26 22:35:22 +0100
committerDave Arter <davea@mysociety.org>2017-07-26 22:35:22 +0100
commitf9dfc8e1a53b240b4c67ecf40646b395c172f365 (patch)
treed73cbc6a60b6dbb4b5fd4d90b65248c724db359e
parent4eda22305fec20749b540afa7f28174ffd46fad6 (diff)
Redirect to /around after inspecting a report
After a report has been inspected, the user is redirected to /around at the newly-inspected report’s location. Fixes mysociety/fixmystreetforcouncils#204
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 040579e9f..72cb0814c 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -444,9 +444,19 @@ sub inspect : Private {
$redirect_uri = $c->uri_for( $problem->url );
}
- # Or if inspector, redirect back to shortlist
+ # Or if inspector, redirect back to /around at this report's
+ # location with the right filters. We go here rather than the
+ # shortlist because it makes it much simpler to inspect many reports
+ # in the same location. The shortlist is always a single click away,
+ # being on the main nav.
if ($c->user->has_body_permission_to('planned_reports')) {
- $redirect_uri = $c->uri_for_action('my/planned');
+ my $categories = join(',', @{ $c->user->categories });
+ my $params = {
+ filter_category => $categories,
+ lat => $problem->latitude,
+ lon => $problem->longitude,
+ };
+ $redirect_uri = $c->uri_for( "/around", $params );
}
$c->log->debug( "Redirecting to: " . $redirect_uri );