aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Open311.pm
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2013-01-08 12:30:55 +0000
committerDave Whiteland <dave@mysociety.org>2013-01-08 12:30:55 +0000
commitecdcaf5fb1eba7055906cf2e0d1f02e91bae9eed (patch)
tree606e42578dc4dc5f74bd4bba2b1f5eb33935b81a /perllib/FixMyStreet/SendReport/Open311.pm
parent7626e6eccb985d8fb6ff936cdb5708acad5ce6e2 (diff)
added two more external_bodies to FixMyBarangay's hard-coded departments
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Open311.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Open311.pm14
1 files changed, 11 insertions, 3 deletions
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 );