diff options
Diffstat (limited to 'web')
-rwxr-xr-x | web/alert.cgi | 5 | ||||
-rwxr-xr-x | web/index.cgi | 11 | ||||
-rwxr-xr-x | web/rss.cgi | 3 |
3 files changed, 11 insertions, 8 deletions
diff --git a/web/alert.cgi b/web/alert.cgi index 46eef082b..70b9d1873 100755 --- a/web/alert.cgi +++ b/web/alert.cgi @@ -14,6 +14,7 @@ use Digest::SHA1 qw(sha1_hex); use Error qw(:try); use CrossSell; use FixMyStreet::Alert; +use FixMyStreet::Geocode; use mySociety::AuthToken; use mySociety::Config; use mySociety::DBHandle qw(select_all); @@ -84,12 +85,12 @@ sub alert_list { $n = FixMyStreet::Map::tile_to_os($input{y}); } else { try { - ($x, $y, $e, $n, $error) = Page::geocode($input{pc}, $q); + ($x, $y, $e, $n, $error) = FixMyStreet::Geocode::lookup($input{pc}, $q); } catch Error::Simple with { $error = shift; }; } - return Page::geocode_choice($error, '/alert', $q) if ref($error) eq 'ARRAY'; + return FixMyStreet::Geocode::list_choices($error, '/alert', $q) if ref($error) eq 'ARRAY'; return alert_front_page($q, $error) if $error; my $pretty_pc = $input_h{pc}; diff --git a/web/index.cgi b/web/index.cgi index 00778c442..1ffce4660 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -16,6 +16,7 @@ use CGI::Carp; use URI::Escape; use CrossSell; +use FixMyStreet::Geocode; use mySociety::AuthToken; use mySociety::Config; use mySociety::DBHandle qw(select_all); @@ -469,7 +470,7 @@ sub display_form { $easting = FixMyStreet::Map::tile_to_os($input{x}); $northing = FixMyStreet::Map::tile_to_os($input{y}); } else { - my ($x, $y, $e, $n, $error) = Page::geocode($input{pc}, $q); + my ($x, $y, $e, $n, $error) = FixMyStreet::Geocode::lookup($input{pc}, $q); $easting = $e; $northing = $n; } } elsif ($pin_x && $pin_y) { @@ -485,11 +486,11 @@ sub display_form { } elsif ($input{partial} && $input{pc} && !$input{easting} && !$input{northing}) { my ($x, $y, $error); try { - ($x, $y, $easting, $northing, $error) = Page::geocode($input{pc}, $q); + ($x, $y, $easting, $northing, $error) = FixMyStreet::Geocode::lookup($input{pc}, $q); } catch Error::Simple with { $error = shift; }; - return Page::geocode_choice($error, '/', $q) if ref($error) eq 'ARRAY'; + return FixMyStreet::Geocode::list_choices($error, '/', $q) if ref($error) eq 'ARRAY'; return front_page($q, $error) if $error; $input{x} = int(FixMyStreet::Map::os_to_tile($easting)); $input{y} = int(FixMyStreet::Map::os_to_tile($northing)); @@ -794,12 +795,12 @@ sub display_location { return front_page($q, @errors) unless $x || $y || $input{pc}; if (!$x && !$y) { try { - ($x, $y, $easting, $northing, $error) = Page::geocode($input{pc}, $q); + ($x, $y, $easting, $northing, $error) = FixMyStreet::Geocode::lookup($input{pc}, $q); } catch Error::Simple with { $error = shift; }; } - return Page::geocode_choice($error, '/', $q) if (ref($error) eq 'ARRAY'); + return FixMyStreet::Geocode::list_choices($error, '/', $q) if (ref($error) eq 'ARRAY'); return front_page($q, $error) if ($error); if (!$easting || !$northing) { diff --git a/web/rss.cgi b/web/rss.cgi index effa15f08..623314e7f 100755 --- a/web/rss.cgi +++ b/web/rss.cgi @@ -13,6 +13,7 @@ use Error qw(:try); use Standard; use URI::Escape; use FixMyStreet::Alert; +use FixMyStreet::Geocode; use mySociety::MaPit; use mySociety::GeoUtil; use mySociety::Gaze; @@ -93,7 +94,7 @@ sub rss_local_problems { } elsif ($pc) { my $error; try { - ($x, $y, $e, $n, $error) = Page::geocode($pc, $q); + ($x, $y, $e, $n, $error) = FixMyStreet::Geocode::lookup($pc, $q); } catch Error::Simple with { $error = shift; }; |