diff options
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 5734ff8d5..e5929ca57 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -187,14 +187,14 @@ sub photos { return \@photos; } -=head2 meta_problem_state +=head2 problem_state_display Returns a string suitable for display lookup in the update meta section. Removes the '- council/user' bit from fixed states. =cut -sub meta_problem_state { +sub problem_state_display { my $self = shift; my $state = $self->problem_state; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 705c6d284..780a30e69 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -531,6 +531,19 @@ sub is_visible { return exists $self->visible_states->{ $self->state } ? 1 : 0; } +=head2 state_display + +Returns a string suitable for display lookup in the update meta section. +Removes the '- council/user' bit from fixed states. + +=cut + +sub state_display { + my $self = shift; + (my $state = $self->state) =~ s/ -.*$//; + return $state; +} + =head2 meta_line Returns a string to be used on a problem report page, describing some of the |