diff options
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 14 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 4 |
2 files changed, 15 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index c73f7efca..2deeb3084 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -341,7 +341,7 @@ around service => sub { sub title_safe { my $self = shift; - return _('Awaiting moderation') if $self->cobrand eq 'zurich' && $self->state eq 'unconfirmed'; + return _('Awaiting moderation') if $self->cobrand eq 'zurich' && $self->state eq 'submitted'; return $self->title; } @@ -509,6 +509,18 @@ sub tokenised_url { return "/M/". $token->token; } +=head2 is_hidden + +Returns 1 if the problem is in an hidden state otherwise 0. + +=cut + +sub is_hidden { + my $self = shift; + + return exists $self->hidden_states->{ $self->state } ? 1 : 0; +} + =head2 is_open Returns 1 if the problem is in a open state otherwise 0. diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index 458efa179..ebc6e6c1b 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -118,8 +118,8 @@ sub _recent { my $key = $photos ? 'recent_photos' : 'recent'; $key .= ":$site_key:$num"; - # unconfirmed might be returned for e.g. Zurich, but would mean in moderation, so no photo - my @states = grep { $_ ne 'unconfirmed' } FixMyStreet::DB::Result::Problem->visible_states(); + # submitted might be returned for e.g. Zurich, but would mean in moderation, so no photo + my @states = grep { $_ ne 'submitted' } FixMyStreet::DB::Result::Problem->visible_states(); my $query = { non_public => 0, state => \@states, |