diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 15 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 8 |
2 files changed, 13 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 011e9e4b6..b0b338c69 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1002,11 +1002,12 @@ sub save_user_and_report : Private { $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->req->param('mm_msg_id')=~/^\d+$/) { - $c->stash->{mm_msg_id} = $c->req->param('mm_msg_id'); - $report->mm_msg_id( $c->req->param('mm_msg_id') ); - } - + 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(); @@ -1071,8 +1072,8 @@ sub redirect_or_confirm_creation : Private { $c->forward( 'create_reporter_alert' ); my $report_uri; - if ( $c->cobrand->moniker eq 'fixmybarangay' && $c->user->from_council && $c->stash->{mm_msg_id}) { - $report_uri = $c->uri_for( '/report', $report->id, undef, { mm_msg_id => $c->stash->{mm_msg_id} } ); + 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->uri_for( '/report', $report->id ); } diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index bd209368a..4f35e7c94 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -92,7 +92,9 @@ __PACKAGE__->add_columns( { data_type => "timestamp", is_nullable => 1 }, "send_method_used", { data_type => "text", is_nullable => 1 }, - "mm_msg_id", + "external_source", + { data_type => "text", is_nullable => 1 }, + "external_source_id", { data_type => "integer", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); @@ -116,8 +118,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-07-11 18:53:26 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F1NQHntuovV9YpE5FFr8QA +# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-07-12 11:05:48 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sOVQRjsQJUtpzElZvuCp8Q # Add fake relationship to stored procedure table __PACKAGE__->has_one( |