aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-09-25 18:11:54 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-09-30 11:46:56 +0100
commitb36d053978ff90e2827c8c859f8c2b15af3b5ad1 (patch)
tree3f141cbf061fd052d16dfbbb36e9edf71aa3592a /perllib/FixMyStreet/App/Controller/Admin
parent9439346af7941134fd4b98a115cd936947783f0a (diff)
Add top disable-form field to admin category form.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Bodies.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
index 67177fcbd..3d5f1084d 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
@@ -288,6 +288,22 @@ sub update_contacts : Private {
$c->forward('/admin/update_extra_fields', [ $contact ]);
$c->forward('contact_cobrand_extra_fields', [ $contact ]);
+ # Special form disabling form
+ if ($c->get_param('disable')) {
+ my $msg = $c->get_param('disable_message');
+ $errors{category} = _('Please enter a message') unless $msg;
+ my $meta = {
+ code => '_fms_disable_',
+ variable => 'false',
+ protected => 'true',
+ disable_form => 'true',
+ description => $msg,
+ };
+ $contact->update_extra_field($meta);
+ } else {
+ $contact->remove_extra_field('_fms_disable_');
+ }
+
if ( %errors ) {
$c->stash->{updated} = _('Please correct the errors below');
$c->stash->{contact} = $contact;