aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin/Bodies.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/Bodies.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/Bodies.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Bodies.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
index 098c29ad4..ea03b146f 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
@@ -280,7 +280,6 @@ sub update_contact : Private {
$contact->unset_extra_metadata( 'group' );
}
-
$c->forward('/admin/update_extra_fields', [ $contact ]);
$c->forward('contact_cobrand_extra_fields', [ $contact, \%errors ]);
@@ -306,12 +305,13 @@ sub update_contact : Private {
$c->stash->{errors} = \%errors;
} elsif ( $contact->in_storage ) {
$c->stash->{updated} = _('Values updated');
-
+ $c->forward('/admin/log_edit', [ $contact->id, 'category', 'edit' ]);
# NB: History is automatically stored by a trigger in the database
$contact->update;
} else {
$c->stash->{updated} = _('New category contact added');
$contact->insert;
+ $c->forward('/admin/log_edit', [ $contact->id, 'category', 'add' ]);
}
unless ( %errors ) {
@@ -346,6 +346,7 @@ sub confirm_contacts : Private {
}
);
+ $c->forward('/admin/log_edit', [ $c->stash->{body_id}, 'body', 'edit' ]);
$c->stash->{updated} = _('Values updated');
}
@@ -360,8 +361,10 @@ sub update_body : Private {
if ($body) {
$body->update( $values->{params} );
+ $c->forward('/admin/log_edit', [ $body->id, 'body', 'edit' ]);
} else {
$body = $c->model('DB::Body')->create( $values->{params} );
+ $c->forward('/admin/log_edit', [ $body->id, 'body', 'add' ]);
}
if ($values->{extras}) {