aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/Cobrand/Bristol.pm9
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm5
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm1
-rw-r--r--perllib/FixMyStreet/Cobrand/Greenwich.pm9
-rw-r--r--perllib/FixMyStreet/Cobrand/Oxfordshire.pm6
-rw-r--r--perllib/FixMyStreet/Cobrand/UK.pm3
6 files changed, 27 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bristol.pm b/perllib/FixMyStreet/Cobrand/Bristol.pm
index 0660acc79..fa2d3fabb 100644
--- a/perllib/FixMyStreet/Cobrand/Bristol.pm
+++ b/perllib/FixMyStreet/Cobrand/Bristol.pm
@@ -75,4 +75,13 @@ sub open311_config {
$params->{always_send_email} = 1;
}
+sub open311_contact_meta_override {
+ my ($self, $service, $contact, $meta) = @_;
+
+ my %server_set = (easting => 1, northing => 1);
+ foreach (@$meta) {
+ $_->{automated} = 'server_set' if $server_set{$_->{code}};
+ }
+}
+
1;
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index 2ae498b38..341fb6a30 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -252,6 +252,11 @@ sub open311_contact_meta_override {
$contact->set_extra_metadata( id_field => 'service_request_id_ext');
+ my %server_set = (easting => 1, northing => 1, service_request_id_ext => 1);
+ foreach (@$meta) {
+ $_->{automated} = 'server_set' if $server_set{$_->{code}};
+ }
+
# Lights we want to store feature ID, PROW on all categories.
push @$meta, {
code => 'prow_reference',
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 53d25cec2..785177b5e 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -1182,6 +1182,7 @@ Return true if an Open311 service attribute should be a hidden field.
sub category_extra_hidden {
my ($self, $meta) = @_;
+ return 1 if ($meta->{automated} || '') eq 'hidden_field';
return 0;
}
diff --git a/perllib/FixMyStreet/Cobrand/Greenwich.pm b/perllib/FixMyStreet/Cobrand/Greenwich.pm
index 6ff30e83d..2aaa5d776 100644
--- a/perllib/FixMyStreet/Cobrand/Greenwich.pm
+++ b/perllib/FixMyStreet/Cobrand/Greenwich.pm
@@ -66,4 +66,13 @@ sub open311_config {
$row->set_extra_fields( @$extra );
}
+sub open311_contact_meta_override {
+ my ($self, $service, $contact, $meta) = @_;
+
+ my %server_set = (easting => 1, northing => 1, closest_address => 1);
+ foreach (@$meta) {
+ $_->{automated} = 'server_set' if $server_set{$_->{code}};
+ }
+}
+
1;
diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
index 5def2bb61..08482a0b3 100644
--- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
@@ -178,14 +178,12 @@ sub open311_config {
my $extra = $row->get_extra_fields;
push @$extra, { name => 'external_id', value => $row->id };
+ push @$extra, { name => 'northing', value => $h->{northing} };
+ push @$extra, { name => 'easting', value => $h->{easting} };
if ($h->{closest_address}) {
push @$extra, { name => 'closest_address', value => "$h->{closest_address}" }
}
- if ( $row->used_map || ( !$row->used_map && !$row->postcode ) ) {
- push @$extra, { name => 'northing', value => $h->{northing} };
- push @$extra, { name => 'easting', value => $h->{easting} };
- }
$row->set_extra_fields( @$extra );
$params->{extended_description} = 'oxfordshire';
diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm
index 1202d48a4..0eb350311 100644
--- a/perllib/FixMyStreet/Cobrand/UK.pm
+++ b/perllib/FixMyStreet/Cobrand/UK.pm
@@ -394,8 +394,7 @@ sub lookup_by_ref_regex {
sub category_extra_hidden {
my ($self, $meta) = @_;
return 1 if $meta->{code} eq 'usrn' || $meta->{code} eq 'asset_id';
- return 1 if $meta->{automated} eq 'hidden_field';
- return 0;
+ return $self->SUPER::category_extra_hidden($meta);
}
1;