diff options
author | Dave Arter <davea@mysociety.org> | 2017-02-15 17:42:25 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2017-02-15 17:42:25 +0000 |
commit | 957f2d968c17a34a6fa95bea6cb6a4eace229aa6 (patch) | |
tree | 28ff117ae830534ccd37d3bdc70c8e5dba7f53e9 /perllib/FixMyStreet/DB/Result/Problem.pm | |
parent | 54af489f0fe985dfc433f0b8a3ab226a470a6023 (diff) | |
parent | 4d44ea5530a7dc25122e5135c19d89b4cebc5f40 (diff) |
Merge branch 'issues/forcouncils/127-exor-rdi-csv-output'
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 97cb28fe8..d78eda78f 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -613,9 +613,7 @@ sub meta_line { my $meta = ''; my $category = $problem->category; - if ($c->cobrand->can('change_category_text')) { - $category = $c->cobrand->change_category_text($category); - } + $category = $c->cobrand->call_hook(change_category_text => $category) || $category; if ( $problem->anonymous ) { if ( $problem->service and $category && $category ne _('Other') ) { @@ -748,17 +746,10 @@ sub can_display_external_id { sub duration_string { my ( $problem, $c ) = @_; - my $body; - if ( $c->cobrand->can('link_to_council_cobrand') ) { - $body = $c->cobrand->link_to_council_cobrand($problem); - } 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); - } + my $body = $c->cobrand->call_hook(link_to_council_cobrand => $problem) || $problem->body($c); + my $handler = $c->cobrand->call_hook(get_body_handler_for_problem => $problem); + if ( $handler && $handler->call_hook('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, @@ -1109,4 +1100,13 @@ has traffic_management_options => ( }, ); +has inspection_log_entry => ( + is => 'ro', + lazy => 1, + default => sub { + my $self = shift; + return $self->admin_log_entries->search({ action => 'inspected' }, { order_by => { -desc => 'whenedited' } })->first; + }, +); + 1; |