aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm15
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm5
2 files changed, 19 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index a2c5e6a0c..a4462e035 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1010,6 +1010,13 @@ sub save_user_and_report : Private {
# Set unknown to DB unknown
$report->council( undef ) if $report->council eq '-1';
+ # if there is a Message Manager message ID, pass it back to the client view
+ if ($c->cobrand->moniker eq 'fixmybarangay' && $c->req->param('external_source_id')=~/^\d+$/) {
+ $c->stash->{external_source_id} = $c->req->param('external_source_id');
+ $report->external_source_id( $c->req->param('external_source_id') );
+ $report->external_source( $c->config->{MESSAGE_MANAGER_URL} ) ;
+ }
+
# save the report;
$report->in_storage ? $report->update : $report->insert();
@@ -1080,7 +1087,13 @@ sub redirect_or_confirm_creation : Private {
if ( $report->confirmed ) {
# Subscribe problem reporter to email updates
$c->forward( 'create_reporter_alert' );
- my $report_uri = $c->cobrand->base_url_for_report( $report ) . $report->url;
+ my $report_uri;
+
+ if ( $c->cobrand->moniker eq 'fixmybarangay' && $c->user->from_council && $c->stash->{external_source_id}) {
+ $report_uri = $c->uri_for( '/report', $report->id, undef, { external_source_id => $c->stash->{external_source_id} } );
+ } else {
+ $report_uri = $c->cobrand->base_url_for_report( $report ) . $report->url;
+ }
$c->log->info($report->user->id . ' was logged in, redirecting to /report/' . $report->id);
$c->res->redirect($report_uri);
$c->detach;
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index c49123a90..da4cc33ca 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -76,6 +76,10 @@ sub update_problem : Private {
$problem->state('confirmed');
}
+ if ( $c->cobrand->can_support_problems && $c->user && $c->user->from_council && $c->req->param('external_source_id') ) {
+ $problem->interest_count( \'interest_count + 1' );
+ }
+
$problem->lastupdate( \'ms_current_timestamp()' );
$problem->update;
@@ -348,6 +352,7 @@ sub redirect_or_confirm_creation : Private {
if ( $update->confirmed ) {
$c->forward( 'update_problem' );
$c->forward( 'signup_for_alerts' );
+
my $report_uri = $c->cobrand->base_url_for_report( $update->problem ) . $update->problem->url;
$c->res->redirect($report_uri);
$c->detach;