diff options
author | Struan Donald <struan@exo.org.uk> | 2012-05-08 13:37:25 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-05-08 13:37:25 +0100 |
commit | 485f739aad7371a0739b42dfb165f9f24882c107 (patch) | |
tree | 82370fa348d683aec141b2f4014f5a90e24b6f19 /perllib/Open311.pm | |
parent | 2453b1dec215cd69926c649839e454c43e3e5469 (diff) |
do no sent lat long if click no map click for bromley
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r-- | perllib/Open311.pm | 10 |
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; } |