aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/PopulateServiceList.pm
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2014-07-15 14:15:46 +0000
committerHakim Cassimally <hakim@mysociety.org>2014-10-16 16:56:27 +0000
commit56eab366fc60fe83024abb6819c146bc9bd47adc (patch)
treea12aa26e01855c297ebcaf6232319f3e41b1e669 /perllib/Open311/PopulateServiceList.pm
parentf47e9d48a2d26e92723ae96d3d65a1ba005f426f (diff)
Open311 Warwick (Exor) Integration
::Integration::Warwick subclasses ::Integration::Exor refactor request_class and new_request Exor service Warwickshire updates retrieval, with datetimes stubbing out of Oracle constants, for local testing We also edit FMS's core PopulateServiceList routine to hide system fields from FMS: Bromley/Warwickshire send metadata in their services/FOO.xml advising that you can pass, e.g. attributes[easting]. FMS by default shows all of these to the user to fill in, however we don't *want* the user to supply these, rather they are added by the cobrand. Bromley had an exception for this (keyed by $body->areas->id). We write this more generally for Warwickshire too, keying instead by $body->name (as this is far less likely to be overridden for installs using global or custom Mapit's)
Diffstat (limited to 'perllib/Open311/PopulateServiceList.pm')
-rw-r--r--perllib/Open311/PopulateServiceList.pm23
1 files changed, 18 insertions, 5 deletions
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm
index c5fc4a506..d1a4d607f 100644
--- a/perllib/Open311/PopulateServiceList.pm
+++ b/perllib/Open311/PopulateServiceList.pm
@@ -228,10 +228,13 @@ sub _add_meta_to_contact {
sort { $a->{order} <=> $b->{order} }
@{ $meta_data->{attributes}->{attribute} };
- # we add these later on from bromley so don't list them here
- # as we don't want to display them
- if ( $self->_current_body->areas->{2482} ) {
- my %ignore = map { $_ => 1 } qw/
+ # 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"
+
+ my %override = (
+ #2482
+ 'Bromley Council' => [qw(
service_request_id_ext
requested_datetime
report_url
@@ -243,8 +246,18 @@ sub _add_meta_to_contact {
report_title
public_anonymity_required
email_alerts_requested
- /;
+ ) ],
+ #2242,
+ 'Warwickshire County Council' => [qw(
+ external_id
+ easting
+ northing
+ closest_address
+ ) ],
+ );
+ if (my $override = $override{ $self->_current_body->name }) {
+ my %ignore = map { $_ => 1 } @{ $override };
@meta = grep { ! $ignore{ $_->{ code } } } @meta;
}