aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm10
-rw-r--r--perllib/FixMyStreet/Map/Bromley.pm3
-rw-r--r--perllib/Open311/PopulateServiceList.pm61
4 files changed, 59 insertions, 17 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 3f79a99f7..799985f8e 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -402,7 +402,7 @@ sub inspect : Private {
if ( $problem->state eq 'duplicate') {
if (my $duplicate_of = $c->get_param('duplicate_of')) {
$problem->set_duplicate_of($duplicate_of);
- } elsif (not $c->get_param('public_update')) {
+ } elsif (not $c->get_param('include_update')) {
$valid = 0;
push @{ $c->stash->{errors} }, _('Please provide a duplicate ID or public update for this report.');
}
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index c52e871e3..5d14d0b01 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -114,11 +114,19 @@ sub open311_config {
my ($self, $row, $h, $params) = @_;
my $extra = $row->get_extra_fields;
+ my $title = $row->title;
+
+ foreach (@$extra) {
+ $title .= ' | ID: ' . $_->{value} if $_->{name} eq 'feature_id';
+ $title .= ' | PROW ID: ' . $_->{value} if $_->{name} eq 'prow_reference';
+ }
+ @$extra = grep { $_->{name} !~ /feature_id|prow_reference/ } @$extra;
+
push @$extra,
{ name => 'report_url',
value => $h->{url} },
{ name => 'report_title',
- value => $row->title },
+ value => $title },
{ name => 'public_anonymity_required',
value => $row->anonymous ? 'TRUE' : 'FALSE' },
{ name => 'email_alerts_requested',
diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm
index 1310c2a5a..22e4147f6 100644
--- a/perllib/FixMyStreet/Map/Bromley.pm
+++ b/perllib/FixMyStreet/Map/Bromley.pm
@@ -10,10 +10,11 @@ use base 'FixMyStreet::Map::FMS';
use strict;
sub map_javascript { [
- '/vendor/OpenLayers/OpenLayers.fixmystreet.js',
+ '/vendor/OpenLayers/OpenLayers.buckinghamshire.js',
'/js/map-OpenLayers.js',
'/js/map-bing-ol.js',
'/js/map-fms.js',
+ '/cobrands/fixmystreet/assets.js',
'/cobrands/bromley/map.js',
] }
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm
index ac9f156ae..4ffd8c143 100644
--- a/perllib/Open311/PopulateServiceList.pm
+++ b/perllib/Open311/PopulateServiceList.pm
@@ -237,9 +237,36 @@ sub _add_meta_to_contact {
# Some Open311 endpoints, such as Bromley and Warwickshire send <metadata>
# for attributes which we *don't* want to display to the user (e.g. as
# fields in "category_extras"
+ $self->_add_meta_to_contact_cobrand_overrides($contact, \@meta);
+
+ $contact->set_extra_fields(@meta);
+ $contact->update;
+}
+
+sub _add_meta_to_contact_cobrand_overrides {
+ my ( $self, $contact, $meta ) = @_;
if ($self->_current_body->name eq 'Bromley Council') {
$contact->set_extra_metadata( id_field => 'service_request_id_ext');
+ # Lights we want to store feature ID, PROW on all categories.
+ push @$meta, {
+ code => 'prow_reference',
+ datatype => 'string',
+ description => 'Right of way reference',
+ order => 101,
+ required => 'false',
+ variable => 'true',
+ automated => 'hidden_field',
+ };
+ push @$meta, {
+ code => 'feature_id',
+ datatype => 'string',
+ description => 'Feature ID',
+ order => 100,
+ required => 'false',
+ variable => 'true',
+ automated => 'hidden_field',
+ } if $self->_current_service->{service_code} eq 'LIGHTS';
} elsif ($self->_current_body->name eq 'Warwickshire County Council') {
$contact->set_extra_metadata( id_field => 'external_id');
}
@@ -264,11 +291,8 @@ sub _add_meta_to_contact {
if (my $override = $override{ $self->_current_body->name }) {
my %ignore = map { $_ => 1 } @{ $override };
- @meta = grep { ! $ignore{ $_->{ code } } } @meta;
+ @$meta = grep { ! $ignore{ $_->{ code } } } @$meta;
}
-
- $contact->set_extra_fields(@meta);
- $contact->update;
}
sub _normalize_service_name {
@@ -296,6 +320,21 @@ sub _delete_contacts_not_in_service_list {
}
);
+ $found_contacts = $self->_delete_contacts_not_in_service_list_cobrand_overrides($found_contacts);
+
+ $found_contacts->update(
+ {
+ state => 'deleted',
+ editor => $0,
+ whenedited => \'current_timestamp',
+ note => 'automatically marked as deleted by script'
+ }
+ );
+}
+
+sub _delete_contacts_not_in_service_list_cobrand_overrides {
+ my ( $self, $found_contacts ) = @_;
+
# for Warwickshire/Bristol/BANES, which are mixed Open311 and email, don't delete
# the email addresses
if ($self->_current_body->name eq 'Warwickshire County Council' ||
@@ -306,8 +345,9 @@ sub _delete_contacts_not_in_service_list {
email => { -not_like => '%@%' }
}
);
- } elsif ($self->_current_body->name eq 'East Hertfordshire District Council') {
- # For EHDC we need to leave the 'Other' category alone or reports made
+ } elsif ($self->_current_body->name eq 'East Hertfordshire District Council' ||
+ $self->_current_body->name eq 'Stevenage Borough Council') {
+ # For EHDC/Stevenage we need to leave the 'Other' category alone or reports made
# in this category will be sent only to Hertfordshire County Council.
$found_contacts = $found_contacts->search(
{
@@ -316,14 +356,7 @@ sub _delete_contacts_not_in_service_list {
);
}
- $found_contacts->update(
- {
- state => 'deleted',
- editor => $0,
- whenedited => \'current_timestamp',
- note => 'automatically marked as deleted by script'
- }
- );
+ return $found_contacts;
}
1;