diff options
-rwxr-xr-x | bin/send-comments | 12 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Open311.pm | 14 | ||||
-rwxr-xr-x | templates/web/fixmybarangay/reports/index.html | 21 |
3 files changed, 40 insertions, 7 deletions
diff --git a/bin/send-comments b/bin/send-comments index 4955cb2f3..5a14098bf 100755 --- a/bin/send-comments +++ b/bin/send-comments @@ -78,6 +78,18 @@ while ( my $council = $councils->next ) { while ( my $comment = $comments->next ) { my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($comment->cobrand)->new(); + # actually this should be OK for any devolved endpoint if original Open311->can_be_devolved, presumably + if ( $cobrand->moniker eq "fixmybarangay") { + my $sender = $cobrand->get_council_sender( $council->area_id, undef, $comment->problem->category ); + my $config = $sender->{config}; + $o = Open311->new( + endpoint => $config->endpoint, + jurisdiction => $config->jurisdiction, + api_key => $config->api_key, + use_extended_updates => 1, # FMB uses extended updates + ); + } + if ( $comment->send_fail_count ) { next if bromley_retry_timeout( $comment ); } diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm index efd172640..93b96ce00 100644 --- a/perllib/FixMyStreet/SendReport/Open311.pm +++ b/perllib/FixMyStreet/SendReport/Open311.pm @@ -133,9 +133,17 @@ sub send { $row->external_id( $resp ); $row->send_method_used('Open311'); if ($row->cobrand eq 'fixmybarangay') { - # currently the only external body using Open311 is DPS - # (this will change when we have 'body' logic in place, meanwhile: hardcoded) - $row->external_body("DPS"); + # FixMyBarangay: currently the external bodies using Open311 are DPS, DEPW, DPWH + # for now identify the latter two by their name in the service_code ($contact->email) + # So: this works because we are anticipating the service codes for (e.g., potholes) look + # like this: + # POTDEPW or POTDPWH + # (TODO: this will change when we have 'body' logic in place, meanwhile: hardcoded) + if ($contact->email =~ /(DEPW|DPWH)$/i) { + $row->external_body(uc $1); # body is DEPW (city roads) or DPWH (national roads) + } else { + $row->external_body("DPS"); # only other open311 dept is DPS + } } $result *= 0; $self->success( 1 ); diff --git a/templates/web/fixmybarangay/reports/index.html b/templates/web/fixmybarangay/reports/index.html index e46d578ec..2d8da17c6 100755 --- a/templates/web/fixmybarangay/reports/index.html +++ b/templates/web/fixmybarangay/reports/index.html @@ -7,10 +7,6 @@ [% loc('This is a summary of all reports on this site; select a particular barangay to see the reports sent there.') %] </p> -<p> - [%# (this will change when we have 'body' logic in place, meanwhile: hardcoded) %] - See also the <a href="/reports/dps">map of DPS reports</a>. -</p> </div> <table cellpadding="3" cellspacing="1" border="0" class="nicetable"> @@ -43,4 +39,21 @@ </tbody> </table> + +<p> +[%# (this will change when we have 'body' logic in place, meanwhile: hardcoded) %] +See also the maps of reports submitted to these departments: +</p> +<ul> +<li> +<a href="/reports/depw" title="Department of Engineering and Public Works">DEPW</a> — city road maintenance +</li> +<li> +<a href="/reports/dps" title="Department of Public Services">DPS</a> — streetlight maintenance +</li> +<li> +<a href="/reports/dpwh" title="Department of Public Works and Highways">DPWH</a> — national road maintenance +</li> +</ul> +</p> [% INCLUDE 'footer.html', pagefooter = 'yes' %] |