aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-12-06 11:06:06 +0000
committerDave Arter <davea@mysociety.org>2017-12-06 11:06:06 +0000
commitc63671a46c61e9f10965a85297d8fc5eee0af4b1 (patch)
tree43b15e69c0b285104029375cb8033cc2a8a5547f
parent83c2d924404740ff8ab5e7200a470fc28325ff6a (diff)
Add opt-in cobrand hook for category groups
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm20
1 files changed, 11 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index f63b0af1e..951f6f2be 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -706,17 +706,19 @@ sub setup_categories_and_bodies : Private {
$c->stash->{missing_details_bodies} = \@missing_details_bodies;
$c->stash->{missing_details_body_names} = \@missing_details_body_names;
- my %category_groups = ();
- for my $category (@category_options) {
- push @{$category_groups{$category->{group}}}, $category;
- }
+ if ( $c->cobrand->call_hook('enable_category_groups') ) {
+ my %category_groups = ();
+ for my $category (@category_options) {
+ push @{$category_groups{$category->{group}}}, $category;
+ }
- my @category_groups = ();
- for my $group ( grep { $_ ne _('Other') } sort keys %category_groups ) {
- push @category_groups, { name => $group, categories => $category_groups{$group} };
+ my @category_groups = ();
+ for my $group ( grep { $_ ne _('Other') } sort keys %category_groups ) {
+ push @category_groups, { name => $group, categories => $category_groups{$group} };
+ }
+ push @category_groups, { name => _('Other'), categories => $category_groups{_('Other')} } if ($category_groups{_('Other')});
+ $c->stash->{category_groups} = \@category_groups;
}
- push @category_groups, { name => _('Other'), categories => $category_groups{_('Other')} } if ($category_groups{_('Other')});
- $c->stash->{category_groups} = \@category_groups;
}
sub setup_report_extra_fields : Private {