diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 12 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/My.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 2 |
5 files changed, 15 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 0e87d1e70..4c5c36106 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -295,7 +295,7 @@ sub map_features : Private { @pins = map { # Here we might have a DB::Problem or a DB::Result::Nearby, we always want the problem. my $p = (ref $_ eq 'FixMyStreet::DB::Result::Nearby') ? $_->problem : $_; - $p->pin_data($c, 'around'); + $p->pin_data('around'); } @$on_map, @$nearby; } diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index f7273ca0e..6fd4154b9 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -339,8 +339,9 @@ sub export_as_csv_updates : Private { 'text', 'user_name_display', 'reported_as', ], filename => $self->csv_filename($c, 1), + user => $c->user_exists ? $c->user->obj : undef, }; - $c->cobrand->call_hook("dashboard_export_updates_add_columns"); + $c->cobrand->call_hook(dashboard_export_updates_add_columns => $csv); $c->forward('generate_csv'); } @@ -407,8 +408,11 @@ sub export_as_csv : Private { 'reported_as', ], filename => $self->csv_filename($c, 0), + user => $c->user_exists ? $c->user->obj : undef, + category => $c->stash->{category}, + contacts => $c->stash->{contacts}, }; - $c->cobrand->call_hook("dashboard_export_problems_add_columns"); + $c->cobrand->call_hook(dashboard_export_problems_add_columns => $csv); $c->forward('generate_csv'); } @@ -460,7 +464,7 @@ sub generate_csv : Private { my $objects = $c->stash->{csv}->{objects}; while ( my $obj = $objects->next ) { - my $hashref = $obj->as_hashref($c, \%asked_for); + my $hashref = $obj->as_hashref(\%asked_for); $hashref->{user_name_display} = $obj->anonymous ? '(anonymous)' : $obj->name; @@ -554,7 +558,7 @@ sub heatmap : Local : Args(0) { if ($c->get_param('ajax')) { my @pins; while ( my $problem = $problems->next ) { - push @pins, $problem->pin_data($c, 'reports'); + push @pins, $problem->pin_data('reports'); } $c->stash->{pins} = \@pins; $c->detach('/reports/ajax', [ 'dashboard/heatmap-list.html' ]); diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm index f5c06d926..9d57c5e1d 100644 --- a/perllib/FixMyStreet/App/Controller/My.pm +++ b/perllib/FixMyStreet/App/Controller/My.pm @@ -157,7 +157,7 @@ sub get_problems : Private { while ( my $problem = $rs->next ) { $c->stash->{has_content}++; - push @$pins, $problem->pin_data($c, 'my', private => 1); + push @$pins, $problem->pin_data('my', private => 1); push @$problems, $problem; } diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index 991064f55..81d5b18b5 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -325,7 +325,7 @@ sub format_problem_for_display : Private { $c->res->content_type('application/json; charset=utf-8'); # encode_json doesn't like DateTime objects, so strip them out - my $report_hashref = $c->cobrand->problem_as_hashref( $problem, $c ); + my $report_hashref = $c->cobrand->problem_as_hashref( $problem ); delete $report_hashref->{created}; delete $report_hashref->{confirmed}; @@ -333,7 +333,7 @@ sub format_problem_for_display : Private { my $content = $json->encode( { report => $report_hashref, - updates => $c->cobrand->updates_as_hashref( $problem, $c ), + updates => $c->cobrand->updates_as_hashref( $problem ), } ); $c->res->body( $content ); @@ -354,7 +354,7 @@ sub generate_map_tags : Private { latitude => $problem->latitude, longitude => $problem->longitude, pins => $problem->used_map - ? [ $problem->pin_data($c, 'report', type => 'big', draggable => 1) ] + ? [ $problem->pin_data('report', type => 'big', draggable => 1) ] : [], ); @@ -670,7 +670,7 @@ sub _nearby_json :Private { # Want to treat these as if they were on map $nearby = [ map { $_->problem } @$nearby ]; my @pins = map { - my $p = $_->pin_data($c, 'around'); + my $p = $_->pin_data('around'); [ $p->{latitude}, $p->{longitude}, $p->{colour}, $p->{id}, $p->{title}, $pin_size, JSON->false ] diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 10902eab9..d0f2a9394 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -826,7 +826,7 @@ sub stash_report_sort : Private { sub add_row { my ( $c, $problem, $body, $problems, $pins ) = @_; push @{$problems->{$body}}, $problem; - push @$pins, $problem->pin_data($c, 'reports'); + push @$pins, $problem->pin_data('reports'); } sub ajax : Private { |