diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 9 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bristol.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Google.pm | 16 | ||||
-rw-r--r-- | perllib/FixMyStreet/Script/Reports.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 2 |
5 files changed, 21 insertions, 12 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 94f20a9ae..888110429 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1401,10 +1401,11 @@ sub redirect_or_confirm_creation : Private { if ( $report->confirmed ) { # Subscribe problem reporter to email updates $c->forward( 'create_reporter_alert' ); - if ($c->stash->{contributing_as_another_user} && $report->user->email) { - $c->send_email( 'other-reported.txt', { - to => [ [ $report->user->email, $report->name ] ], - } ); + if ($c->stash->{contributing_as_another_user} && $report->user->email + && !$c->cobrand->report_sent_confirmation_email) { + $c->send_email( 'other-reported.txt', { + to => [ [ $report->user->email, $report->name ] ], + } ); } # If the user has shortlist permission, and either we're not on a # council cobrand or the just-created problem is owned by the cobrand diff --git a/perllib/FixMyStreet/Cobrand/Bristol.pm b/perllib/FixMyStreet/Cobrand/Bristol.pm index b11a52643..4648802bd 100644 --- a/perllib/FixMyStreet/Cobrand/Bristol.pm +++ b/perllib/FixMyStreet/Cobrand/Bristol.pm @@ -20,7 +20,7 @@ sub example_places { } sub map_type { - 'Bristol'; + 'OSM'; } sub default_link_zoom { 6 } diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm index e64d02c4c..162101953 100644 --- a/perllib/FixMyStreet/Geocode/Google.pm +++ b/perllib/FixMyStreet/Geocode/Google.pm @@ -8,6 +8,7 @@ package FixMyStreet::Geocode::Google; use strict; use Utils; +use URI::Escape; # string STRING CONTEXT # Looks up on Google Maps API, and caches, a user-inputted location. @@ -19,11 +20,13 @@ sub string { my $params = $c->cobrand->disambiguate_location($s); + my $components = ""; + # For some reason adding gl=uk is no longer sufficient to make google - # think we are in the UK for some locations so we explictly add UK to - # the address. - if ($c->cobrand->country eq 'GB' && $s !~ /, *UK/ && $s !~ /united *kingdom$/) { - $s .= ', UK'; + # think we are in the UK for some locations so we explicitly tell Google + # the country. + if ($c->cobrand->country eq 'GB') { + $components = "country:GB"; } $s = FixMyStreet::Geocode::escape($s); @@ -37,8 +40,13 @@ sub string { } elsif ($params->{country}) { $url .= '®ion=' . $params->{country}; } + if ($params->{components}) { + $components .= ($components ? '|' : '') . URI::Escape::uri_escape_utf8($params->{components}); + } $url .= '&language=' . $params->{lang} if $params->{lang}; + $url .= '&components=' . $components if $components; + my $args = 'key=' . FixMyStreet->config('GOOGLE_MAPS_API_KEY'); my $js = FixMyStreet::Geocode::cache('google', $url, $args, qr/"status"\s*:\s*"(OVER_QUERY_LIMIT|REQUEST_DENIED|INVALID_REQUEST|UNKNOWN_ERROR)"/); if (!$js) { diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm index d6a614651..8e4a4aec1 100644 --- a/perllib/FixMyStreet/Script/Reports.pm +++ b/perllib/FixMyStreet/Script/Reports.pm @@ -306,9 +306,9 @@ sub _send_report_sent_email { $h, { To => $row->user->email, - From => [ FixMyStreet->config('CONTACT_EMAIL'), $cobrand->contact_name ], + From => [ $cobrand->contact_email, $cobrand->contact_name ], }, - FixMyStreet->config('CONTACT_EMAIL'), + $cobrand->contact_email, $nomail, $cobrand, $row->lang, diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 0aacc14a1..583aaaa08 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -86,7 +86,7 @@ sub send { $params->{From} = $self->send_from( $row ); } else { $sender = FixMyStreet->config('DO_NOT_REPLY_EMAIL'); - my $name = sprintf(_("On behalf of %s"), $params->{From}[1]); + my $name = sprintf(_("On behalf of %s"), @{ $self->send_from($row) }[1]); $params->{From} = [ $sender, $name ]; } |