aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2015-05-26 14:21:49 +0100
committerDave Arter <davea@mysociety.org>2015-10-06 09:09:27 +0100
commitb16a1d18087728a84abdd76bc8f69d2cba54c65e (patch)
tree7255b73b812337ceb9e06ae06632518b32680107 /perllib/FixMyStreet/Cobrand
parent2d1f6d10508cffb9c56e63e57763e48a94307f72 (diff)
[Zurich] Display message sent to user when report is closed
On the report admin page, include the message the user received when the report was closed. See mysociety/FixMyStreet-Commercial#718
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-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;