aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-11-10 19:27:06 +0000
committerMatthew Somerville <matthew@mysociety.org>2019-11-10 19:27:06 +0000
commitd8dd060a4c2f75e89a24f99634d91a6d8ef0e2bc (patch)
treeabb543c32c9e5f239cc66cff1bafa697f322ebd3 /perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
parentdb61249c59a96a2fad80523288b7d13881c10965 (diff)
parentb886792181eb77206054e73315a9d14cdb17e936 (diff)
Merge branch 'admin-auditing'
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}) {