aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fixmystreet.com/update-send-questionnaire
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2015-01-19 16:20:55 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2015-01-19 16:35:36 +0000
commit2e8df1a5a6610c43e0c1bda15d018fa16738061b (patch)
treee06b0a33d399caf5ba0fb94186f609617496740e /bin/fixmystreet.com/update-send-questionnaire
parent7fa239a9c2122074bb65bbb0ac7d30d922a4f761 (diff)
Tidy up of bin directory.
Remove some unneeded scripts, move others to cobrand-specific directories.
Diffstat (limited to 'bin/fixmystreet.com/update-send-questionnaire')
-rwxr-xr-xbin/fixmystreet.com/update-send-questionnaire29
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/fixmystreet.com/update-send-questionnaire b/bin/fixmystreet.com/update-send-questionnaire
new file mode 100755
index 000000000..7a231b919
--- /dev/null
+++ b/bin/fixmystreet.com/update-send-questionnaire
@@ -0,0 +1,29 @@
+#!/usr/bin/env perl
+
+=head1 DESCRIPTION
+
+Ad hoc script to update the send_questionnaire column on the
+reports in cobrands that don't send questionnaires at all.
+
+=cut
+
+use strict;
+use warnings;
+
+use FixMyStreet::App;
+
+my @cobrands;
+foreach my $cobrand ( FixMyStreet::Cobrand->available_cobrand_classes() ) {
+ next unless $cobrand->{class};
+ my $cls = $cobrand->{class}->new();
+ push @cobrands, $cls->moniker if !$cls->send_questionnaires();
+}
+
+my $problems = FixMyStreet::App->model('DB::Problem')->search({
+ cobrand => \@cobrands,
+ send_questionnaire => 1,
+});
+
+$problems->update( {
+ send_questionnaire => 0
+});