aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Around.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm33
1 files changed, 16 insertions, 17 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index 5bfe1ada2..723684793 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -41,7 +41,7 @@ sub around_index : Path : Args(0) {
my $ret = $c->forward('/location/determine_location_from_coords')
|| $c->forward('/location/determine_location_from_pc');
unless ($ret) {
- return $c->res->redirect('/') unless $c->req->param('pc') || $partial_report;
+ return $c->res->redirect('/') unless $c->get_param('pc') || $partial_report;
return;
}
@@ -78,13 +78,12 @@ Handle coord systems that are no longer in use.
sub redirect_en_or_xy_to_latlon : Private {
my ( $self, $c ) = @_;
- my $req = $c->req;
# check for x,y or e,n requests
- my $x = $req->param('x');
- my $y = $req->param('y');
- my $e = $req->param('e');
- my $n = $req->param('n');
+ my $x = $c->get_param('x');
+ my $y = $c->get_param('y');
+ my $e = $c->get_param('e');
+ my $n = $c->get_param('n');
# lat and lon - fill in below if we need to
my ( $lat, $lon );
@@ -118,7 +117,7 @@ token to stash and return report. Otherwise return false.
sub load_partial : Private {
my ( $self, $c ) = @_;
- my $partial = scalar $c->req->param('partial')
+ my $partial = $c->get_param('partial')
|| return;
# is it in the database
@@ -161,7 +160,7 @@ sub display_location : Private {
my $longitude = $c->stash->{longitude};
# Deal with pin hiding/age
- my $all_pins = $c->req->param('all_pins') ? 1 : undef;
+ my $all_pins = $c->get_param('all_pins') ? 1 : undef;
$c->stash->{all_pins} = $all_pins;
my $interval = $all_pins ? undef : $c->cobrand->on_map_default_max_pin_age;
@@ -182,7 +181,7 @@ sub display_location : Private {
# create a list of all the pins
my @pins;
- unless ($c->req->param('no_pins') || $c->cobrand->moniker eq 'emptyhomes') {
+ unless ($c->get_param('no_pins') || $c->cobrand->moniker eq 'emptyhomes') {
@pins = map {
# Here we might have a DB::Problem or a DB::Nearby, we always want the problem.
my $p = (ref $_ eq 'FixMyStreet::App::Model::DB::Nearby') ? $_->problem : $_;
@@ -258,7 +257,7 @@ sub check_and_stash_category : Private {
$c->stash->{filter_categories} = \@categories;
- my $category = $c->req->param('filter_category');
+ my $category = $c->get_param('filter_category');
my %categories_mapped = map { $_ => 1 } @categories;
if ( defined $category && $categories_mapped{$category} ) {
$c->stash->{filter_category} = $category;
@@ -278,7 +277,7 @@ sub ajax : Path('/ajax') {
$c->res->content_type('application/json; charset=utf-8');
- unless ( $c->req->param('bbox') ) {
+ unless ( $c->get_param('bbox') ) {
$c->res->status(404);
$c->res->body('');
return;
@@ -288,7 +287,7 @@ sub ajax : Path('/ajax') {
$c->res->header( 'Cache_Control' => 'max-age=0' );
# how far back should we go?
- my $all_pins = $c->req->param('all_pins') ? 1 : undef;
+ my $all_pins = $c->get_param('all_pins') ? 1 : undef;
my $interval = $all_pins ? undef : $c->cobrand->on_map_default_max_pin_age;
# Need to be the class that can handle it
@@ -320,7 +319,7 @@ sub ajax : Path('/ajax') {
sub location_autocomplete : Path('/ajax/geocode') {
my ( $self, $c ) = @_;
$c->res->content_type('application/json; charset=utf-8');
- unless ( $c->req->param('term') ) {
+ unless ( $c->get_param('term') ) {
$c->res->status(404);
$c->res->body('');
return;
@@ -328,26 +327,26 @@ sub location_autocomplete : Path('/ajax/geocode') {
# we want the match even if there's no ambiguity, so recommendation doesn't
# disappear when it's the last choice being offered in the autocomplete.
$c->stash->{allow_single_geocode_match_strings} = 1;
- return $self->_geocode( $c, $c->req->param('term') );
+ return $self->_geocode( $c, $c->get_param('term') );
}
sub location_lookup : Path('/ajax/lookup_location') {
my ( $self, $c ) = @_;
$c->res->content_type('application/json; charset=utf-8');
- unless ( $c->req->param('term') ) {
+ unless ( $c->get_param('term') ) {
$c->res->status(404);
$c->res->body('');
return;
}
- return $self->_geocode( $c, $c->req->param('term') );
+ return $self->_geocode( $c, $c->get_param('term') );
}
sub _geocode : Private {
my ( $self, $c, $term ) = @_;
my ( $lat, $long, $suggestions ) =
- FixMyStreet::Geocode::lookup( $c->req->param('term'), $c );
+ FixMyStreet::Geocode::lookup( $c->get_param('term'), $c );
my ($response, @addresses, @locations);