aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm21
1 files changed, 16 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index c0fd802da..fae39b28b 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -127,12 +127,17 @@ sub zurich_public_response_states {
my $states = {
'fixed - council' => 1,
'closed' => 1, # extern
- 'unable to fix' => 1, # jurisdiction unknown
+ 'unable to fix' => 1, # jurisdiction unknown
+ };
+
+ return wantarray ? keys %{ $states } : $states;
+}
- # e.g. as above, but WITHOUT the following (as they are hidden)
- # 'hidden' => 1,
- # 'investigating' => 1, # wish
- # 'partial' => 1, # not contactable
+sub zurich_user_response_states {
+ my $states = {
+ 'hidden' => 1,
+ 'investigating' => 1, # wish
+ 'partial' => 1, # not contactable
};
return wantarray ? keys %{ $states } : $states;
@@ -143,6 +148,12 @@ sub problem_has_public_response {
return exists $self->zurich_public_response_states->{ $problem->state } ? 1 : 0;
}
+sub problem_has_user_response {
+ my ($self, $problem) = @_;
+ my $state_matches = exists $self->zurich_user_response_states->{ $problem->state } ? 1 : 0;
+ return $state_matches && $problem->get_extra_metadata('public_response');
+}
+
sub problem_as_hashref {
my $self = shift;
my $problem = shift;