diff options
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Open311.pm')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Open311.pm | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm index b4380df02..56473cf5f 100644 --- a/perllib/FixMyStreet/SendReport/Open311.pm +++ b/perllib/FixMyStreet/SendReport/Open311.pm @@ -23,7 +23,7 @@ sub should_skip { sub send { my $self = shift; - my ( $row, $h, $to, $template, $recips, $nomail ) = @_; + my ( $row, $h ) = @_; my $result = -1; @@ -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,15 @@ 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[] + if ( $row->cobrand ne 'bromley' ) { + my ( $firstname, $lastname ) = ( $row->user->name =~ /(\w+)\.?\s+(.+)/ ); + push @$extra, { name => 'last_name', value => $lastname }; + } + $basic_desc = 1; } @@ -65,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 |