aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-04-07 10:39:32 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-04-07 10:39:33 +0100
commit7a6f6b5adbd33bd2b1a9aa4e51120801b270f7aa (patch)
treef7059b236c6cfa3c0d503399640a3db1bc69cda7
parent836201a3e6b4a54256ac63716eecad982b9abd65 (diff)
[Highways England] Allow lookup with “FMS” prefix.
This form of reference is shown on a report confirmation page.
-rw-r--r--perllib/FixMyStreet/Cobrand/HighwaysEngland.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/HighwaysEngland.pm b/perllib/FixMyStreet/Cobrand/HighwaysEngland.pm
index 54b0d09e3..ed58eb4f7 100644
--- a/perllib/FixMyStreet/Cobrand/HighwaysEngland.pm
+++ b/perllib/FixMyStreet/Cobrand/HighwaysEngland.pm
@@ -59,6 +59,20 @@ sub geocode_postcode {
return $self->next::method($s);
}
+sub lookup_by_ref_regex {
+ return qr/^\s*((?:FMS\s*)?\d+)\s*$/i;
+}
+
+sub lookup_by_ref {
+ my ($self, $ref) = @_;
+
+ if ( $ref =~ s/^\s*FMS\s*//i ) {
+ return { 'id' => $ref };
+ }
+
+ return 0;
+}
+
sub allow_photo_upload { 0 }
sub allow_anonymous_reports { 'button' }