aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Reports.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-08-19 00:08:15 +0100
committerStruan Donald <struan@exo.org.uk>2011-08-19 00:08:15 +0100
commita9a4fed583d7467c9c1f1fa56d42bcb75b4b488c (patch)
tree72941901b1bad732047bc6289139a387b049e6e8 /perllib/FixMyStreet/App/Controller/Reports.pm
parent302f5961f5da13e8124e8d2e91e52a29f141946f (diff)
parent61e6d5928be1bedb68607f8fa36f0d971711a3f8 (diff)
Merge branch 'new_statuses'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Reports.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index feafc4b77..f7fb5dec5 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -315,7 +315,7 @@ sub load_and_group_problems : Private {
my $page = $c->req->params->{p} || 1;
my $where = {
- state => [ 'confirmed', 'fixed' ]
+ state => [ FixMyStreet::DB::Result::Problem->visible_states() ]
};
if ($c->stash->{ward}) {
$where->{areas} = { 'like', '%,' . $c->stash->{ward}->{id} . ',%' };
@@ -411,14 +411,16 @@ sub add_row {
? 'unknown'
: ($problem->{age} > $fourweeks ? 'older' : 'new');
# Fixed problems are either old or new
- push @{$fixed->{$council}{$duration_str}}, $problem if $problem->{state} eq 'fixed';
+ push @{$fixed->{$council}{$duration_str}}, $problem if
+ exists FixMyStreet::DB::Result::Problem->fixed_states()->{$problem->{state}};
# Open problems are either unknown, older, or new
- push @{$open->{$council}{$type}}, $problem if $problem->{state} eq 'confirmed';
+ push @{$open->{$council}{$type}}, $problem if
+ exists FixMyStreet::DB::Result::Problem->open_states->{$problem->{state}};
push @$pins, {
latitude => $problem->{latitude},
longitude => $problem->{longitude},
- colour => $problem->{state} eq 'fixed' ? 'green' : 'red',
+ colour => FixMyStreet::DB::Result::Problem->fixed_states()->{$problem->{state}} ? 'green' : 'red',
id => $problem->{id},
title => $problem->{title},
};