aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-09-04 15:56:03 +0100
committerStruan Donald <struan@exo.org.uk>2018-09-13 11:00:53 +0100
commit90a2c224d2f4112609c140777ac065b60076f15d (patch)
tree48e11410ff00ee99d0d86512d3abe7ac00cd04d9 /perllib
parentf2a5d899308634fb06605a1d8035e19eadb8932a (diff)
allow web based use of report import
if a web parameter is passed to /import then display the email confirmation sent page rather than a SUCCESS message. Enables this page to be used for creating partial reports from a web page. For mysociety/collideoscope#17
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 869ed9461..dd4fef388 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -418,6 +418,12 @@ sub report_import : Path('/import') {
$c->send_email( 'partial.txt', { to => $report->user->email, } );
+ if ( $c->get_param('web') ) {
+ $c->res->content_type('text/html; charset=utf-8');
+ $c->stash->{template} = 'email_sent.html';
+ $c->stash->{email_type} = 'problem';
+ return 1;
+ }
$c->res->body('SUCCESS');
return 1;
}