diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Council.pm | 31 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 21 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FiksGataMi.pm | 9 |
3 files changed, 31 insertions, 30 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Council.pm b/perllib/FixMyStreet/App/Controller/Council.pm index 843a25499..53f7e38d8 100644 --- a/perllib/FixMyStreet/App/Controller/Council.pm +++ b/perllib/FixMyStreet/App/Controller/Council.pm @@ -63,7 +63,7 @@ sub load_and_check_councils : Private { } # edit hash in-place - _remove_redundant_councils($all_councils) if $c->stash->{remove_redundant_councils}; + $c->cobrand->remove_redundant_councils($all_councils) if $c->stash->{remove_redundant_councils}; # If we don't have any councils we can't accept the report if ( !scalar keys %$all_councils ) { @@ -78,35 +78,6 @@ sub load_and_check_councils : Private { return 1; } -# TODO - should not be here. -# These are country specific tweaks that should be in the cobrands -sub _remove_redundant_councils { - my $all_councils = shift; - - # UK specific tweaks - if ( FixMyStreet->config('COUNTRY') eq 'GB' ) { - - # Ipswich & St Edmundsbury are responsible for everything in their - # areas, not Suffolk - delete $all_councils->{2241} - if $all_councils->{2446} # - || $all_councils->{2443}; - - # Norwich is responsible for everything in its areas, not Norfolk - delete $all_councils->{2233} # - if $all_councils->{2391}; - } - - # Norway specific tweaks - if ( FixMyStreet->config('COUNTRY') eq 'NO' ) { - - # Oslo is both a kommune and a fylke, we only want to show it once - delete $all_councils->{301} # - if $all_councils->{3}; - } - -} - =head1 AUTHOR Struan Donald diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index e3a1aa8ee..260be07a5 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -590,5 +590,26 @@ sub email_host { && "http://$email_vhost" eq mySociety::Config::get("BASE_URL"); } +=item remove_redundant_councils + +Remove councils whose reports go to another council + +=cut + +sub remove_redundant_councils { + my $self = shift; + my $all_councils = shift; + + # Ipswich & St Edmundsbury are responsible for everything in their + # areas, not Suffolk + delete $all_councils->{2241} + if $all_councils->{2446} # + || $all_councils->{2443}; + + # Norwich is responsible for everything in its areas, not Norfolk + delete $all_councils->{2233} # + if $all_councils->{2391}; +} + 1; diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm index 1b9a1fab7..d733ba8f0 100644 --- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm +++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm @@ -51,4 +51,13 @@ sub geocoded_string_check { return 0; } +sub remove_redundant_councils { + my $self = shift; + my $all_councils = shift; + + # Oslo is both a kommune and a fylke, we only want to show it once + delete $all_councils->{301} # + if $all_councils->{3}; +} + 1; |