diff options
author | Dave Arter <davea@mysociety.org> | 2015-11-18 16:25:20 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2015-11-18 16:25:20 +0000 |
commit | 1432298c0d65d7481f4c7054b8d8780e95f58ba8 (patch) | |
tree | 959e1f13d78cd0712be186c47fe398ce182fb376 /perllib | |
parent | 8fad976f9b12cc36e317d01aee3cd4b20270f512 (diff) |
[Zurich] Include problem extra fields in CSV download
Some categories ask the user for extra information such as street or house
number; these are output in the CSV if the report includes them.
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index bda5310fc..1376f1e45 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -1134,7 +1134,11 @@ sub admin_stats { 'Detail', 'Media URL', 'Interface Used', - 'Council Response' + 'Council Response', + 'Strasse', + 'Mast-Nr.', + 'Haus-Nr.', + 'Hydranten-Nr.', ); my $body = ""; @@ -1157,6 +1161,11 @@ sub admin_stats { my $detail = $report->detail; my $public_response = $report->get_extra_metadata('public_response') || ''; + my $metas = $report->get_extra_fields(); + my %extras; + foreach my $field (@$metas) { + $extras{$field->{name}} = $field->{value}; + } # replace newlines with HTML <br/> element $detail =~ s{\r?\n}{ <br/> }g; @@ -1181,6 +1190,10 @@ sub admin_stats { $media_url, $report->service || 'Web interface', $public_response, + $extras{'strasse'} || '', + $extras{'mast_nr'} || '', + $extras{'haus_nr'} || '', + $extras{'hydranten_nr'} || '' ); if ($csv->combine(@columns)) { $body .= $csv->string . "\n"; |