aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Script
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-04-20 15:40:15 +0100
committerMatthew Somerville <matthew@mysociety.org>2016-04-20 19:36:25 +0100
commit0fe0f7e15317fd66925195bbb624bbb572d2b8ef (patch)
tree8b5197c482f2acf783dc37cbaded03e0a2f88e7c /perllib/FixMyStreet/Script
parent193697bde57ef2cfd0a46bb5a85fa98727378297 (diff)
Remove some unused cobrands.
Diffstat (limited to 'perllib/FixMyStreet/Script')
-rw-r--r--perllib/FixMyStreet/Script/Questionnaires.pm32
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm2
2 files changed, 9 insertions, 25 deletions
diff --git a/perllib/FixMyStreet/Script/Questionnaires.pm b/perllib/FixMyStreet/Script/Questionnaires.pm
index 2d676f15d..f72f59077 100644
--- a/perllib/FixMyStreet/Script/Questionnaires.pm
+++ b/perllib/FixMyStreet/Script/Questionnaires.pm
@@ -10,8 +10,6 @@ use FixMyStreet::Cobrand;
sub send {
my ( $params ) = @_;
send_questionnaires_period( '4 weeks', $params );
- send_questionnaires_period( '26 weeks', $params )
- if $params->{site} eq 'emptyhomes';
}
sub send_questionnaires_period {
@@ -29,17 +27,11 @@ sub send_questionnaires_period {
],
send_questionnaire => 1,
};
- # FIXME Do these a bit better...
- if ($params->{site} eq 'emptyhomes' && $period eq '4 weeks') {
- $q_params->{'(select max(whensent) from questionnaire where me.id=problem_id)'} = undef;
- } elsif ($params->{site} eq 'emptyhomes' && $period eq '26 weeks') {
- $q_params->{'(select max(whensent) from questionnaire where me.id=problem_id)'} = { '!=', undef };
- } else {
- $q_params->{'-or'} = [
- '(select max(whensent) from questionnaire where me.id=problem_id)' => undef,
- '(select max(whenanswered) from questionnaire where me.id=problem_id)' => { '<', \"current_timestamp - '$period'::interval" }
- ];
- }
+
+ $q_params->{'-or'} = [
+ '(select max(whensent) from questionnaire where me.id=problem_id)' => undef,
+ '(select max(whenanswered) from questionnaire where me.id=problem_id)' => { '<', \"current_timestamp - '$period'::interval" }
+ ];
my $unsent = FixMyStreet::DB->resultset('Problem')->search( $q_params, {
order_by => { -desc => 'confirmed' }
@@ -60,13 +52,7 @@ sub send_questionnaires_period {
# call checks if this is the host that sends mail for this cobrand.
next unless $cobrand->email_host;
- my $template;
- if ($params->{site} eq 'emptyhomes') {
- ($template = $period) =~ s/ //;
- $template = Utils::read_file( FixMyStreet->path_to( "templates/email/emptyhomes/" . $row->lang . "/questionnaire-$template.txt" )->stringify );
- } else {
- $template = FixMyStreet->get_email_template($cobrand->moniker, $row->lang, 'questionnaire.txt');
- }
+ my $template = FixMyStreet->get_email_template($cobrand->moniker, $row->lang, 'questionnaire.txt');
my %h = map { $_ => $row->$_ } qw/name title detail category/;
$h{created} = Utils::prettify_duration( time() - $row->confirmed->epoch, 'week' );
@@ -76,10 +62,8 @@ sub send_questionnaires_period {
whensent => \'current_timestamp',
} );
- # We won't send another questionnaire unless they ask for it (or it was
- # the first EHA questionnaire.
- $row->send_questionnaire( 0 )
- if $params->{site} ne 'emptyhomes' || $period eq '26 weeks';
+ # We won't send another questionnaire unless they ask for it
+ $row->send_questionnaire( 0 );
my $token = FixMyStreet::DB->resultset("Token")->new_result( {
scope => 'questionnaire',
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index 8b1ce6759..75111b852 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -203,7 +203,7 @@ sub send(;$) {
if (FixMyStreet->config('STAGING_SITE') && !FixMyStreet->config('SEND_REPORTS_ON_STAGING')) {
# on a staging server send emails to ourselves rather than the bodies
- %reporters = map { $_ => $reporters{$_} } grep { /FixMyStreet::SendReport::(Email|EmptyHomes)/ } keys %reporters;
+ %reporters = map { $_ => $reporters{$_} } grep { /FixMyStreet::SendReport::Email/ } keys %reporters;
unless (%reporters) {
%reporters = ( 'FixMyStreet::SendReport::Email' => FixMyStreet::SendReport::Email->new() );
}