aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311.pm
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-12-20 01:06:27 +0100
committerMarius Halden <marius.h@lden.org>2017-12-20 01:06:27 +0100
commit8b10c8b8d787e680bb085e2a7543dac50fd39742 (patch)
tree391efde6de4944e350cc0dafbd4e1efb0613e9c3 /perllib/Open311.pm
parenteef35397ccf8242cdc65dc666db2958b1ee35440 (diff)
parent7e15bd3db202363db4bab8fa7c9f462eabe28fce (diff)
Merge tag 'v2.3' into fiksgatami-dev
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r--perllib/Open311.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index da5a0a377..90b593256 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -127,13 +127,15 @@ sub _populate_service_request_params {
my ( $firstname, $lastname ) = ( $problem->name =~ /(\w+)\.?\s+(.+)/ );
my $params = {
- email => $problem->user->email,
description => $description,
service_code => $service_code,
first_name => $firstname,
last_name => $lastname || '',
};
+ $params->{phone} = $problem->user->phone if $problem->user->phone;
+ $params->{email} = $problem->user->email if $problem->user->email;
+
# if you click nearby reports > skip map then it's possible
# to end up with used_map = f and nothing in postcode
if ( $problem->used_map || $self->always_send_latlong
@@ -153,10 +155,6 @@ sub _populate_service_request_params {
$params->{address_string} = $problem->postcode;
}
- if ( $problem->user->phone ) {
- $params->{ phone } = $problem->user->phone;
- }
-
if ( $extra->{image_url} ) {
$params->{media_url} = $extra->{image_url};
}
@@ -327,12 +325,14 @@ sub _populate_service_request_update_params {
updated_datetime => DateTime::Format::W3CDTF->format_datetime($comment->confirmed->set_nanosecond(0)),
service_request_id => $comment->problem->external_id,
status => $status,
- email => $comment->user->email,
description => $comment->text,
last_name => $lastname,
first_name => $firstname,
};
+ $params->{phone} = $comment->user->phone if $comment->user->phone;
+ $params->{email} = $comment->user->email if $comment->user->email;
+
if ( $self->use_extended_updates ) {
$params->{public_anonymity_required} = $comment->anonymous ? 'TRUE' : 'FALSE',
$params->{update_id_ext} = $comment->id;