aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm77
1 files changed, 0 insertions, 77 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index b21596ef1..e19cdf403 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -456,83 +456,6 @@ sub determine_location_from_report : Private {
return;
}
-=head2 load_and_check_councils
-
-Try to load councils for this location and check that we have at least one. If
-there are no councils then return false.
-
-=cut
-
-sub load_and_check_councils : Private {
- my ( $self, $c ) = @_;
- my $latitude = $c->stash->{latitude};
- my $longitude = $c->stash->{longitude};
-
- # Look up councils and do checks for the point we've got
- my @area_types = $c->cobrand->area_types();
-
- # TODO: I think we want in_gb_locale around the next line, needs testing
- my $all_councils =
- mySociety::MaPit::call( 'point', "4326/$longitude,$latitude",
- type => \@area_types );
-
- # Let cobrand do a check
- my ( $success, $error_msg ) =
- $c->cobrand->council_check( { all_councils => $all_councils },
- 'submit_problem' );
- if ( !$success ) {
- $c->stash->{location_error} = $error_msg;
- return;
- }
-
- # edit hash in-place
- _remove_redundant_councils($all_councils);
-
- # If we don't have any councils we can't accept the report
- if ( !scalar keys %$all_councils ) {
- $c->stash->{location_error} =
- _( 'That spot does not appear to be covered by a council. If you'
- . ' have tried to report an issue past the shoreline, for'
- . ' example, please specify the closest point on land.' );
- return;
- }
-
- # all good if we have some councils left
- $c->stash->{all_councils} = $all_councils;
- $c->stash->{all_council_names} =
- [ map { $_->{name} } values %$all_councils ];
- return 1;
-}
-
-# TODO - should not be here.
-# These are country specific tweaks that should be in the cobrands
-sub _remove_redundant_councils {
- my $all_councils = shift;
-
- # UK specific tweaks
- if ( FixMyStreet->config('COUNTRY') eq 'GB' ) {
-
- # Ipswich & St Edmundsbury are responsible for everything in their
- # areas, not Suffolk
- delete $all_councils->{2241}
- if $all_councils->{2446} #
- || $all_councils->{2443};
-
- # Norwich is responsible for everything in its areas, not Norfolk
- delete $all_councils->{2233} #
- if $all_councils->{2391};
- }
-
- # Norway specific tweaks
- if ( FixMyStreet->config('COUNTRY') eq 'NO' ) {
-
- # Oslo is both a kommune and a fylke, we only want to show it once
- delete $all_councils->{301} #
- if $all_councils->{3};
- }
-
-}
-
=head2 setup_categories_and_councils
Look up categories for this council or councils