aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-15 00:52:44 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-19 14:43:26 +0000
commit5f6226bf15630455bbe894c352b5d03faca09e81 (patch)
treef10d5a9901c4b85274864bba516195221fff9176
parent776bf6d759753f1670644927dd76592c62073743 (diff)
Be sure only dealing with the right global mapit area.
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm7
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm10
2 files changed, 16 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 641aad219..9e589b1f0 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -265,7 +265,12 @@ sub bodies : Path('bodies') : Args(0) {
sub body_form_dropdowns : Private {
my ( $self, $c ) = @_;
- my $areas = mySociety::MaPit::call('areas', $c->cobrand->area_types);
+ my $areas;
+ if ($c->cobrand->moniker eq 'zurich') {
+ $areas = mySociety::MaPit::call('areas', 274456);
+ } else {
+ $areas = mySociety::MaPit::call('areas', $c->cobrand->area_types);
+ }
$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/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index b4d2b8ecc..2cd2688fd 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -22,4 +22,14 @@ sub uri {
return $uri;
}
+sub remove_redundant_areas {
+ my $self = shift;
+ my $all_areas = shift;
+
+ # Remove all except Zurich
+ foreach (keys %$all_areas) {
+ delete $all_areas->{$_} unless $_ eq 274456;
+ }
+}
+
1;