diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/View/Web.pm | 6 |
4 files changed, 10 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 8883bb91f..5e0bbaf93 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -191,6 +191,8 @@ sub setup_request { $c->log->debug( sprintf "Set lang to '%s' and cobrand to '%s'", $set_lang, $cobrand->moniker ); + $c->stash->{site_name} = Utils::trim_text($c->render_fragment('site-name.html')); + $c->model('DB::Problem')->set_restriction( $cobrand->site_key() ); Memcached::set_namespace( FixMyStreet->config('FMS_DB_NAME') . ":" ); diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index 315a5436c..279994e47 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -112,10 +112,9 @@ sub load_problem_or_display_error : Private { ); } elsif ( $problem->non_public ) { if ( !$c->user || $c->user->id != $problem->user->id ) { - my $site_name = Utils::trim_text($c->render_fragment('site-name.html')); $c->detach( '/page_error_403_access_denied', - [ sprintf(_('That report cannot be viewed on %s.'), $site_name) ] # + [ sprintf(_('That report cannot be viewed on %s.'), $c->stash->{site_name}) ] ); } } diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index de9f33105..d5b84815b 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1149,6 +1149,9 @@ sub redirect_or_confirm_creation : Private { return 1; } + my $template = 'problem-confirm.txt'; + $template = 'problem-confirm-not-sending.txt' unless $report->bodies_str; + # otherwise create a confirm token and email it to them. my $data = $c->stash->{token_data} || {}; my $token = $c->model("DB::Token")->create( { @@ -1159,7 +1162,7 @@ sub redirect_or_confirm_creation : Private { } } ); $c->stash->{token_url} = $c->uri_for_email( '/P', $token->token ); - $c->send_email( 'problem-confirm.txt', { + $c->send_email( $template, { to => [ $report->name ? [ $report->user->email, $report->name ] : $report->user->email ], } ); diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm index da549ece8..9cc571efc 100644 --- a/perllib/FixMyStreet/App/View/Web.pm +++ b/perllib/FixMyStreet/App/View/Web.pm @@ -40,15 +40,15 @@ TT View for FixMyStreet::App. =head2 loc - [% loc('Some text to localize') %] + [% loc('Some text to localize', 'Optional comment for translator') %] Passes the text to the localisation engine for translations. =cut sub loc { - my ( $self, $c, @args ) = @_; - return _(@args); + my ( $self, $c, $msgid ) = @_; + return _($msgid); } =head2 nget |