diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 92 |
1 files changed, 1 insertions, 91 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index fd9c1f1e7..8fd94dfba 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -77,40 +77,7 @@ sub load_problem_or_display_error : Private { my $problem # = $id =~ m{\D} # is id non-numeric? ? undef # ...don't even search - : $c->model('DB::Problem')->find( - { id => $id }, - { - select => [ - 'id', - 'latitude', - 'longitude', - 'council', - 'category', - 'title', 'detail', 'photo', - 'used_map', - 'name', - 'anonymous', - 'state', - 'service', - 'cobrand', - 'cobrand_data', - 'external_body', - { - extract => 'epoch from confirmed', - -as => 'time', - }, - { - extract => 'epoch from whensent-confirmed', - -as => 'whensent' - }, - { - extract => 'epoch from ms_current_timestamp()-lastupdate', - -as => 'duration' - } - - ] - } - ); + : $c->model('DB::Problem')->find( { id => $id } ); # check that the problem is suitable to show. if ( !$problem || $problem->state eq 'unconfirmed' ) { @@ -189,7 +156,6 @@ sub format_problem_for_display : Private { } $c->forward('generate_map_tags'); - $c->forward('generate_problem_meta'); return 1; } @@ -226,62 +192,6 @@ sub generate_map_tags : Private { return 1; } -sub generate_problem_meta : Private { - my ( $self, $c ) = @_; - - my $problem = $c->stash->{problem}; - my $date_time = - Page::prettify_epoch( $c->req, $problem->get_column('time') ); - my $meta = ''; - if ( $problem->anonymous ) { - if ( $problem->service - and $problem->category && $problem->category ne _('Other') ) - { - $meta = - sprintf( _('Reported by %s in the %s category anonymously at %s'), - $problem->service, $problem->category, $date_time ); - } - elsif ( $problem->service ) { - $meta = sprintf( _('Reported by %s anonymously at %s'), - $problem->service, $date_time ); - } - elsif ( $problem->category and $problem->category ne _('Other') ) { - $meta = sprintf( _('Reported in the %s category anonymously at %s'), - $problem->category, $date_time ); - } - else { - $meta = sprintf( _('Reported anonymously at %s'), $date_time ); - } - } - else { - if ( $problem->service - and $problem->category && $problem->category ne _('Other') ) - { - $meta = sprintf( - _('Reported by %s in the %s category by %s at %s'), - $problem->service, $problem->category, - $problem->name, $date_time - ); - } - elsif ( $problem->service ) { - $meta = sprintf( _('Reported by %s by %s at %s'), - $problem->service, $problem->name, $date_time ); - } - elsif ( $problem->category and $problem->category ne _('Other') ) { - $meta = sprintf( _('Reported in the %s category by %s at %s'), - $problem->category, $problem->name, $date_time ); - } - else { - $meta = - sprintf( _('Reported by %s at %s'), $problem->name, $date_time ); - } - } - - $c->stash->{meta} = $meta; - - return 1; -} - __PACKAGE__->meta->make_immutable; 1; |