aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm13
-rw-r--r--perllib/FixMyStreet/Map.pm6
2 files changed, 17 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index f25b149e6..9d86975c6 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -164,7 +164,20 @@ sub display_location : Private {
my $all_pins = $c->req->param('all_pins') ? 1 : undef;
$c->stash->{all_pins} = $all_pins;
my $interval = $all_pins ? undef : $c->cobrand->on_map_default_max_pin_age;
+
my $states = $c->cobrand->on_map_default_states;
+ $c->stash->{filter_status} = $c->cobrand->on_map_default_status;
+ my $status = $c->req->param('status');
+ if ( !defined $states || $status eq 'all' ) {
+ $states = FixMyStreet::DB::Result::Problem->visible_states();
+ $c->stash->{filter_status} = 'all';
+ } elsif ( $status eq 'open' ) {
+ $states = FixMyStreet::DB::Result::Problem->open_states();
+ $c->stash->{filter_status} = 'open';
+ } elsif ( $status eq 'fixed' ) {
+ $states = FixMyStreet::DB::Result::Problem->fixed_states();
+ $c->stash->{filter_status} = 'fixed';
+ }
# Check the category to filter by, if any, is valid
$c->forward('check_and_stash_category');
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index 2606fd9a4..7db4a7e3d 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -120,9 +120,11 @@ sub map_pins {
my $category = $c->req->param('category');
# Filter reports by status, if present in query params
+ my $states = $c->cobrand->on_map_default_states;
my $status = $c->req->param('status') || '';
- my $states;
- if ( $status eq 'open' ) {
+ if ( !defined $states || $status eq 'all' ) {
+ $states = FixMyStreet::DB::Result::Problem->visible_states();
+ } elsif ( $status eq 'open' ) {
$states = FixMyStreet::DB::Result::Problem->open_states();
} elsif ( $status eq 'fixed' ) {
$states = FixMyStreet::DB::Result::Problem->fixed_states();