aboutsummaryrefslogtreecommitdiffstats
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
parent7626e6eccb985d8fb6ff936cdb5708acad5ce6e2 (diff)
added two more external_bodies to FixMyBarangay's hard-coded departments
-rw-r--r--perllib/FixMyStreet/SendReport/Open311.pm14
-rwxr-xr-xtemplates/web/fixmybarangay/reports/index.html21
2 files changed, 28 insertions, 7 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 );
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> &mdash; city road maintenance
+</li>
+<li>
+<a href="/reports/dps" title="Department of Public Services">DPS</a> &mdash; streetlight maintenance
+</li>
+<li>
+<a href="/reports/dpwh" title="Department of Public Works and Highways">DPWH</a> &mdash; national road maintenance
+</li>
+</ul>
+</p>
[% INCLUDE 'footer.html', pagefooter = 'yes' %]