aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Photo.pm2
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Questionnaire.pm9
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm3
-rw-r--r--perllib/FixMyStreet/Map/Tilma/Original.pm5
4 files changed, 11 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm
index 17862aa0a..b4fa3a457 100644
--- a/perllib/FixMyStreet/App/Controller/Photo.pm
+++ b/perllib/FixMyStreet/App/Controller/Photo.pm
@@ -48,7 +48,7 @@ sub index :Path :Args(0) {
$c->detach( 'no_photo' ) if $id =~ /\D/;
@photo = $c->cobrand->problems->search( {
id => $id,
- state => [ 'confirmed', 'fixed', 'partial' ],
+ state => [ FixMyStreet::DB::Result::Problem->visible_states(), 'partial' ],
photo => { '!=', undef },
} );
}
diff --git a/perllib/FixMyStreet/App/Controller/Questionnaire.pm b/perllib/FixMyStreet/App/Controller/Questionnaire.pm
index 19d057958..27c413259 100755
--- a/perllib/FixMyStreet/App/Controller/Questionnaire.pm
+++ b/perllib/FixMyStreet/App/Controller/Questionnaire.pm
@@ -48,7 +48,7 @@ sub load_questionnaire : Private {
$c->detach;
}
- unless ( $questionnaire->problem->state eq 'confirmed' || $questionnaire->problem->state eq 'fixed' ) {
+ unless ( $questionnaire->problem->is_visible ) {
$c->detach('missing_problem');
}
@@ -129,7 +129,7 @@ sub submit_creator_fixed : Private {
{
problem_id => $c->stash->{problem},
old_state => 'confirmed',
- new_state => 'fixed',
+ new_state => 'fixed - user',
}
);
@@ -156,8 +156,9 @@ sub submit_standard : Private {
my $problem = $c->stash->{problem};
my $old_state = $problem->state;
my $new_state = '';
- $new_state = 'fixed' if $c->stash->{been_fixed} eq 'Yes' && $old_state eq 'confirmed';
- $new_state = 'confirmed' if $c->stash->{been_fixed} eq 'No' && $old_state eq 'fixed';
+ $new_state = 'fixed - user' if $c->stash->{been_fixed} eq 'Yes' && $old_state eq 'confirmed';
+ $new_state = 'confirmed' if $c->stash->{been_fixed} eq 'No' &&
+ exists FixMyStreet::DB::Result::Problem->fixed_states()->{$old_state};
# Record state change, if there was one
if ( $new_state ) {
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 58b689bf9..2f895015b 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -354,7 +354,8 @@ sub add_row {
? 'unknown'
: ($problem->{age} > $fourweeks ? 'older' : 'new');
# Fixed problems are either old or new
- push @{$fixed->{$council}{$duration_str}}, $problem if $problem->{state} eq 'fixed';
+ push @{$fixed->{$council}{$duration_str}}, $problem if
+ exists FixMyStreet::DB::Result::Problem->fixed_states()->{$problem->{state}};
# Open problems are either unknown, older, or new
push @{$open->{$council}{$type}}, $problem if $problem->{state} eq 'confirmed';
}
diff --git a/perllib/FixMyStreet/Map/Tilma/Original.pm b/perllib/FixMyStreet/Map/Tilma/Original.pm
index 6fa854cb2..8fd835265 100644
--- a/perllib/FixMyStreet/Map/Tilma/Original.pm
+++ b/perllib/FixMyStreet/Map/Tilma/Original.pm
@@ -102,6 +102,7 @@ sub map_pins {
my $n = tile_to_os($y);
my ( $lat, $lon ) = Utils::convert_en_to_latlon( $e, $n );
+
my ( $around_map, $around_map_list, $nearby, $dist ) =
FixMyStreet::Map::map_features( $c, $lat, $lon, $interval );
@@ -111,7 +112,7 @@ sub map_pins {
_ll_to_en( $_->latitude, $_->longitude );
my $px = os_to_px($easting, $sx);
my $py = os_to_px($northing, $sy, 1);
- my $col = $_->state eq 'fixed' ? 'green' : 'red';
+ my $col = exists FixMyStreet::DB::Result::Problem->fixed_states()->{$_->state} ? 'green' : 'red';
$pins .= display_pin($c, $px, $py, $col, $_->id, $_->title);
}
@@ -121,7 +122,7 @@ sub map_pins {
_ll_to_en( $p->latitude, $p->longitude );
my $px = os_to_px($easting, $sx);
my $py = os_to_px($northing, $sy, 1);
- my $col = $p->state eq 'fixed' ? 'green' : 'red';
+ my $col = exists FixMyStreet::DB::Result::Problem->fixed_states()->{$p->state} ? 'green' : 'red';
$pins .= display_pin($c, $px, $py, $col, $p->id, $p->title);
}