diff options
author | Struan Donald <struan@exo.org.uk> | 2018-02-14 17:40:56 +1300 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-03-15 13:18:11 +0000 |
commit | 4e31d58ac2ac23228d2d6c561901547d20f57ffb (patch) | |
tree | df228c7cbe9e86ee37dbb2f2657b92df198bb362 /perllib/Open311.pm | |
parent | f1c8da3ed21adc1c64e8276edc116af200b8883f (diff) |
send multiple photos over open311
Per cobrand configurable option to send multiple photos over open311
instead of just a single one. Does this by sending multiple media_url
parameters in the POST body.
The default remains to send the first photo associated with a report.
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r-- | perllib/Open311.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm index 22293ee9f..577de31ea 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -32,6 +32,7 @@ has use_service_as_deviceid => ( is => 'ro', isa => Bool, default => 0 ); has use_extended_updates => ( is => 'ro', isa => Bool, default => 0 ); has extended_statuses => ( is => 'ro', isa => Bool, default => 0 ); has always_send_email => ( is => 'ro', isa => Bool, default => 0 ); +has multi_photos => ( is => 'ro', isa => Bool, default => 0 ); before [ qw/get_service_list get_service_meta_info get_service_requests get_service_request_updates @@ -163,7 +164,11 @@ sub _populate_service_request_params { } if ( $extra->{image_url} ) { - $params->{media_url} = $extra->{image_url}; + if ( $self->multi_photos ) { + $params->{media_url} = $extra->{all_image_urls}; + } else { + $params->{media_url} = $extra->{image_url}; + } } if ( $self->use_service_as_deviceid && $problem->service ) { |