diff options
-rw-r--r-- | perllib/Open311.pm | 25 | ||||
-rw-r--r-- | t/open311.t | 2 |
2 files changed, 14 insertions, 13 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm index 94d81e479..6c811d445 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -172,19 +172,18 @@ sub _generate_service_request_description { my $problem = shift; my $extra = shift; - my $description = <<EOT; -detail: @{[$problem->detail()]} - -url: $extra->{url} - -Submitted via FixMyStreet -EOT -; - if ($self->extended_description ne 'oxfordshire') { - $description = <<EOT . $description; -title: @{[$problem->title()]} - -EOT + my $description = ""; + if ($problem->cobrand eq 'fixmystreet') { + $description .= "detail: " . $problem->detail . "\n\n"; + $description .= "url: " . $extra->{url} . "\n\n"; + $description .= "Submitted via FixMyStreet\n"; + if ($self->extended_description ne 'oxfordshire') { + $description = "title: " . $problem->title . "\n\n$description"; + } + } else { + $description .= $problem->title . "\n\n"; + $description .= $problem->detail . "\n\n"; + $description .= $extra->{url} . "\n"; } return $description; diff --git a/t/open311.t b/t/open311.t index 48a122296..2dd9119c9 100644 --- a/t/open311.t +++ b/t/open311.t @@ -39,6 +39,7 @@ my $p = FixMyStreet::App->model('DB::Problem')->new( { user => $u, id => 1, name => 'A User', + cobrand => 'fixmystreet', } ); my $expected_error = qr{Failed to submit problem 1 over Open311}ism; @@ -63,6 +64,7 @@ my $problem = FixMyStreet::App->model('DB::Problem')->new( { longitude => 2, user => $user, name => 'Test User', + cobrand => 'fixmystreet', } ); subtest 'posting service request' => sub { |