aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Model/PhotoSet.pm1
-rw-r--r--perllib/FixMyStreet/Cobrand/Bexley.pm35
-rw-r--r--perllib/FixMyStreet/Cobrand/Hounslow.pm3
-rw-r--r--perllib/FixMyStreet/PhotoStorage.pm1
4 files changed, 29 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Model/PhotoSet.pm b/perllib/FixMyStreet/App/Model/PhotoSet.pm
index 1d9ccd7cd..c9f1c48a1 100644
--- a/perllib/FixMyStreet/App/Model/PhotoSet.pm
+++ b/perllib/FixMyStreet/App/Model/PhotoSet.pm
@@ -8,7 +8,6 @@ use Scalar::Util 'openhandle', 'blessed';
use Image::Size;
use IPC::Cmd qw(can_run);
use IPC::Open3;
-use MIME::Base64;
use FixMyStreet;
use FixMyStreet::ImageMagick;
diff --git a/perllib/FixMyStreet/Cobrand/Bexley.pm b/perllib/FixMyStreet/Cobrand/Bexley.pm
index 727382ec0..8720f42d8 100644
--- a/perllib/FixMyStreet/Cobrand/Bexley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bexley.pm
@@ -85,17 +85,34 @@ sub open311_post_send {
# Check Open311 was successful
return unless $row->external_id;
- return unless $row->category eq 'Abandoned and untaxed vehicles'
- || $row->category eq 'Animal fouling';
-
- my $mb = FixMyStreet->config('STAGING_SITE') ? 'digital-team' : 'P1sfromContactCentre';
- my $e = join('@', $mb, $self->admin_user_domain);
- my $sender = FixMyStreet::SendReport::Email->new( to => [ [ $e, 'Bexley P1 email' ] ] );
-
if ($row->category eq 'Abandoned and untaxed vehicles') {
- my ($burnt) = grep { $_->{name} eq 'burnt' } @{$row->get_extra_fields};
- return unless $burnt && $burnt->{value} eq 'Yes';
+ my $burnt = $row->get_extra_field_value('burnt') || '';
+ return unless $burnt eq 'Yes';
+ }
+
+ my @lighting = (
+ 'Lamp post',
+ 'Light in multi-storey car park',
+ 'Light in outside car park',
+ 'Light in park or open space',
+ 'Traffic bollard',
+ 'Traffic sign light',
+ 'Underpass light',
+ 'Zebra crossing light',
+ );
+ my %lighting = map { $_ => 1 } @lighting;
+
+ my $emails = $self->feature('open311_email') || return;
+ my ($e, $n);
+ if ($row->category eq 'Abandoned and untaxed vehicles' || $row->category eq 'Dead animal') {
+ $e = $emails->{p1};
+ $n = 'Bexley P1 email';
+ } elsif ($lighting{$row->category}) {
+ $e = $emails->{lighting};
+ $n = 'FixMyStreet Bexley Street Lighting';
}
+ return unless $e;
+ my $sender = FixMyStreet::SendReport::Email->new( to => [ [ $e, $n ] ] );
$self->open311_config($row); # Populate NSGRef again if needed
diff --git a/perllib/FixMyStreet/Cobrand/Hounslow.pm b/perllib/FixMyStreet/Cobrand/Hounslow.pm
index 1628715c6..ad764fdfd 100644
--- a/perllib/FixMyStreet/Cobrand/Hounslow.pm
+++ b/perllib/FixMyStreet/Cobrand/Hounslow.pm
@@ -181,8 +181,9 @@ sub lookup_site_code_config { {
# their cobrand at all.
sub problems_restriction {
my ($self, $rs) = @_;
+ my $table = ref $rs eq 'FixMyStreet::DB::ResultSet::Nearby' ? 'problem' : 'me';
return $rs->to_body($self->body)->search({
- 'me.confirmed' => { '>=', '2019-05-06' }
+ "$table.confirmed" => { '>=', '2019-05-06' }
});
}
diff --git a/perllib/FixMyStreet/PhotoStorage.pm b/perllib/FixMyStreet/PhotoStorage.pm
index 558c93749..9b0e5c9c3 100644
--- a/perllib/FixMyStreet/PhotoStorage.pm
+++ b/perllib/FixMyStreet/PhotoStorage.pm
@@ -1,5 +1,6 @@
package FixMyStreet::PhotoStorage;
+use MIME::Base64;
use Moose;
use Digest::SHA qw(sha1_hex);
use Module::Load;