diff options
author | Dave Arter <davea@mysociety.org> | 2015-10-06 11:50:48 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2015-10-06 11:50:48 +0100 |
commit | 2ed2c57659c0d288cd1cec391baef9faf002030d (patch) | |
tree | 742c5ad6e4671050805292061f85e9ff6ec308a0 /perllib/FixMyStreet/App/Controller/Report/New.pm | |
parent | de8ba7899dd4692cdf062f4b2735157f7fd14cb7 (diff) | |
parent | ffc03ca3330a43a98a3728df6f3d56c7fc1837d1 (diff) |
Merge branch 'zurich-2015-dev-candidate'
This is the work done in early 2015 to improve the Zürich admin interface, primarily.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index d5b84815b..246facbee 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -93,6 +93,7 @@ sub report_new : Path : Args(0) { $c->forward('check_for_category'); # deal with the user and report and check both are happy + return unless $c->forward('check_form_submitted'); $c->forward('process_user'); $c->forward('process_report'); @@ -290,7 +291,7 @@ sub report_import : Path('/import') { } # handle the photo upload - $c->forward( '/photo/process_photo_upload' ); + $c->forward( '/photo/process_photo' ); my $fileid = $c->stash->{upload_fileid}; if ( my $error = $c->stash->{photo_error} ) { push @errors, $error; @@ -889,8 +890,23 @@ sub process_report : Private { $report->bodies_str(-1); } else { # construct the bodies string: - # 'x,x' - x are body IDs that have this category - my $body_string = join( ',', map { $_->body_id } @contacts ); + my $body_string = do { + if ( $c->cobrand->can('singleton_bodies_str') && $c->cobrand->singleton_bodies_str ) { + # Cobrands like Zurich can only ever have a single body: 'x', because some functionality + # relies on string comparison against bodies_str. + if (@contacts) { + $contacts[0]->body_id; + } + else { + ''; + } + } + else { + # 'x,x' - x are body IDs that have this category + my $bs = join( ',', map { $_->body_id } @contacts ); + $bs; + }; + }; $report->bodies_str($body_string); # Record any body IDs which might have meant to match, but had no contact if ($body_string && @{ $c->stash->{missing_details_bodies} }) { @@ -1162,6 +1178,9 @@ sub redirect_or_confirm_creation : Private { } } ); $c->stash->{token_url} = $c->uri_for_email( '/P', $token->token ); + if ($c->cobrand->can('problem_confirm_email_extras')) { + $c->cobrand->problem_confirm_email_extras($report); + } $c->send_email( $template, { to => [ $report->name ? [ $report->user->email, $report->name ] : $report->user->email ], } ); |