aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/SendReport/Open311.pm15
-rw-r--r--perllib/Open311.pm5
2 files changed, 14 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm
index 6584bf8e2..42c103b82 100644
--- a/perllib/FixMyStreet/SendReport/Open311.pm
+++ b/perllib/FixMyStreet/SendReport/Open311.pm
@@ -32,6 +32,7 @@ sub send {
my $always_send_latlong = 1;
my $send_notpinpointed = 0;
+ my $use_service_as_deviceid = 0;
my $basic_desc = 0;
@@ -54,6 +55,7 @@ sub send {
$always_send_latlong = 0;
$send_notpinpointed = 1;
+ $use_service_as_deviceid = 0;
# make sure we have last_name attribute present in row's extra, so
# it is passed correctly to Bromley as attribute[]
@@ -73,12 +75,13 @@ sub send {
} );
my $open311 = Open311->new(
- jurisdiction => $conf->jurisdiction,
- endpoint => $conf->endpoint,
- api_key => $conf->api_key,
- always_send_latlong => $always_send_latlong,
- send_notpinpointed => $send_notpinpointed,
- basic_description => $basic_desc,
+ jurisdiction => $conf->jurisdiction,
+ endpoint => $conf->endpoint,
+ api_key => $conf->api_key,
+ always_send_latlong => $always_send_latlong,
+ send_notpinpointed => $send_notpinpointed,
+ use_service_as_deviceid => $use_service_as_deviceid,
+ basic_description => $basic_desc,
);
# non standard west berks end points
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index bd665ed3e..aa0e64b53 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -23,6 +23,7 @@ has error => ( is => 'rw', 'isa' => 'Str', default => '' );
has always_send_latlong => ( is => 'ro', isa => 'Bool', default => 1 );
has send_notpinpointed => ( is => 'ro', isa => 'Bool', default => 0 );
has basic_description => ( is => 'ro', isa => 'Bool', default => 0 );
+has use_service_as_deviceid => ( is => 'ro', isa => 'Bool', default => 0 );
before [
qw/get_service_list get_service_meta_info get_service_requests get_service_request_updates
@@ -130,6 +131,10 @@ sub _populate_service_request_params {
$params->{media_url} = $extra->{image_url};
}
+ if ( $self->use_service_as_deviceid && $problem->service ) {
+ $params->{deviceid} = $problem->service;
+ }
+
if ( $problem->extra ) {
my $extras = $problem->extra;