diff options
author | Struan Donald <struan@exo.org.uk> | 2012-05-23 10:53:04 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-05-23 10:53:04 +0100 |
commit | 6f00ea0f96c25d81adf7e9e68a0228d193eb45d0 (patch) | |
tree | 7585e3d1af811fd7bb7b2b137bd522303fd95b29 /perllib/Open311.pm | |
parent | 37887356e600137090aa9819816d659be19ce11c (diff) |
send address_id with NOTPINPOINTED to Bromley if not used map and no postcode
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r-- | perllib/Open311.pm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm index 730b71958..0d3c0720d 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -21,6 +21,7 @@ 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 ); +has send_notpinpointed => ( is => 'ro', isa => 'Bool', default => 0 ); has basic_description => ( is => 'ro', isa => 'Bool', default => 0 ); before [ @@ -105,10 +106,18 @@ sub _populate_service_request_params { # if you click nearby reports > skip map then it's possible # to end up with used_map = f and nothing in postcode if ( $problem->used_map || $self->always_send_latlong - || ( !$problem->used_map && !$problem->postcode ) ) + || ( !$self->send_notpinpointed && !$problem->used_map + && !$problem->postcode ) ) { $params->{lat} = $problem->latitude; $params->{long} = $problem->longitude; + # this is a special case for sending to Bromley so they can + # report accuracy levels correctly. We include easting and + # northing as attributes elsewhere. + } elsif ( $self->send_notpinpointed && !$problem->used_map + && !$problem->postcode ) + { + $params->{address_id} = '#NOTPINPOINTED#'; } else { $params->{address_string} = $problem->postcode; } |