1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
package FixMyStreet::Cobrand::Lincolnshire;
use parent 'FixMyStreet::Cobrand::Whitelabel';
use strict;
use warnings;
use LWP::Simple;
use URI;
use Try::Tiny;
use JSON::MaybeXS;
use Moo;
with 'FixMyStreet::Roles::ConfirmOpen311';
with 'FixMyStreet::Roles::ConfirmValidation';
sub council_area_id { return 2232; }
sub council_area { return 'Lincolnshire'; }
sub council_name { return 'Lincolnshire County Council'; }
sub council_url { return 'lincolnshire'; }
sub is_two_tier { 1 }
sub send_questionnaires { 0 }
sub report_sent_confirmation_email { 'external_id' }
sub admin_user_domain { 'lincolnshire.gov.uk' }
sub enter_postcode_text {
my ($self) = @_;
return 'Enter a Lincolnshire postcode, street name and area, or check an existing report number';
}
sub disambiguate_location {
my $self = shift;
my $string = shift;
return {
%{ $self->SUPER::disambiguate_location() },
town => 'Lincolnshire',
centre => '53.1128371079972,-0.237920757894981',
span => '0.976148231905086,1.17860658530345',
bounds => [ 52.6402179235688, -0.820651304784901, 53.6163661554738, 0.357955280518546 ],
};
}
sub lookup_site_code_config { {
buffer => 200, # metres
url => "https://tilma.mysociety.org/mapserver/lincs",
srsname => "urn:ogc:def:crs:EPSG::27700",
typename => "NSG",
property => "Site_Code",
accept_feature => sub { 1 }
} }
sub categories_restriction {
my ($self, $rs) = @_;
# Lincolnshire is a two-tier council, but don't want to display
# all district-level categories on their cobrand - just a couple.
return $rs->search( { -or => [
'body.name' => [ "Lincolnshire County Council", 'Highways England' ],
# District categories:
'me.category' => { -in => [
'Street nameplates',
'Bench/cycle rack/litter bin/planter',
] },
] } );
}
sub pin_colour {
my ( $self, $p, $context ) = @_;
my $ext_status = $p->get_extra_metadata('external_status_code');
return 'yellow' if $p->state eq 'confirmed' && $ext_status && $ext_status eq '0135';
return 'red' if $p->state eq 'confirmed';
return 'green' if $p->is_fixed || $p->is_closed;
return 'grey' if $p->state eq 'not responsible' || !$self->owns_problem( $p );
return 'yellow';
}
around 'open311_config' => sub {
my ($orig, $self, $row, $h, $params) = @_;
$params->{upload_files} = 1;
$self->$orig($row, $h, $params);
};
1;
|