diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-30 14:12:18 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-30 14:12:18 +0100 |
commit | 9b40321e0b641c046dbd642ad600cce83fbba8a3 (patch) | |
tree | a49e0160a554fdad54bf9e813cb009049ba8a5cc /perllib/FixMyStreet/App/Controller | |
parent | 81f86542c4d306d89f9a3718154203b35583fee5 (diff) | |
parent | b36d053978ff90e2827c8c859f8c2b15af3b5ad1 (diff) |
Merge branch '2469-improve-admin-category-form'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Bodies.pm | 16 |
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 8ca6bbc22..fa5a55213 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; |