diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-01-10 19:05:11 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-01-10 19:05:11 +0000 |
commit | ca328b5d298c5463ff1e556d37d63b77db44cb5f (patch) | |
tree | 21f49be1a25659a9321b3bd6c138b4d3af2926f7 | |
parent | bb24e515ac0658efffd23ecbf7f14a9ae15db533 (diff) |
Zurich DM leaving public response on a report, after reading updates from SDM.
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 19 | ||||
-rw-r--r-- | templates/web/zurich/admin/report_edit.html | 12 |
2 files changed, 29 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 44893f61d..4eedc1249 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -186,6 +186,21 @@ sub admin_report_edit { $problem->title( $c->req->param('title') ); $problem->detail( $c->req->param('detail') ); + # Final, public, Update from DM + if (my $update = $c->req->param('status_update')) { + FixMyStreet::App->model('DB::Comment')->create( { + text => $update, + user => $c->user->obj, + state => 'confirmed', + confirmed => \'ms_current_timestamp()', + problem => $problem, + mark_fixed => 0, + problem_state => 'fixed - council', + anonymous => 1, + } ); + $problem->state( 'fixed - council' ); + } + $problem->lastupdate( \'ms_current_timestamp()' ); $problem->update; @@ -200,6 +215,10 @@ sub admin_report_edit { $c->detach('index'); } + $c->stash->{updates} = [ $c->model('DB::Comment') + ->search( { problem_id => $problem->id }, { order_by => 'created' } ) + ->all ]; + return 1; } diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html index 2cf65db82..91d776d96 100644 --- a/templates/web/zurich/admin/report_edit.html +++ b/templates/web/zurich/admin/report_edit.html @@ -3,11 +3,15 @@ [% status_message %] +[% IF problem.state == 'planned' %] +[% INCLUDE 'admin/list_updates.html' %] +[% END %] + <form method="post" action="[% c.uri_for( 'report_edit', problem.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> <input type="hidden" name="token" value="[% token %]" > <input type="hidden" name="submit" value="1" > -<div style="float:left; width:48%; margin-right:2%"> +<div style="float:left; margin-top: 1em; width:48%; margin-right:2%"> <ul> [%- cobrand_data = problem.cobrand_data %] @@ -108,7 +112,8 @@ </select></p> <ul> - <li>TODO: Leave public update to finish</li> +<li><label for="status_update">[% loc('Public response:') %]</label> +<textarea name='status_update' id='status_update' cols=60 rows=5></textarea></li> </ul> [% END %] @@ -120,6 +125,9 @@ </form> +[% IF problem.state != 'planned' %] [% INCLUDE 'admin/list_updates.html' %] +[% END %] + [% INCLUDE 'admin/footer.html' %] |