aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Problem.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-08-30 15:48:17 +0100
committerDave Arter <davea@mysociety.org>2016-09-08 13:44:52 +0100
commit7cc39bf875630ae5a2ad9b7245eac286cfaab59f (patch)
tree8308dbb077579261676497696115a67d7a377d4f /perllib/FixMyStreet/DB/Result/Problem.pm
parenta8a8d0eabe274f1492c3cb66479098056d901924 (diff)
[Oxfordshire] Display confirmed reports as received by the Council
This introduces a new `is_council_with_case_management` flag for Cobrands, that, when active, considers any report that's been confirmed as having been received by the Council in question. See mysociety/fixmystreetforcouncils#65
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 308fba71f..8236524d6 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -678,6 +678,13 @@ sub duration_string {
} else {
$body = $problem->body( $c );
}
+ if ( $c->cobrand->can('get_body_handler_for_problem') ) {
+ my $handler = $c->cobrand->get_body_handler_for_problem( $problem );
+ if ( $handler->can('is_council_with_case_management') && $handler->is_council_with_case_management ) {
+ return sprintf(_('Received by %s moments later'), $body);
+ }
+ }
+ return unless $problem->whensent;
return sprintf(_('Sent to %s %s later'), $body,
Utils::prettify_duration($problem->whensent->epoch - $problem->confirmed->epoch, 'minute')
);