diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-23 15:46:55 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-23 15:46:55 +0100 |
commit | 159fa8ad9e2427d8b20586baec4c260a0c71b57c (patch) | |
tree | 6feaba3a6fc6e83c86d79f5ed29f13cee114eb6d /perllib/FixMyStreet/App/Controller/Report/Update.pm | |
parent | 9d8c7de9057bbc721525907de8f0cd4c44d91cce (diff) |
update problem status from update
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index 354690949..a131fbd35 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -65,6 +65,10 @@ sub update_problem : Private { } } + if ( $update->problem_state ) { + $problem->state( $update->problem_state ); + } + $problem->lastupdate( \'ms_current_timestamp()' ); $problem->update; @@ -126,7 +130,7 @@ sub process_update : Private { my ( $self, $c ) = @_; my %params = - map { $_ => scalar $c->req->param($_) } ( 'update', 'name', 'fixed' ); + map { $_ => scalar $c->req->param($_) } ( 'update', 'name', 'fixed', 'state' ); $params{update} = Utils::cleanup_text( $params{update}, { allow_multiline => 1 } ); @@ -152,6 +156,12 @@ sub process_update : Private { } ); + if ( $params{state} ) { + $params{state} = 'fixed - council' + if $params{state} eq 'fixed' && $c->user && $c->user->from_authority; + $update->problem_state( $params{state} ); + } + $c->stash->{update} = $update; $c->stash->{add_alert} = $c->req->param('add_alert'); |