diff options
author | Struan Donald <struan@exo.org.uk> | 2012-08-22 10:57:10 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-08-22 10:57:10 +0100 |
commit | 2e0a4e8ec45579e4e5c9cf8aa123d5ab215b9703 (patch) | |
tree | c13e3c59b686e01460dc7960547f7e9c53c288bd /perllib/Open311.pm | |
parent | b99c5ff97b29a27eeba52ed24385ac30388e875c (diff) | |
parent | 88a7d38dffa3dabdf0f85573b254cea9c8ab232b (diff) |
Merge remote-tracking branch 'origin/master' into fmb-read-only
Conflicts:
.gitignore
bin/make_css
conf/general.yml-example
perllib/FixMyStreet/App/Controller/Council.pm
perllib/FixMyStreet/App/Controller/Report/New.pm
perllib/FixMyStreet/Cobrand/Default.pm
templates/web/default/around/around_index.html
templates/web/default/index.html
templates/web/emptyhomes/index.html
templates/web/fixmystreet/around/around_index.html
templates/web/fixmystreet/index.html
web/fixmystreet_app_cgi.cgi
web/fixmystreet_app_fastcgi.cgi
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r-- | perllib/Open311.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm index fd6a67706..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 @@ -93,7 +94,7 @@ sub _populate_service_request_params { ); } - my ( $firstname, $lastname ) = ( $problem->user->name =~ /(\w+)\s+(.+)/ ); + my ( $firstname, $lastname ) = ( $problem->user->name =~ /(\w+)\.?\s+(.+)/ ); my $params = { email => $problem->user->email, @@ -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; @@ -263,7 +268,7 @@ sub _populate_service_request_update_params { my $comment = shift; my $name = $comment->name || $comment->user->name; - my ( $firstname, $lastname ) = ( $name =~ /(\w+)\s+(.+)/ ); + my ( $firstname, $lastname ) = ( $name =~ /(\w+)\.?\s+(.+)/ ); my $params = { update_id_ext => $comment->id, @@ -280,7 +285,7 @@ sub _populate_service_request_update_params { if ( $comment->photo ) { my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($comment->cobrand)->new(); - my $email_base_url = $cobrand->base_url_for_emails($comment->cobrand_data); + my $email_base_url = $cobrand->base_url($comment->cobrand_data); my $url = $email_base_url . '/photo/c/' . $comment->id . '.full.jpeg'; $params->{media_url} = $url; } |