aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm5
-rw-r--r--perllib/FixMyStreet/Cobrand/Oxfordshire.pm17
-rwxr-xr-xperllib/Open311/PostServiceRequestUpdates.pm2
3 files changed, 23 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index e63d722fd..90e5895d5 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -232,6 +232,11 @@ sub open311_pre_send {
}
}
+sub open311_pre_send_updates {
+ my ($self, $row) = @_;
+ return $self->open311_pre_send($row);
+}
+
sub open311_munge_update_params {
my ($self, $params, $comment, $body) = @_;
delete $params->{update_id};
diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
index 31db0fd4e..cf88495f8 100644
--- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
@@ -138,6 +138,23 @@ sub open311_config_updates {
$params->{use_customer_reference} = 1;
}
+sub open311_pre_send {
+ my ($self, $row, $open311) = @_;
+
+ $self->{ox_original_detail} = $row->detail;
+
+ if (my $fid = $row->get_extra_field_value('feature_id')) {
+ my $text = $row->detail . "\n\nAsset Id: $fid\n";
+ $row->detail($text);
+ }
+}
+
+sub open311_post_send {
+ my ($self, $row, $h, $contact) = @_;
+
+ $row->detail($self->{ox_original_detail});
+}
+
sub should_skip_sending_update {
my ($self, $update ) = @_;
diff --git a/perllib/Open311/PostServiceRequestUpdates.pm b/perllib/Open311/PostServiceRequestUpdates.pm
index a31bca8f7..b9aa9ed50 100755
--- a/perllib/Open311/PostServiceRequestUpdates.pm
+++ b/perllib/Open311/PostServiceRequestUpdates.pm
@@ -126,7 +126,7 @@ sub process_update {
my $o = $self->construct_open311($body, $comment);
- $cobrand->call_hook(open311_pre_send => $comment, $o);
+ $cobrand->call_hook(open311_pre_send_updates => $comment);
my $id = $o->post_service_request_update( $comment );