aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Kristensen <info@jonkri.com>2014-02-14 18:30:20 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2014-03-11 17:31:30 +0000
commitcf20c709e13af0909620ac5387b7d070b66b8c52 (patch)
tree380727210ad56a3ae3049a0b8030fa105791d0b4
parentb06e459b7616ea508d273443cb66f81a30d05a74 (diff)
Alter Open311 description to only include English on FixMyStreet.
This could be made cobrand-customisable in future.
-rw-r--r--perllib/Open311.pm25
-rw-r--r--t/open311.t2
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 {