aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App')
-rw-r--r--perllib/FixMyStreet/App/Controller/Dashboard.pm7
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm1
2 files changed, 8 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm
index cff4c8dab..e1183c247 100644
--- a/perllib/FixMyStreet/App/Controller/Dashboard.pm
+++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm
@@ -287,6 +287,13 @@ sub generate_summary_figures {
}
}
+sub generate_body_response_time : Private {
+ my ( $self, $c ) = @_;
+
+ my $avg = $c->stash->{body}->calculate_average;
+ $c->stash->{body_average} = $avg ? int($avg / 60 / 60 / 24 + 0.5) : 0;
+}
+
sub export_as_csv {
my ($self, $c) = @_;
require Text::CSV;
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 5ac3da197..724fc7fbd 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -469,6 +469,7 @@ sub summary : Private {
$c->forward('/dashboard/construct_rs_filter');
$c->forward('/dashboard/generate_grouped_data');
+ $c->forward('/dashboard/generate_body_response_time');
$c->stash->{template} = 'reports/summary.html';
}