diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-18 17:49:08 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-18 17:49:08 +0000 |
commit | 495200d34afe198ebf13ab2f2529ad5ce00f9ebd (patch) | |
tree | f967c68f86557a7c2fca12a2bbccf89762d19f84 | |
parent | fb5c4645d9749cf1379cbb05f9cea1545f216085 (diff) |
No title included in Oxfordshire send.
-rw-r--r-- | perllib/FixMyStreet/SendReport/Open311.pm | 8 | ||||
-rw-r--r-- | perllib/Open311.pm | 17 | ||||
-rw-r--r-- | t/open311.t | 2 |
3 files changed, 17 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm index 27b65137e..0f9c2276a 100644 --- a/perllib/FixMyStreet/SendReport/Open311.pm +++ b/perllib/FixMyStreet/SendReport/Open311.pm @@ -37,7 +37,7 @@ sub send { my $send_notpinpointed = 0; my $use_service_as_deviceid = 0; - my $basic_desc = 0; + my $extended_desc = 1; # Extra bromley fields if ( $row->council =~ /2482/ ) { @@ -67,7 +67,7 @@ sub send { push @$extra, { name => 'last_name', value => $lastname }; } - $basic_desc = 1; + $extended_desc = 0; } # extra Oxfordshire fields: send northing and easting, and the FMS id @@ -79,6 +79,8 @@ sub send { push @$extra, { name => 'easting', value => $h->{easting} }; } $row->extra( $extra ); + + $extended_desc = 'oxfordshire'; } # FIXME: we've already looked this up before @@ -95,7 +97,7 @@ sub send { always_send_latlong => $always_send_latlong, send_notpinpointed => $send_notpinpointed, use_service_as_deviceid => $use_service_as_deviceid, - basic_description => $basic_desc, + extended_description => $extended_desc, ); # non standard west berks end points diff --git a/perllib/Open311.pm b/perllib/Open311.pm index 52e17e99d..9ed15bb10 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -22,7 +22,7 @@ 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 ); +has extended_description => ( is => 'ro', isa => 'Bool', default => 0 ); has use_service_as_deviceid => ( is => 'ro', isa => 'Bool', default => 0 ); has use_extended_updates => ( is => 'ro', isa => 'Bool', default => 0 ); @@ -95,12 +95,12 @@ sub _populate_service_request_params { my $service_code = shift; my $description; - if ( $self->basic_description ) { - $description = $problem->detail; - } else { + if ( $self->extended_description ) { $description = $self->_generate_service_request_description( $problem, $extra ); + } else { + $description = $problem->detail; } my ( $firstname, $lastname ) = ( $problem->user->name =~ /(\w+)\.?\s+(.+)/ ); @@ -168,8 +168,6 @@ sub _generate_service_request_description { my $extra = shift; my $description = <<EOT; -title: @{[$problem->title()]} - detail: @{[$problem->detail()]} url: $extra->{url} @@ -177,6 +175,13 @@ url: $extra->{url} Submitted via FixMyStreet EOT ; + if ($self->extended_description ne 'oxfordshire') { + $description = <<EOT; +title: @{[$problem->title()]} + +$description +EOT + } return $description; } diff --git a/t/open311.t b/t/open311.t index 2371c53bc..cbc8cf474 100644 --- a/t/open311.t +++ b/t/open311.t @@ -106,7 +106,7 @@ subtest 'posting service request with basic_description' => sub { $extra, $problem->category, '<?xml version="1.0" encoding="utf-8"?><service_requests><request><service_request_id>248</service_request_id></request></service_requests>', - { basic_description => 1 }, + { extended_description => 0 }, ); is $results->{ res }, 248, 'got request id'; |