diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Oxfordshire.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 7 | ||||
-rw-r--r-- | templates/web/base/report/_council_sent_info.html | 4 | ||||
-rw-r--r-- | templates/web/oxfordshire/report/_main_sent_info.html | 5 |
4 files changed, 17 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm index 30240f61e..f8079565d 100644 --- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm +++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm @@ -10,6 +10,11 @@ sub council_name { return 'Oxfordshire County Council'; } sub council_url { return 'oxfordshire'; } sub is_two_tier { return 1; } +sub is_council_with_case_management { + # XXX Change this to return 1 when OCC FMSfC goes live. + return FixMyStreet->config('STAGING_SITE'); +} + sub map_type { 'OSM' } sub base_url { 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') ); diff --git a/templates/web/base/report/_council_sent_info.html b/templates/web/base/report/_council_sent_info.html index affc73414..dca74f994 100644 --- a/templates/web/base/report/_council_sent_info.html +++ b/templates/web/base/report/_council_sent_info.html @@ -1,6 +1,6 @@ -[% IF problem.whensent || problem.can_display_external_id %] +[% SET duration_clause = problem.duration_string(c) %] +[% IF duration_clause || problem.can_display_external_id %] <p class="council_sent_info"> - [% SET duration_clause = problem.duration_string(c) IF problem.whensent %] [%- IF problem.can_display_external_id %] [%- IF duration_clause %] [%- external_ref_clause = tprintf(loc('Council ref: %s'), problem.external_id) %] diff --git a/templates/web/oxfordshire/report/_main_sent_info.html b/templates/web/oxfordshire/report/_main_sent_info.html index c955a5fae..9865153d3 100644 --- a/templates/web/oxfordshire/report/_main_sent_info.html +++ b/templates/web/oxfordshire/report/_main_sent_info.html @@ -1,3 +1,4 @@ -[% IF problem.whensent %] - <p class="council_sent_info">[% problem.duration_string(c) %]</p> +[% SET duration_clause = problem.duration_string(c) %] +[% IF duration_clause %] + <p class="council_sent_info">[% duration_clause %]</p> [% END %] |