aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Dashboard.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Dashboard.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Dashboard.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm
index 5fe473c54..cff4c8dab 100644
--- a/perllib/FixMyStreet/App/Controller/Dashboard.pm
+++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm
@@ -175,15 +175,15 @@ sub generate_data {
$state_map->{$_} = 'closed' foreach FixMyStreet::DB::Result::Problem->closed_states;
$state_map->{$_} = 'fixed' foreach FixMyStreet::DB::Result::Problem->fixed_states;
- $self->generate_grouped_data($c);
+ $c->forward('generate_grouped_data');
$self->generate_summary_figures($c);
}
-sub generate_grouped_data {
+sub generate_grouped_data : Private {
my ($self, $c) = @_;
my $state_map = $c->stash->{state_map};
- my $group_by = $c->get_param('group_by') || '';
+ my $group_by = $c->get_param('group_by') || $c->stash->{group_by_default} || '';
my (%grouped, @groups, %totals);
if ($group_by eq 'category') {
%grouped = map { $_->category => {} } @{$c->stash->{contacts}};
@@ -197,6 +197,8 @@ sub generate_grouped_data {
);
} elsif ($group_by eq 'device+site') {
@groups = qw/cobrand service/;
+ } elsif ($group_by eq 'device') {
+ @groups = qw/service/;
} else {
$group_by = 'category+state';
@groups = qw/category state/;