aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2018-03-12 11:34:01 +0000
committerDave Arter <davea@mysociety.org>2018-04-03 12:44:24 +0100
commitdf57444b8df2697ea1be2c7b50ce894316511d2c (patch)
tree5d62eafc7c86205f966b8b4480a09dfc0bbdf601
parent0ed1f4d106d945e7f5e9bdfdcf50451778d129cd (diff)
[Buckinghamshire] Enable MapIt lookups for parish councils
-rw-r--r--perllib/FixMyStreet/Cobrand/Buckinghamshire.pm202
1 files changed, 202 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
index b56346767..9bc095181 100644
--- a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
@@ -66,4 +66,206 @@ sub default_map_zoom { 3 }
sub enable_category_groups { 1 }
+
+# Enable adding/editing of parish councils in the admin
+sub add_extra_areas {
+ my ($self, $areas) = @_;
+
+ # This is a list of all Parish Councils within Buckinghamshire,
+ # taken from https://mapit.mysociety.org/area/2217/covers.json?type=CPC
+ my $parish_ids = [
+ "135493",
+ "135494",
+ "148713",
+ "148714",
+ "53319",
+ "53360",
+ "53390",
+ "53404",
+ "53453",
+ "53486",
+ "53515",
+ "53542",
+ "53612",
+ "53822",
+ "53874",
+ "53887",
+ "53942",
+ "53991",
+ "54003",
+ "54014",
+ "54158",
+ "54174",
+ "54178",
+ "54207",
+ "54289",
+ "54305",
+ "54342",
+ "54355",
+ "54402",
+ "54465",
+ "54479",
+ "54493",
+ "54590",
+ "54615",
+ "54672",
+ "54691",
+ "54721",
+ "54731",
+ "54787",
+ "54846",
+ "54879",
+ "54971",
+ "55290",
+ "55326",
+ "55534",
+ "55638",
+ "55724",
+ "55775",
+ "55896",
+ "55900",
+ "55915",
+ "55945",
+ "55973",
+ "56007",
+ "56091",
+ "56154",
+ "56268",
+ "56350",
+ "56379",
+ "56418",
+ "56432",
+ "56498",
+ "56524",
+ "56592",
+ "56609",
+ "56641",
+ "56659",
+ "56664",
+ "56709",
+ "56758",
+ "56781",
+ "57099",
+ "57138",
+ "57330",
+ "57332",
+ "57366",
+ "57367",
+ "57507",
+ "57529",
+ "57582",
+ "57585",
+ "57666",
+ "57701",
+ "58166",
+ "58208",
+ "58229",
+ "58279",
+ "58312",
+ "58333",
+ "58405",
+ "58523",
+ "58659",
+ "58815",
+ "58844",
+ "58891",
+ "58965",
+ "58980",
+ "59003",
+ "59007",
+ "59012",
+ "59067",
+ "59144",
+ "59152",
+ "59179",
+ "59211",
+ "59235",
+ "59288",
+ "59353",
+ "59491",
+ "59518",
+ "59727",
+ "59763",
+ "59971",
+ "60027",
+ "60137",
+ "60321",
+ "60322",
+ "60438",
+ "60456",
+ "60462",
+ "60532",
+ "60549",
+ "60598",
+ "60622",
+ "60640",
+ "60731",
+ "60777",
+ "60806",
+ "60860",
+ "60954",
+ "61100",
+ "61102",
+ "61107",
+ "61142",
+ "61144",
+ "61167",
+ "61172",
+ "61249",
+ "61268",
+ "61269",
+ "61405",
+ "61445",
+ "61471",
+ "61479",
+ "61898",
+ "61902",
+ "61920",
+ "61964",
+ "62226",
+ "62267",
+ "62296",
+ "62311",
+ "62321",
+ "62431",
+ "62454",
+ "62640",
+ "62657",
+ "62938",
+ "63040",
+ "63053",
+ "63068",
+ "63470",
+ "63476",
+ "63501",
+ "63507",
+ "63517",
+ "63554",
+ "63715",
+ "63723"
+ ];
+ my $ids_string = join ",", @{ $parish_ids };
+
+ my $extra_areas = mySociety::MaPit::call('areas', [ $ids_string ]);
+
+ my %all_areas = (
+ %$areas,
+ %$extra_areas
+ );
+ return \%all_areas;
+}
+
+# Make sure CPC areas are included in point lookups for new reports
+sub add_extra_area_types {
+ my ($self, $types) = @_;
+
+ my @types = (
+ @$types,
+ 'CPC',
+ );
+ return \@types;
+}
+
+sub is_two_tier { 1 }
+
1;