diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index be812c040..5e4018e4d 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -281,6 +281,11 @@ sub by_category_ajax_data : Private { $body->{category_extra_json} = $c->forward('generate_category_extra_json'); } + if ( $c->stash->{category_extras}->{$category} && @{ $c->stash->{category_extras}->{$category} } >= 1 ) { + my $disable_form = $c->forward('disable_form_message'); + $body->{disable_form} = $disable_form if $disable_form; + } + my $unresponsive = $c->stash->{unresponsive}->{$category}; $unresponsive ||= $c->stash->{unresponsive}->{ALL} || '' if $type eq 'one'; @@ -303,6 +308,18 @@ sub by_category_ajax_data : Private { return $body; } +sub disable_form_message : Private { + my ( $self, $c ) = @_; + + my @descriptions = map { + $_->{description} + } grep { + $_->{disable_form} && $_->{disable_form} eq 'true' + } @{ $c->stash->{category_extras}->{$c->stash->{category}} }; + + return join " ", @descriptions; +} + =head2 report_import Action to accept report creations from iPhones and other mobile apps. URL is |