diff options
author | Chris Mytton <self@hecticjeff.net> | 2013-09-09 11:28:47 +0100 |
---|---|---|
committer | Chris Mytton <self@hecticjeff.net> | 2013-09-09 15:41:11 +0100 |
commit | bdc37865f7826e76523a478219ea5abab918593a (patch) | |
tree | bb4734d19b3d3b6a4793fee77f79f4bf4949f9b3 | |
parent | 7cef43f24a00b174a4f777df4fcff939950e7878 (diff) |
[Zurich] Add external body name to admin csv export
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 602b4281b..502748c90 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -596,17 +596,25 @@ sub admin_stats { {%params}, { columns => [ - 'id', 'created', 'latitude', 'longitude', - 'cobrand', 'category', 'state', 'user_id' + 'id', 'created', + 'latitude', 'longitude', + 'cobrand', 'category', + 'state', 'user_id', + 'external_body' ] } ); - my $body = "ID,Created,E,N,Category,Status,UserID\n"; + my $body = "ID,Created,E,N,Category,Status,UserID,External Body\n"; while ( my $report = $problems->next ) { + my $external_body; + my $body_name = ""; + if ( $external_body = $report->body($c) ) { + $body_name = $external_body->name; + } $body .= join( ',', - $report->id, $report->created, + $report->id, $report->created, $report->local_coords, $report->category, - $report->state, $report->user_id ) + $report->state, $report->user_id, $body_name ) . "\n"; } $c->res->content_type('text/csv; charset=utf-8'); |