aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm9
-rw-r--r--perllib/FixMyStreet/SendReport/Open311.pm1
-rw-r--r--perllib/Open311.pm12
-rwxr-xr-xperllib/Open311/PostServiceRequestUpdates.pm1
4 files changed, 14 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index f6a7be837..2ae498b38 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -223,7 +223,6 @@ sub open311_config {
sub open311_config_updates {
my ($self, $params) = @_;
- $params->{use_extended_updates} = 1;
$params->{endpoints} = {
service_request_updates => 'update.xml',
update => 'update.xml'
@@ -240,6 +239,14 @@ sub open311_pre_send {
}
}
+sub open311_munge_update_params {
+ my ($self, $params, $comment, $body) = @_;
+ delete $params->{update_id};
+ $params->{public_anonymity_required} = $comment->anonymous ? 'TRUE' : 'FALSE',
+ $params->{update_id_ext} = $comment->id;
+ $params->{service_request_id_ext} = $comment->problem->id;
+}
+
sub open311_contact_meta_override {
my ($self, $service, $contact, $meta) = @_;
diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm
index ed71d153b..a661ff206 100644
--- a/perllib/FixMyStreet/SendReport/Open311.pm
+++ b/perllib/FixMyStreet/SendReport/Open311.pm
@@ -29,6 +29,7 @@ sub send {
use_service_as_deviceid => 0,
extended_description => 1,
multi_photos => 0,
+ fixmystreet_body => $body,
);
my $cobrand = $body->get_cobrand_handler || $row->get_cobrand_logged;
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index c0e27f96b..749e7ccad 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -29,12 +29,12 @@ has always_send_latlong => ( is => 'ro', isa => Bool, default => 1 );
has send_notpinpointed => ( is => 'ro', isa => Bool, default => 0 );
has extended_description => ( is => 'ro', isa => Str, default => 1 );
has use_service_as_deviceid => ( is => 'ro', isa => Bool, default => 0 );
-has use_extended_updates => ( is => 'ro', isa => Bool, default => 0 );
has extended_statuses => ( is => 'ro', isa => Bool, default => 0 );
has always_send_email => ( is => 'ro', isa => Bool, default => 0 );
has multi_photos => ( is => 'ro', isa => Bool, default => 0 );
has use_customer_reference => ( is => 'ro', isa => Bool, default => 0 );
has mark_reopen => ( is => 'ro', isa => Bool, default => 0 );
+has fixmystreet_body => ( is => 'ro', isa => InstanceOf['FixMyStreet::DB::Result::Body'] );
before [
qw/get_service_list get_service_meta_info get_service_requests get_service_request_updates
@@ -387,14 +387,10 @@ sub _populate_service_request_update_params {
$params->{phone} = $comment->user->phone if $comment->user->phone;
$params->{email} = $comment->user->email if $comment->user->email;
+ $params->{update_id} = $comment->id;
- if ( $self->use_extended_updates ) {
- $params->{public_anonymity_required} = $comment->anonymous ? 'TRUE' : 'FALSE',
- $params->{update_id_ext} = $comment->id;
- $params->{service_request_id_ext} = $comment->problem->id;
- } else {
- $params->{update_id} = $comment->id;
- }
+ my $cobrand = $self->fixmystreet_body->get_cobrand_handler || $comment->get_cobrand_logged;
+ $cobrand->call_hook(open311_munge_update_params => $params, $comment, $self->fixmystreet_body);
if ( $comment->photo ) {
my $cobrand = $comment->get_cobrand_logged;
diff --git a/perllib/Open311/PostServiceRequestUpdates.pm b/perllib/Open311/PostServiceRequestUpdates.pm
index e2172c028..252f08aff 100755
--- a/perllib/Open311/PostServiceRequestUpdates.pm
+++ b/perllib/Open311/PostServiceRequestUpdates.pm
@@ -38,6 +38,7 @@ sub open311_params {
jurisdiction => $body->jurisdiction,
api_key => $body->api_key,
extended_statuses => $body->send_extended_statuses,
+ fixmystreet_body => $body,
);
my $cobrand = $body->get_cobrand_handler;