aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm16
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm9
-rw-r--r--perllib/FixMyStreet/Cobrand/FixMyBarangay.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/Open311.pm13
4 files changed, 1 insertions, 39 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index a4dcaeeb8..bbb60f4e7 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -131,7 +131,6 @@ sub ward : Path : Args(2) {
$c->cobrand->tweak_all_reports_map( $c );
# List of wards
- # Ignore external_body special body thing
if ( !$c->stash->{ward} && $c->stash->{body}->id && $c->stash->{body}->body_areas->first ) {
my $children = mySociety::MaPit::call('area/children', [ $c->stash->{body}->body_areas->first->area_id ],
type => $c->cobrand->area_types_children,
@@ -285,15 +284,6 @@ sub body_check : Private {
$c->detach( 'redirect_body' );
}
- if ( $c->cobrand->reports_by_body ) {
- my $problem = $c->cobrand->problems->search({ 'lower(me.external_body)' => lc $q_body }, { columns => [ 'external_body' ], rows => 1 })->single;
- if ( $problem ) {
- # If external_body, put as a body with ID 0 for the moment.
- $c->stash->{body} = $c->model('DB::Body')->new( { id => 0, name => $problem->external_body } );
- return;
- }
- }
-
# We must now have a string to check
my @bodies = $c->model('DB::Body')->search( { name => { -like => "$q_body%" } } )->all;
@@ -384,9 +374,6 @@ sub load_and_group_problems : Private {
{ 'like', $c->stash->{body}->id . ',%' },
{ 'like', '%,' . $c->stash->{body}->id },
];
- } elsif ($c->stash->{body} && $c->stash->{body}->id == 0) {
- # A proxy for an external_body
- $where->{'lower(external_body)'} = lc $c->stash->{body}->name;
} elsif ($c->stash->{body}) {
# XXX FixMyStreet used to have the following line so that reports not
# currently sent anywhere could still be listed in the appropriate
@@ -412,8 +399,7 @@ sub load_and_group_problems : Private {
my ( %problems, @pins );
while ( my $problem = $problems->next ) {
$c->log->debug( $problem->cobrand . ', cobrand is ' . $c->cobrand->moniker );
- if ( !$c->stash->{body} || !$c->stash->{body}->id ) {
- # An external_body entry
+ if ( !$c->stash->{body} ) {
add_row( $c, $problem, 0, \%problems, \@pins );
next;
}
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index e5a02c44c..0c8d567c4 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -729,15 +729,6 @@ sub default_map_zoom { undef };
sub users_can_hide { return 0; }
-=head2 reports_by_body
-
-Can /reports show reports indexed by external_body? This is a temporary measure
-until the contacts/area/body handling is rewritten to be better.
-
-=cut
-
-sub reports_by_body { 0; }
-
=head2 default_show_name
Returns true if the show name checkbox should be ticked by default.
diff --git a/perllib/FixMyStreet/Cobrand/FixMyBarangay.pm b/perllib/FixMyStreet/Cobrand/FixMyBarangay.pm
index f785f12a9..44c56887b 100644
--- a/perllib/FixMyStreet/Cobrand/FixMyBarangay.pm
+++ b/perllib/FixMyStreet/Cobrand/FixMyBarangay.pm
@@ -41,8 +41,6 @@ sub can_support_problems {
return 1;
}
-sub reports_by_body { 1 }
-
sub default_show_name {
my $self = shift;
diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm
index 2ed5bc78b..5f25dfc70 100644
--- a/perllib/FixMyStreet/SendReport/Open311.pm
+++ b/perllib/FixMyStreet/SendReport/Open311.pm
@@ -138,19 +138,6 @@ sub send {
if ( $resp ) {
$row->external_id( $resp );
$row->send_method_used('Open311');
- if ($row->cobrand eq 'fixmybarangay') {
- # 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 );
} else {