aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin/Templates.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-11-05 16:33:51 +0000
committerMatthew Somerville <matthew@mysociety.org>2019-11-08 15:31:39 +0000
commit7a39608ab48c8fd3fa2c5a8061b42ee8f9869973 (patch)
treeaa51d01235cde53fd408348f2439121e22beab65 /perllib/FixMyStreet/App/Controller/Admin/Templates.pm
parenteb68c3fa83ce8796a69429c83adedddba64c7cdc (diff)
Add admin log entry for more objects and things.
Namely templates, roles, bodies, categories, various user edits, and when using the inspect form and changing category.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin/Templates.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Templates.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Templates.pm b/perllib/FixMyStreet/App/Controller/Admin/Templates.pm
index 1a7381c0b..97a62c2b8 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/Templates.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/Templates.pm
@@ -77,6 +77,7 @@ sub edit : Path : Args(2) {
if ($c->get_param('delete_template') && $c->get_param('delete_template') eq _("Delete template")) {
$template->contact_response_templates->delete_all;
$template->delete;
+ $c->forward('/admin/log_edit', [ $template->id, 'template', 'delete' ]);
} else {
my @live_contact_ids = map { $_->id } @live_contacts;
my @new_contact_ids = grep { $c->get_param("contacts[$_]") } @live_contact_ids;
@@ -144,6 +145,8 @@ sub edit : Path : Args(2) {
contact_id => $contact_id,
});
}
+ my $action = $template_id eq 'new' ? 'add' : 'edit';
+ $c->forward('/admin/log_edit', [ $template->id, 'template', $action ]);
}
$c->res->redirect( $c->uri_for_action( '/admin/templates/view', $c->stash->{body}->id ) );