diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/Page.pm | 11 | ||||
-rw-r--r-- | perllib/Problems.pm | 8 |
2 files changed, 13 insertions, 6 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm index 326ea992e..edfe3ba7c 100644 --- a/perllib/Page.pm +++ b/perllib/Page.pm @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: Page.pm,v 1.103 2008-05-21 16:13:12 matthew Exp $ +# $Id: Page.pm,v 1.104 2008-05-23 09:53:10 matthew Exp $ # package Page; @@ -411,9 +411,10 @@ sub os_to_px_with_adjust { # send_email TO (NAME) TEMPLATE-NAME PARAMETERS sub send_email { - my ($email, $name, $thing, %h) = @_; + my ($q, $email, $name, $thing, %h) = @_; my $template = "$thing-confirm"; $template = File::Slurp::read_file("$FindBin::Bin/../templates/emails/$template"); + $template =~ s/FixMyStreet/Envirocrime/ if $q->{site} eq 'scambs'; my $to = $name ? [[$email, $name]] : $email; my $sender = mySociety::Config::get('CONTACT_EMAIL'); $sender =~ s/team/fms-DO-NOT-REPLY/; @@ -715,4 +716,10 @@ sub workaround_pg_bytea { $s->execute(); } +sub scambs_categories { + return ('Abandoned vehicles', 'Discarded hypodermic needles', + 'Dog fouling', 'Flytipping', 'Graffiti', 'Lighting (e.g. security lights)', + 'Litter', 'Neighbourhood noise'); +} + 1; diff --git a/perllib/Problems.pm b/perllib/Problems.pm index c767c7abf..548496f63 100644 --- a/perllib/Problems.pm +++ b/perllib/Problems.pm @@ -6,7 +6,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: Problems.pm,v 1.2 2008-05-21 15:48:06 matthew Exp $ +# $Id: Problems.pm,v 1.3 2008-05-23 09:53:10 matthew Exp $ # package Problems; @@ -18,10 +18,10 @@ use mySociety::Web qw/ent/; my $site_restriction = ''; sub set_site_restriction { my $site = shift; + my @cats = Page::scambs_categories(); + my $cats = join("','", @cats); $site_restriction = " and council=2260 and category in - ('Abandoned vehicles', 'Discarded hypodermic needles', 'Dog fouling', - 'Flytipping', 'Graffiti', 'Lighting (e.g. security lights)', 'Litter', - 'Neighbourhood noise') " + ('$cats') " if $site eq 'scambs'; } |