diff options
author | Struan Donald <struan@exo.org.uk> | 2019-11-15 14:41:14 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2019-11-15 15:27:19 +0000 |
commit | 787f2972f0003ee467d84a87458ac2ae6aff1ae4 (patch) | |
tree | 344c540619c1a17df50f2bf01e316881294441ae /perllib/FixMyStreet/App/Controller/Report/New.pm | |
parent | 19ec44cbdf19f8c5711effff76735f20290e3855 (diff) |
allow staff to submit in disabled categories
If a user belongs to a body override the disabled form check upon
submission as mostly staff users can submit in those categories.
Fixes mysociety/fixmystreet-freshdesk#98
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 8dec06e86..585337d8b 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -313,6 +313,10 @@ sub disable_form_message : Private { my ( $self, $c ) = @_; my %out; + + # do not set disable form message if they are a staff user + return \%out if $c->cobrand->call_hook('staff_ignore_form_disable_form'); + foreach (@{$c->stash->{category_extras}->{$c->stash->{category}}}) { if ($_->{disable_form} && $_->{disable_form} eq 'true') { $out{all} .= ' ' if $out{all}; |