diff options
author | Chris Mytton <self@hecticjeff.net> | 2013-09-11 14:50:49 +0100 |
---|---|---|
committer | Chris Mytton <self@hecticjeff.net> | 2013-09-11 14:50:49 +0100 |
commit | 7fffbf2e562d9ede840c09f70e5495ac79890e4b (patch) | |
tree | e2e1be45004b0291360896133614aab010708366 | |
parent | df38951bce57fddf5d4de658b239191f912d5973 (diff) | |
parent | 3644d6fce8d8e4a6f8aa2e8c5ec37faaa5cb8193 (diff) |
Merge branch 'zurich-extra-csv-columns'
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 29 | ||||
-rw-r--r-- | templates/web/zurich/admin/reports.html | 1 |
2 files changed, 26 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index ffdc1feab..d39c804ad 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -592,10 +592,31 @@ sub admin_stats { ); if ( $c->req->params->{export} ) { - my $problems = $c->model('DB::Problem')->search( { %params }, { columns => [ 'id', 'created', 'latitude', 'longitude', 'cobrand', 'category' ] } ); - my $body = "ID,Created,E,N,Category\n"; - while (my $report = $problems->next) { - $body .= join( ',', $report->id, $report->created, $report->local_coords, $report->category ) . "\n"; + my $problems = $c->model('DB::Problem')->search( + {%params}, + { + columns => [ + 'id', 'created', + 'latitude', 'longitude', + 'cobrand', 'category', + 'state', 'user_id', + 'external_body' + ] + } + ); + 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->local_coords, $report->category, + $report->state, $report->user_id, + "\"$body_name\"" ) + . "\n"; } $c->res->content_type('text/csv; charset=utf-8'); $c->res->body($body); diff --git a/templates/web/zurich/admin/reports.html b/templates/web/zurich/admin/reports.html index b0bc733c4..68f98c44a 100644 --- a/templates/web/zurich/admin/reports.html +++ b/templates/web/zurich/admin/reports.html @@ -13,6 +13,7 @@ [% FOREACH col IN [ [ 'category', loc('Category') ], [ 'created', loc('Submitted') ], [ 'lastupdate', loc('Updated') ], [ 'state', loc('Status') ] ] %] <th><a href="[% INCLUDE sort_link choice = col.0 %]">[% col.1 %] [% INCLUDE sort_arrow choice = col.0 %]</a></th> [% END %] + <th>[% loc('Photo') %]</th> <th class='edit'>*</th> </tr> [% INCLUDE 'admin/problem_row.html' %] |