diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-21 16:11:42 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-21 16:11:42 +0100 |
commit | 630ed304d67f83ecd8848bf665b03fd7c27fff46 (patch) | |
tree | c7d86abbb998aef1dd17f6f728dfef06b10aed46 /perllib/FixMyStreet/App/Controller/Questionnaire.pm | |
parent | 2c5ddf10d9179d641bd70dc4602f33ee59fc8799 (diff) |
remove more hardcoded references to fixed
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Questionnaire.pm')
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Questionnaire.pm | 9 |
1 files changed, 5 insertions, 4 deletions
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 ) { |