aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/Cobrand/Northamptonshire.pm13
-rw-r--r--perllib/FixMyStreet/DB/Result/Comment.pm10
2 files changed, 19 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Northamptonshire.pm b/perllib/FixMyStreet/Cobrand/Northamptonshire.pm
index 791e2f83f..26c8706cc 100644
--- a/perllib/FixMyStreet/Cobrand/Northamptonshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Northamptonshire.pm
@@ -75,6 +75,19 @@ sub problems_on_map_restriction {
return $self->problems_restriction($rs);
}
+sub problem_state_processed {
+ my ($self, $comment) = @_;
+
+ my $state = $comment->problem_state || '';
+ my $code = $comment->get_extra_metadata('external_status_code') || '';
+
+ if ( $state eq 'investigating' and $code eq 'further' ) {
+ $state = 'Under further investigation';
+ }
+
+ return $state;
+}
+
sub privacy_policy_url {
'https://www3.northamptonshire.gov.uk/councilservices/council-and-democracy/transparency/information-policies/privacy-notice/place/Pages/street-doctor.aspx'
}
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm
index b217bf96c..68e267d00 100644
--- a/perllib/FixMyStreet/DB/Result/Comment.pm
+++ b/perllib/FixMyStreet/DB/Result/Comment.pm
@@ -265,16 +265,18 @@ sub meta_line {
};
sub problem_state_processed {
- my $self = shift;
+ my ( $self, $c ) = @_;
return 'fixed - user' if $self->mark_fixed;
return 'confirmed' if $self->mark_open;
- return $self->problem_state;
+ my $cobrand_state = $c->cobrand->call_hook(problem_state_processed => $self);
+
+ return $cobrand_state || $self->problem_state;
}
sub problem_state_display {
my ( $self, $c ) = @_;
- my $state = $self->problem_state_processed;
+ my $state = $self->problem_state_processed($c);
return '' unless $state;
my $cobrand_name = $c->cobrand->moniker;
@@ -323,7 +325,7 @@ sub as_hashref {
created => $self->created,
};
- $out->{problem_state} = $self->problem_state_processed;
+ $out->{problem_state} = $self->problem_state_processed($c);
$out->{photos} = [ map { $_->{url} } @{$self->photos} ] if !$cols || $cols->{photos};