aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-05-08 13:37:25 +0100
committerStruan Donald <struan@exo.org.uk>2012-05-08 13:37:25 +0100
commit485f739aad7371a0739b42dfb165f9f24882c107 (patch)
tree82370fa348d683aec141b2f4014f5a90e24b6f19 /perllib/Open311.pm
parent2453b1dec215cd69926c649839e454c43e3e5469 (diff)
do no sent lat long if click no map click for bromley
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r--perllib/Open311.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index d97b61f90..47baed082 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -20,6 +20,7 @@ has debug => ( is => 'ro', isa => 'Bool', default => 0 );
has debug_details => ( is => 'rw', 'isa' => 'Str', default => '' );
has success => ( is => 'rw', 'isa' => 'Bool', default => 0 );
has error => ( is => 'rw', 'isa' => 'Str', default => '' );
+has always_send_latlong => ( is => 'ro', isa => 'Bool', default => 1 );
before [
qw/get_service_list get_service_meta_info get_service_requests get_service_request_updates
@@ -88,8 +89,6 @@ sub _populate_service_request_params {
my ( $firstname, $lastname ) = ( $problem->user->name =~ /(\w+)\s+(.+)/ );
my $params = {
- lat => $problem->latitude,
- long => $problem->longitude,
email => $problem->user->email,
description => $description,
service_code => $service_code,
@@ -97,6 +96,13 @@ sub _populate_service_request_params {
last_name => $lastname || '',
};
+ if ( $problem->used_map || $self->always_send_latlong ) {
+ $params->{lat} = $problem->latitude;
+ $params->{long} = $problem->longitude;
+ } else {
+ $params->{address} = $problem->postcode;
+ }
+
if ( $problem->user->phone ) {
$params->{ phone } = $problem->user->phone;
}