aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-07-11 17:18:37 +0100
committerStruan Donald <struan@exo.org.uk>2012-07-11 17:18:37 +0100
commit5fd90e4a82dcc5b2e7dd582dca2c1cd9c655c28c (patch)
tree643514d956d659a0906bf851eb98597dc2b757a4
parent15fb383ca0877f9a5e648e20e85745625cc0ea07 (diff)
if report generated from message manager pass id to report page
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm9
-rw-r--r--templates/web/fixmybarangay/around/tabbed_lists.html2
2 files changed, 9 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 3d356cc40..c09b721b9 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1003,6 +1003,7 @@ sub save_user_and_report : Private {
# if there is a Message Manager message ID, pass it back to the client view
if ($c->req->param('mm_msg_id')) {
+ $c->stash->{mm_msg_id} = $c->req->param('mm_msg_id');
$report->service( $c->req->param('mm_msg_id') );
}
@@ -1068,7 +1069,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->uri_for( '/report', $report->id );
+ 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} } );
+ } else {
+ $report_uri = $c->uri_for( '/report', $report->id );
+ }
$c->log->info($report->user->id . ' was logged in, redirecting to /report/' . $report->id);
$c->res->redirect($report_uri);
$c->detach;
diff --git a/templates/web/fixmybarangay/around/tabbed_lists.html b/templates/web/fixmybarangay/around/tabbed_lists.html
index fa4bd6963..d73935a9c 100644
--- a/templates/web/fixmybarangay/around/tabbed_lists.html
+++ b/templates/web/fixmybarangay/around/tabbed_lists.html
@@ -56,7 +56,7 @@ $(document).ready(function() {
if (data['success']) {
// msg_text = $('#form_detail').val( $('input[name=mm_text]:checked').val() ); # == message data
msg_text = data['data']['Message']['message'];
- service_id = mm_url + "messages/view/" + data['data']['Message']['id'];
+ service_id = data['data']['Message']['id'];
} else {
$('input[name=mm_text]').prop('checked', false); // uncheck all
}