aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm6
-rw-r--r--perllib/FixMyStreet/App/Controller/Council.pm5
3 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bf5d04a76..9a1906974 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@
- Optionally supress blank Open311 update errors #1986
- Fetch/store external status code with Open311 updates. #2048
- Response templates can be triggered by external status code. #2048
+ - Cobrand hook for adding extra areas to MAPIT_WHITELIST/_TYPES. #2049
- Front end improvements:
- Improve questionnaire process. #1939 #1998
- Increase size of "sub map links" (hide pins, permalink, etc) #2003
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index cf5ab9b10..8849fdd8c 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -264,6 +264,12 @@ sub body_form_dropdowns : Private {
} else {
$areas = mySociety::MaPit::call('areas', $c->cobrand->area_types);
}
+
+ # Some cobrands may want to add extra areas at runtime beyond those
+ # available via MAPIT_WHITELIST or MAPIT_TYPES. This can be used for,
+ # e.g., parish councils on a particular council cobrand.
+ $areas = $c->cobrand->call_hook("add_extra_areas" => $areas) || $areas;
+
$c->stash->{areas} = [ sort { strcoll($a->{name}, $b->{name}) } values %$areas ];
my @methods = map { $_ =~ s/FixMyStreet::SendReport:://; $_ } keys %{ FixMyStreet::SendReport->get_senders };
diff --git a/perllib/FixMyStreet/App/Controller/Council.pm b/perllib/FixMyStreet/App/Controller/Council.pm
index 0e7553dc4..85976ae45 100644
--- a/perllib/FixMyStreet/App/Controller/Council.pm
+++ b/perllib/FixMyStreet/App/Controller/Council.pm
@@ -49,6 +49,11 @@ sub load_and_check_areas : Private {
$area_types = $c->cobrand->area_types;
}
+ # Cobrand may wish to add area types to look up for a point at runtime.
+ # This can be used for, e.g., parish councils on a particular council
+ # cobrand.
+ $area_types = $c->cobrand->call_hook("add_extra_area_types" => $area_types) || $area_types;
+
my $all_areas;
my %params;