diff options
Diffstat (limited to 'web/alert.cgi')
-rwxr-xr-x | web/alert.cgi | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/web/alert.cgi b/web/alert.cgi index 59b6607a4..c755c9715 100755 --- a/web/alert.cgi +++ b/web/alert.cgi @@ -104,13 +104,12 @@ sub alert_list { my @types = (@$mySociety::VotingArea::council_parent_types, @$mySociety::VotingArea::council_child_types); my %councils = map { $_ => 1 } @$mySociety::VotingArea::council_parent_types; - my $areas = mySociety::MaPit::get_voting_areas_by_location({easting=>$e, northing=>$n}, 'polygon', \@types); + my $areas = mySociety::MaPit::call('point', "27700/$e,$n", type => \@types); my $cobrand = Page::get_cobrand($q); my ($success, $error_msg) = Cobrand::council_check($cobrand, $areas, $q, 'alert'); if (!$success){ return alert_front_page($q, $error_msg); } - $areas = mySociety::MaPit::get_voting_areas_info([ keys %$areas ]); return alert_front_page($q, _('That location does not appear to be covered by a council, perhaps it is offshore - please try somewhere more specific.')) if keys %$areas == 0; @@ -126,9 +125,9 @@ sub alert_list { $ward = $_; } } - push @options, [ 'council', $council->{area_id}, Page::short_name($council->{name}), + push @options, [ 'council', $council->{id}, Page::short_name($council->{name}), sprintf(_("Problems within %s"), $council->{name}) ]; - push @options, [ 'ward', $council->{area_id}.':'.$ward->{area_id}, Page::short_name($council->{name}) . '/' + push @options, [ 'ward', $council->{id}.':'.$ward->{id}, Page::short_name($council->{name}) . '/' . Page::short_name($ward->{name}), sprintf(_("Problems within %s ward"), $ward->{name}) ]; $options_start = "<div><ul id='rss_feed'>"; @@ -142,7 +141,7 @@ sub alert_list { foreach (values %$areas) { $council = $_; } - push @options, [ 'council', $council->{area_id}, Page::short_name($council->{name}), + push @options, [ 'council', $council->{id}, Page::short_name($council->{name}), sprintf(_("Problems within %s"), $council->{name}) ]; $options_start = "<div><ul id='rss_feed'>"; @@ -165,24 +164,24 @@ sub alert_list { } } push @options, - [ 'area', $district->{area_id}, Page::short_name($district->{name}), $district->{name} ], - [ 'area', $district->{area_id}.':'.$d_ward->{area_id}, Page::short_name($district->{name}) . '/' + [ 'area', $district->{id}, Page::short_name($district->{name}), $district->{name} ], + [ 'area', $district->{id}.':'.$d_ward->{id}, Page::short_name($district->{name}) . '/' . Page::short_name($d_ward->{name}), "$d_ward->{name} ward, $district->{name}" ], - [ 'area', $county->{area_id}, Page::short_name($county->{name}), $county->{name} ], - [ 'area', $county->{area_id}.':'.$c_ward->{area_id}, Page::short_name($county->{name}) . '/' + [ 'area', $county->{id}, Page::short_name($county->{name}), $county->{name} ], + [ 'area', $county->{id}.':'.$c_ward->{id}, Page::short_name($county->{name}) . '/' . Page::short_name($c_ward->{name}), "$c_ward->{name} ward, $county->{name}" ]; $options_start = '<div id="rss_list">'; $options = $q->p($q->strong(_('Problems within the boundary of:'))) . $q->ul(alert_list_options($q, @options)); @options = (); push @options, - [ 'council', $district->{area_id}, Page::short_name($district->{name}), $district->{name} ], - [ 'ward', $district->{area_id}.':'.$d_ward->{area_id}, Page::short_name($district->{name}) . '/' . Page::short_name($d_ward->{name}), + [ 'council', $district->{id}, Page::short_name($district->{name}), $district->{name} ], + [ 'ward', $district->{id}.':'.$d_ward->{id}, Page::short_name($district->{name}) . '/' . Page::short_name($d_ward->{name}), "$district->{name}, within $d_ward->{name} ward" ]; if ($q->{site} ne 'emptyhomes') { push @options, - [ 'council', $county->{area_id}, Page::short_name($county->{name}), $county->{name} ], - [ 'ward', $county->{area_id}.':'.$c_ward->{area_id}, Page::short_name($county->{name}) . '/' + [ 'council', $county->{id}, Page::short_name($county->{name}), $county->{name} ], + [ 'ward', $county->{id}.':'.$c_ward->{id}, Page::short_name($county->{name}) . '/' . Page::short_name($c_ward->{name}), "$county->{name}, within $c_ward->{name} ward" ]; $options .= $q->p($q->strong(_('Or problems reported to:'))) . $q->ul(alert_list_options($q, @options)); |