aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index d3cc638c1..4fbc99838 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -65,9 +65,24 @@ sub admin {
if ($type eq 'dm') {
$c->stash->{template} = 'admin/index-dm.html';
+
+ my $body = $c->stash->{body};
+ my @children = map { $_->id } $body->bodies;
+ my @all = (@children, $body->id);
+
+ # XXX No multiples or missing bodies
$c->stash->{unconfirmed} = $c->cobrand->problems->search({
state => 'unconfirmed',
- bodies_str => $c->stash->{body}->id, # XXX No multiples or missing
+ bodies_str => $c->stash->{body}->id,
+ });
+ $c->stash->{approval} = $c->cobrand->problems->search({
+ 'me.state' => 'in progress',
+ bodies_str => \@children,
+ 'comments.state' => 'unconfirmed'
+ }, { join => 'comments', distinct => 1 } );
+ $c->stash->{other} = $c->cobrand->problems->search({
+ state => { '!=', 'unconfirmed' },
+ bodies_str => \@all,
});
} elsif ($type eq 'sdm') {
$c->stash->{template} = 'admin/index-sdm.html';