diff options
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Bexley.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bexley.pm | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bexley.pm b/perllib/FixMyStreet/Cobrand/Bexley.pm index 1a303d633..eda276add 100644 --- a/perllib/FixMyStreet/Cobrand/Bexley.pm +++ b/perllib/FixMyStreet/Cobrand/Bexley.pm @@ -58,16 +58,35 @@ sub lookup_site_code_config { } sub open311_config { - my ($self, $row, $h, $params) = @_; + my ($self, $row, $h, $params, $contact) = @_; + + $params->{multi_photos} = 1; my $extra = $row->get_extra_fields; - # Reports made via the app probably won't have a NSGRef because we don't - # display the road layer. Instead we'll look up the closest asset from the - # WFS service at the point we're sending the report over Open311. - if (!$row->get_extra_field_value('NSGRef')) { - if (my $ref = $self->lookup_site_code($row)) { - push @$extra, { name => 'NSGRef', description => 'NSG Ref', value => $ref }; + if ($contact->email =~ /^Confirm/) { + push @$extra, + { name => 'report_url', description => 'Report URL', + value => $h->{url} }, + { name => 'title', description => 'Title', + value => $row->title }, + { name => 'description', description => 'Detail', + value => $row->detail }; + + if (!$row->get_extra_field_value('site_code')) { + if (my $ref = $self->lookup_site_code($row)) { + push @$extra, { name => 'site_code', value => $ref, description => 'Site code' }; + } + } + } elsif ($contact->email =~ /^Uniform/) { + } else { # Symology + # Reports made via the app probably won't have a NSGRef because we don't + # display the road layer. Instead we'll look up the closest asset from the + # WFS service at the point we're sending the report over Open311. + if (!$row->get_extra_field_value('NSGRef')) { + if (my $ref = $self->lookup_site_code($row)) { + push @$extra, { name => 'NSGRef', description => 'NSG Ref', value => $ref }; + } } } @@ -77,7 +96,7 @@ sub open311_config { sub admin_user_domain { 'bexley.gov.uk' } sub open311_post_send { - my ($self, $row, $h) = @_; + my ($self, $row, $h, $contact) = @_; # Check Open311 was successful return unless $row->external_id; @@ -122,7 +141,7 @@ sub open311_post_send { return unless @to; my $sender = FixMyStreet::SendReport::Email->new( to => \@to ); - $self->open311_config($row); # Populate NSGRef again if needed + $self->open311_config($row, $h, {}, $contact); # Populate NSGRef again if needed my $extra_data = join "; ", map { "$_->{description}: $_->{value}" } @{$row->get_extra_fields}; $h->{additional_information} = $extra_data; |