diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 11 |
2 files changed, 12 insertions, 0 deletions
@@ -75,6 +75,7 @@ web-based cross-browser testing tools for this project. - Show any waiting reports on admin index page. #1382 - Allow user's phone number to be edited, and a report's category. #400 - Resend report if changing category changes body. #1560. + - Leave a public update if an admin changes a report's category. #1544 - New user system: - /admin requires a user with the `is_superuser` flag. #1463 - `createsuperuser` command for creating superusers. diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index c4bd5c293..bfe427e19 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -841,6 +841,7 @@ sub report_edit_category : Private { my ($self, $c, $problem) = @_; if ((my $category = $c->get_param('category')) ne $problem->category) { + my $category_old = $problem->category; $problem->category($category); my @contacts = grep { $_->category eq $problem->category } @{$c->stash->{contacts}}; my @new_body_ids = map { $_->body_id } @contacts; @@ -849,6 +850,16 @@ sub report_edit_category : Private { $problem->whensent(undef); } $problem->bodies_str(join( ',', @new_body_ids )); + $problem->add_to_comments({ + text => '*' . sprintf(_('Category changed from ā%sā to ā%sā'), $category_old, $category) . '*', + created => \'current_timestamp', + confirmed => \'current_timestamp', + user_id => $c->user->id, + name => $c->user->from_body ? $c->user->from_body->name : $c->user->name, + state => 'confirmed', + mark_fixed => 0, + anonymous => 0, + }); } } |