aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 58ce64af6..3078a4a2e 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -233,6 +233,24 @@ sub load_updates : Private {
next if $questionnaires_with_updates{$q->id};
push @combined, [ $q->whenanswered, $q ];
}
+
+ # And include moderation changes...
+ my $problem = $c->stash->{problem};
+ my $public_history = $c->cobrand->call_hook(public_moderation_history => $problem);
+ my $user_can_moderate = $c->user_exists && $c->user->can_moderate($problem);
+ if ($public_history || $user_can_moderate) {
+ my @history = $problem->moderation_history;
+ my $last_history = $problem;
+ foreach my $history (@history) {
+ push @combined, [ $history->created, {
+ type => 'moderation',
+ last => $last_history,
+ entry => $history,
+ } ];
+ $last_history = $history;
+ }
+ }
+
@combined = map { $_->[1] } sort { $a->[0] <=> $b->[0] } @combined;
$c->stash->{updates} = \@combined;