aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Bodies.pm8
-rw-r--r--perllib/FixMyStreet/App/Controller/Open311.pm5
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm16
-rw-r--r--perllib/FixMyStreet/DB/Result/Body.pm8
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm8
5 files changed, 25 insertions, 20 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
index 56bc554e9..1f8840bcb 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
@@ -187,10 +187,14 @@ sub body_form_dropdowns : Private {
my $areas;
my $whitelist = $c->config->{MAPIT_ID_WHITELIST};
+ my %params;
+ $params{generation} = $c->config->{MAPIT_GENERATION}
+ if $c->config->{MAPIT_GENERATION};
+
if ( $whitelist && ref $whitelist eq 'ARRAY' && @$whitelist ) {
- $areas = mySociety::MaPit::call('areas', $whitelist);
+ $areas = mySociety::MaPit::call('areas', $whitelist, %params);
} else {
- $areas = mySociety::MaPit::call('areas', $c->cobrand->area_types);
+ $areas = mySociety::MaPit::call('areas', $c->cobrand->area_types, %params);
}
# Some cobrands may want to add extra areas at runtime beyond those
diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm
index 83b9b8202..5d7ec63d6 100644
--- a/perllib/FixMyStreet/App/Controller/Open311.pm
+++ b/perllib/FixMyStreet/App/Controller/Open311.pm
@@ -164,9 +164,12 @@ sub get_services : Private {
if ($lat || $lon) {
my $area_types = $c->cobrand->area_types;
+ my %params = ( type => $area_types );
+ $params{generation} = $c->config->{MAPIT_GENERATION}
+ if $c->config->{MAPIT_GENERATION};
my $all_areas = mySociety::MaPit::call('point',
"4326/$lon,$lat",
- type => $area_types);
+ %params);
$categories = $categories->search( {
'body_areas.area_id' => [ keys %$all_areas ],
}, { join => { 'body' => 'body_areas' } } );
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index b77e89d0e..751870bd4 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -219,10 +219,12 @@ sub rss_area_ward : Path('/rss/area') : Args(2) {
# We're checking an area here, but this function is currently doing that.
return if $c->cobrand->reports_body_check( $c, $area );
+ my %params = ( type => $c->cobrand->area_types );
+ $params{generation} = $c->config->{MAPIT_GENERATION}
+ if $c->config->{MAPIT_GENERATION};
+
# We must now have a string to check on mapit
- my $areas = mySociety::MaPit::call( 'areas', $area,
- type => $c->cobrand->area_types,
- );
+ my $areas = mySociety::MaPit::call( 'areas', $area, %params );
if (keys %$areas == 1) {
($c->stash->{area}) = values %$areas;
@@ -391,9 +393,11 @@ sub ward_check : Private {
$parent_id = $c->stash->{area}->{id};
}
- my $qw = mySociety::MaPit::call('area/children', [ $parent_id ],
- type => $c->cobrand->area_types_children,
- );
+ my %params = ( type => $c->cobrand->area_types_children );
+ $params{generation} = $c->config->{MAPIT_GENERATION}
+ if $c->config->{MAPIT_GENERATION};
+
+ my $qw = mySociety::MaPit::call('area/children', [ $parent_id ], %params);
my %names = map { $c->cobrand->short_name({ name => $_ }) => 1 } @wards;
my @areas;
foreach my $area (sort { $a->{name} cmp $b->{name} } values %$qw) {
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm
index 3c013378c..c04c117ae 100644
--- a/perllib/FixMyStreet/DB/Result/Body.pm
+++ b/perllib/FixMyStreet/DB/Result/Body.pm
@@ -181,9 +181,11 @@ sub first_area_children {
return unless $body_area;
my $cobrand = $self->result_source->schema->cobrand;
- my $children = mySociety::MaPit::call('area/children', $body_area->area_id,
- type => $cobrand->area_types_children,
- );
+
+ my %params = ( type => $cobrand->area_types_children );
+ $params{generation} = FixMyStreet->config('MAPIT_GENERATION')
+ if FixMyStreet->config('MAPIT_GENERATION');
+ my $children = mySociety::MaPit::call('area/children', $body_area->area_id, %params);
return $children;
}
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index 1b484aefe..ae1243fdb 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -111,12 +111,4 @@ sub send {
return $result;
}
-sub _get_district_for_contact {
- my ( $lat, $lon ) = @_;
- my $district =
- mySociety::MaPit::call( 'point', "4326/$lon,$lat", type => 'DIS' );
- ($district) = keys %$district;
- return $district;
-}
-
1;