diff options
author | Dave Arter <davea@mysociety.org> | 2018-04-10 17:00:26 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-10 18:02:26 +0100 |
commit | 1c9645f98a1ee93d11df0ac449915390eca2e42c (patch) | |
tree | 67f274cbe599cd8812a10e6e066f52366034e6eb | |
parent | 5b642b2985b6768f1eb44ad7fd580bf63f702899 (diff) |
[BANES] Limit categories visible on cobrand
-rw-r--r-- | perllib/FixMyStreet/Cobrand/BathNES.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/BathNES.pm b/perllib/FixMyStreet/Cobrand/BathNES.pm index 02d491e0e..f83887469 100644 --- a/perllib/FixMyStreet/Cobrand/BathNES.pm +++ b/perllib/FixMyStreet/Cobrand/BathNES.pm @@ -190,5 +190,22 @@ sub enter_postcode_text { return 'Enter a location in ' . $self->council_area; } +sub categories_restriction { + my ($self, $rs) = @_; + # Categories covering BANES have a mixture of Open311 and Email + # send methods. BANES only want specific categories to be visible on their + # cobrand, not the email categories from FMS.com. + # The FMS.com categories have a devolved send_method set to Email, so we can + # filter these out. + # NB. BANES have a 'Street Light Fault' category that has its + # send_method set to 'Email::BathNES' (to use a custom template) which must + # be show on the cobrand. + return $rs->search( { -or => [ + 'me.send_method' => undef, # Open311 categories + 'me.send_method' => '', # Open311 categories that have been edited in the admin + 'me.send_method' => 'Email::BathNES', # Street Light Fault + ] } ); +} + 1; |