aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-05-30 11:40:30 +0100
committerDave Arter <davea@mysociety.org>2017-05-30 11:40:30 +0100
commit655d6b3728f89bdd670b9b08847172d2321f63d7 (patch)
treecaade769a16526a6a0268b560775a5989bcb43eb
parent565b32d48bb364ec7097faff01a2eabb336e72c9 (diff)
[Bromley] Restore staff update function
The Bromley update form needed to be updated to use the new <select> template. This also fixes a situation where staff users (on all cobrands) wouldn't be able to leave updates on problems with state 'fixed - user'.
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm3
-rw-r--r--templates/web/base/report/inspect/state_groups_select.html1
-rw-r--r--templates/web/bromley/report/update-form.html12
3 files changed, 5 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 81a50dfa2..261a49ec1 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -342,7 +342,8 @@ sub check_for_errors : Private {
my ( $self, $c ) = @_;
# they have to be an authority user to update the state
- if ( my $state = $c->get_param('state') ) {
+ my $state = $c->get_param('state');
+ if ( $state && $state ne $c->stash->{update}->problem->state ) {
my $error = 0;
$error = 1 unless $c->user && $c->user->belongs_to_body( $c->stash->{update}->problem->bodies_str );
$error = 1 unless grep { $state eq $_ } FixMyStreet::DB::Result::Problem->council_states();
diff --git a/templates/web/base/report/inspect/state_groups_select.html b/templates/web/base/report/inspect/state_groups_select.html
index c4043751b..c344bf6d0 100644
--- a/templates/web/base/report/inspect/state_groups_select.html
+++ b/templates/web/base/report/inspect/state_groups_select.html
@@ -5,6 +5,7 @@ SET state_pretty = {
'in progress' = loc('In progress')
'action scheduled' = loc('Action Scheduled')
'fixed - council' = loc('Fixed - Council')
+ 'fixed - user' = loc('Fixed - User')
'unable to fix' = loc('No further action')
'not responsible' = loc('Not Responsible')
'duplicate' = loc('Duplicate')
diff --git a/templates/web/bromley/report/update-form.html b/templates/web/bromley/report/update-form.html
index c54fab5a5..a4cbf8ee1 100644
--- a/templates/web/bromley/report/update-form.html
+++ b/templates/web/bromley/report/update-form.html
@@ -46,16 +46,8 @@
</div>
[% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %]
- <label for="form_state">[% loc( 'State' ) %]</label>
- <select name="state" id="form_state" class="form-control">
- [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating',
- loc('Investigating')], ['action scheduled', loc('Action Scheduled')],
- ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')],
- ['unable to fix', loc('No further action')], ['not responsible', loc('Not Responsible')],
- ['fixed', loc('Fixed')] ] %]
- <option [% 'selected ' IF state.0 == problem.state_display %] value="[% state.0 %]">[% state.1 %]</option>
- [% END %]
- </select>
+ <label for="state">[% loc( 'State' ) %]</label>
+ [% INCLUDE 'report/inspect/state_groups_select.html' %]
[% ELSE %]
[% IF problem.is_fixed AND c.user_exists AND c.user.id == problem.user_id %]