diff options
author | Struan Donald <struan@exo.org.uk> | 2012-10-01 17:42:43 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-10-01 17:42:43 +0100 |
commit | ba53a2c2d8189ecaeca2c0e774c6dda54579dec9 (patch) | |
tree | 5f97f0be809f11e4f3bc2998ee557a9813ca802a | |
parent | 515190b62e24ab43e150c4d65b55c774682f2578 (diff) |
change update form to use new statuses
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 3 | ||||
-rw-r--r-- | t/app/controller/report_updates.t | 60 | ||||
-rw-r--r-- | templates/web/bromley/report/display.html | 4 | ||||
-rw-r--r-- | templates/web/default/report/display.html | 4 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/display.html | 4 |
5 files changed, 59 insertions, 16 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index c49123a90..c3abdaf3c 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -245,7 +245,8 @@ sub check_for_errors : Private { $error = 1 unless $c->user && $c->user->belongs_to_council( $c->stash->{update}->problem->council ); my $state = $c->req->param('state'); - $error = 1 unless ( grep { $state eq $_ } ( qw/confirmed closed fixed investigating planned/, 'in progress', 'fixed', 'fixed - user', 'fixed - council' ) ); + $state = 'fixed - council' if $state eq 'fixed'; + $error = 1 unless ( grep { $state eq $_ } ( FixMyStreet::DB::Result::Problem->council_states() ) ); if ( $error ) { $c->stash->{errors} ||= []; diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index cf6af16cb..4a2aea7ef 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -501,18 +501,6 @@ for my $test ( state => 'in progress', }, { - desc => 'from authority user marks report as closed', - fields => { - name => $user->name, - may_show_name => 1, - add_alert => undef, - photo => '', - update => 'Set state to closed', - state => 'closed', - }, - state => 'closed', - }, - { desc => 'from authority user marks report as fixed', fields => { name => $user->name, @@ -537,6 +525,54 @@ for my $test ( state => 'confirmed', }, { + desc => 'from authority user marks report as action scheduled', + fields => { + name => $user->name, + may_show_name => 1, + add_alert => undef, + photo => '', + update => 'Set state to action scheduled', + state => 'action scheduled', + }, + state => 'action scheduled', + }, + { + desc => 'from authority user marks report as unable to fix', + fields => { + name => $user->name, + may_show_name => 1, + add_alert => undef, + photo => '', + update => 'Set state to unable to fix', + state => 'unable to fix', + }, + state => 'unable to fix', + }, + { + desc => 'from authority user marks report as not responsible', + fields => { + name => $user->name, + may_show_name => 1, + add_alert => undef, + photo => '', + update => 'Set state to not responsible', + state => 'not responsible', + }, + state => 'not responsible', + }, + { + desc => 'from authority user marks report as duplicate', + fields => { + name => $user->name, + may_show_name => 1, + add_alert => undef, + photo => '', + update => 'Set state to duplicate', + state => 'duplicate', + }, + state => 'duplicate', + }, + { desc => 'from authority user marks report sent to two councils as fixed', fields => { name => $user->name, diff --git a/templates/web/bromley/report/display.html b/templates/web/bromley/report/display.html index 13bc5f960..806ec5ae7 100644 --- a/templates/web/bromley/report/display.html +++ b/templates/web/bromley/report/display.html @@ -79,7 +79,9 @@ <select name="state" id="form_state"> [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', loc('Investigating')], ['planned', loc('Planned')], ['in progress', - loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')] ] %] + loc('In Progress')], ['action scheduled', loc('Action Scheduled')], + ['duplicate', loc('Duplicate')], ['unable to fix', loc('Unable to fix')], + ['not responsible', loc('Not Responsible')], ['fixed', loc('Fixed')] ] %] <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html index 6b93539f2..db0e3fcb8 100644 --- a/templates/web/default/report/display.html +++ b/templates/web/default/report/display.html @@ -78,7 +78,9 @@ <select name="state" id="form_state"> [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', loc('Investigating')], ['planned', loc('Planned')], ['in progress', - loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')] ] %] + loc('In Progress')], ['action scheduled', loc('Action Scheduled')], + ['duplicate', loc('Duplicate')], ['unable to fix', loc('Unable to fix')], + ['not responsible', loc('Not Responsible')], ['fixed', loc('Fixed')] ] %] <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> diff --git a/templates/web/fixmystreet/report/display.html b/templates/web/fixmystreet/report/display.html index a22de373d..8f28d795b 100644 --- a/templates/web/fixmystreet/report/display.html +++ b/templates/web/fixmystreet/report/display.html @@ -73,7 +73,9 @@ <select name="state" id="form_state"> [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', loc('Investigating')], ['planned', loc('Planned')], ['in progress', - loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')] ] %] + loc('In Progress')], ['action scheduled', loc('Action Scheduled')], + ['duplicate', loc('Duplicate')], ['unable to fix', loc('Unable to fix')], + ['not responsible', loc('Not Responsible')], ['fixed', loc('Fixed')] ] %] <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> |