aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fixmystreet.com
diff options
context:
space:
mode:
Diffstat (limited to 'bin/fixmystreet.com')
-rwxr-xr-xbin/fixmystreet.com/banes-close-reports1
-rwxr-xr-xbin/fixmystreet.com/bromley-echo33
-rwxr-xr-xbin/fixmystreet.com/bromley-fetch-waste24
-rwxr-xr-xbin/fixmystreet.com/buckinghamshire-flytipping1
-rwxr-xr-xbin/fixmystreet.com/fixture24
5 files changed, 80 insertions, 3 deletions
diff --git a/bin/fixmystreet.com/banes-close-reports b/bin/fixmystreet.com/banes-close-reports
index bba4c88e0..79c1c44b9 100755
--- a/bin/fixmystreet.com/banes-close-reports
+++ b/bin/fixmystreet.com/banes-close-reports
@@ -50,7 +50,6 @@ my $q = FixMyStreet::DB->resultset("Problem")->search({
# Provide some variables to the archiving script
FixMyStreet::Script::ArchiveOldEnquiries::update_options({
user => $body->comment_user->id,
- user_name => $body->comment_user->name,
closure_text => CLOSURE_TEXT,
retain_alerts => 1,
commit => $opts->commit,
diff --git a/bin/fixmystreet.com/bromley-echo b/bin/fixmystreet.com/bromley-echo
new file mode 100755
index 000000000..01fdec110
--- /dev/null
+++ b/bin/fixmystreet.com/bromley-echo
@@ -0,0 +1,33 @@
+#!/usr/bin/env perl
+
+# bromley-echo
+# Call the Echo API in parallel
+
+use v5.14;
+use warnings;
+
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../../setenv.pl";
+}
+
+use Getopt::Long::Descriptive;
+use JSON::MaybeXS;
+use Storable;
+use FixMyStreet::Cobrand::Bromley;
+
+my ($opts, $usage) = describe_options(
+ '%c %o',
+ ['out=s', 'where to output CSV data'],
+ ['calls=s', 'JSON of what API calls to make'],
+ ['help|h', "print usage message and exit" ],
+);
+$usage->die if $opts->help;
+
+my $cobrand = FixMyStreet::Cobrand::Bromley->new;
+
+my $calls = decode_json($opts->calls);
+$calls = $cobrand->_parallel_api_calls(@$calls);
+Storable::store($calls, $opts->out);
diff --git a/bin/fixmystreet.com/bromley-fetch-waste b/bin/fixmystreet.com/bromley-fetch-waste
new file mode 100755
index 000000000..392905c83
--- /dev/null
+++ b/bin/fixmystreet.com/bromley-fetch-waste
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+
+use v5.14;
+use warnings;
+
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../../setenv.pl";
+}
+
+use Getopt::Long::Descriptive;
+use FixMyStreet::Cobrand::Bromley;
+
+my ($opts, $usage) = describe_options(
+ '%c %o',
+ ['verbose|v', 'more verbose output'],
+ ['help|h', "print usage message and exit" ],
+);
+$usage->die if $opts->help;
+
+my $cobrand = FixMyStreet::Cobrand::Bromley->new;
+$cobrand->waste_fetch_events($opts->verbose);
diff --git a/bin/fixmystreet.com/buckinghamshire-flytipping b/bin/fixmystreet.com/buckinghamshire-flytipping
index a312f9fbe..65e87d30e 100755
--- a/bin/fixmystreet.com/buckinghamshire-flytipping
+++ b/bin/fixmystreet.com/buckinghamshire-flytipping
@@ -79,7 +79,6 @@ sub find_problems {
# Provide some variables to the archiving script
FixMyStreet::Script::ArchiveOldEnquiries::update_options({
user => $body->comment_user->id,
- user_name => $body->comment_user->name,
closure_text => $template->text,
retain_alerts => $retain_alerts,
commit => $opts->commit,
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture
index 1062eb16b..59de8e222 100755
--- a/bin/fixmystreet.com/fixture
+++ b/bin/fixmystreet.com/fixture
@@ -99,15 +99,35 @@ if ($opt->test_fixtures) {
{ area_id => 2257, categories => ['Flytipping', 'Graffiti'], name => 'Chiltern District Council' },
{ area_id => 2397, categories => [ 'Graffiti' ], name => 'Northampton Borough Council' },
{ area_id => 2483, categories => [ 'Potholes', 'Other' ], name => 'Hounslow Borough Council' },
+ { area_id => 2508, categories => [ 'Potholes', 'Other' ], name => 'Hackney Council' },
{ area_id => 2636, categories => [ 'Potholes', 'Private', 'Extra' ], name => 'Isle of Wight Council' },
- { area_id => 2566, categories => [ 'Fallen branch' ], name => 'Peterborough City Council' },
+ { area_id => 2566, categories => [ 'Fallen branch', 'Light Out', 'Light Dim', 'Fallen Tree', 'Damaged Tree' ], name => 'Peterborough City Council' },
{ area_id => 2498, categories => [ 'Incorrect timetable', 'Glass broken', 'Mobile Crane Operation' ], name => 'TfL' },
+ { area_id => 2237, categories => [ 'Flytipping', 'Roads', 'Parks' ], name => 'Oxfordshire County Council' },
) {
$bodies->{$_->{area_id}} = FixMyStreet::DB::Factory::Body->find_or_create($_);
my $cats = join(', ', @{$_->{categories}});
say "Created body $_->{name} for MapIt area ID $_->{area_id}, categories $cats";
}
+ for my $cat_name ('Fallen Tree', 'Damaged Tree') {
+ my $cat = FixMyStreet::DB->resultset('Contact')->find({
+ body => $bodies->{2566},
+ category => $cat_name,
+ });
+ $cat->set_extra_metadata( group => 'Trees' );
+ $cat->update;
+ }
+
+ for my $cat_name ('Light Out', 'Light Dim') {
+ my $cat = FixMyStreet::DB->resultset('Contact')->find({
+ body => $bodies->{2566},
+ category => $cat_name,
+ });
+ $cat->set_extra_metadata( group => 'Street lighting' );
+ $cat->update;
+ }
+
my $child_cat = FixMyStreet::DB->resultset("Contact")->find({
body => $bodies->{2234},
category => 'Very Urgent',
@@ -260,6 +280,7 @@ $priority->add_to_contacts($body->contacts->first);
say "Created users, all with password 'password':";
my %users;
my $perms_inspector = ['report_inspect', 'planned_reports'];
+my $perms_inspector_with_instruct = [@$perms_inspector, 'report_instruct'];
my $perms_cs = [
'contribute_as_body', 'contribute_as_another_user',
'moderate', 'view_body_contribute_details',
@@ -271,6 +292,7 @@ my $perms_cs_full = [
];
foreach (
{ name => 'Inspector Gadget', email => 'inspector@example.org', email_verified => 1, body => $body, permissions => $perms_inspector },
+ { name => 'Inspector Instructor', email => 'inspector-instructor@example.org', email_verified => 1, body => $body, permissions => $perms_inspector_with_instruct },
{ name => 'Harriet Helpful', email_verified => 1, email => 'cs@example.org', body => $body, permissions => $perms_cs },
{ name => 'Andrew Agreeable', email_verified => 1, email => 'cs_full@example.org', body => $body, permissions => $perms_cs_full },
{ name => 'Super User', email_verified => 1, email => 'super@example.org', body => $body, permissions => [