diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 19 |
2 files changed, 18 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 7fb11d6f4..2d0193ae5 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -841,6 +841,7 @@ sub update_edit : Path('update_edit') : Args(1) { if ( $new_state eq 'confirmed' and $old_state eq 'unconfirmed' ) { $update->confirmed( \'ms_current_timestamp()' ); + # XXX Also need to update state of problem here if needed - Zurich only? } $update->update; diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index faeed1cf0..4e3fd2d01 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -42,8 +42,7 @@ sub show_unconfirmed_reports { sub admin_type { my $self = shift; my $c = $self->{c}; - my $user = $c->user; - my $body = $user->from_body; + my $body = $c->user->from_body; $c->stash->{body} = $body; my $parent = $body->parent; @@ -157,6 +156,22 @@ sub admin_report_edit { $c->forward('check_token'); # Add new update from status_update + my $update = $c->req->param('status_update'); + FixMyStreet::App->model('DB::Comment')->create( { + text => $update, + user => $c->user->obj, + state => 'unconfirmed', + problem => $problem, + mark_fixed => 0, + problem_state => 'fixed - council', + anonymous => 1, + } ); + + $c->stash->{status_message} = '<p><em>' . _('Updated!') . '</em></p>'; + + $c->stash->{updates} = [ $c->model('DB::Comment') + ->search( { problem_id => $problem->id }, { order_by => 'created' } ) + ->all ]; return 1; } |