diff options
author | Struan Donald <struan@exo.org.uk> | 2012-03-27 16:49:37 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-03-27 16:49:37 +0100 |
commit | 116bc9780071acbda22c0e8a6a6e6d8706bcd24e (patch) | |
tree | 7346afca2471c51edbcbd4151c57986d7191f446 /perllib/Open311.pm | |
parent | c93cb823dafba47191f14fd7b31cf7b9d0cf37e0 (diff) |
sort out putting names in comments
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r-- | perllib/Open311.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm index e609fb086..a01a0528f 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -156,6 +156,9 @@ sub post_service_request_update { my $self = shift; my $comment = shift; + my $name = $comment->name || $comment->user->name; + my ( $firstname, $lastname ) = ( $name =~ /(\w+)\s+(.+)/ ); + my $params = { update_id_ext => $comment->id, updated_datetime => $comment->confirmed, @@ -165,11 +168,12 @@ sub post_service_request_update { email => $comment->user->email, description => $comment->text, public_anonymity_required => $comment->anonymous ? 'TRUE' : 'FALSE', - # also need last_name, title + last_name => $lastname, + first_name => $firstname, }; if ( $comment->extra ) { - $params->{'email_alerts_request'} + $params->{'email_alerts_requested'} = $comment->extra->{email_alerts_requested} ? 'TRUE' : 'FALSE'; $params->{'title'} = $comment->extra->{title}; } |