diff options
author | matthew <matthew> | 2009-01-22 10:12:40 +0000 |
---|---|---|
committer | matthew <matthew> | 2009-01-22 10:12:40 +0000 |
commit | 8c8cca7d6d36f6aff2ceedb233dcd2cd3c2e0e02 (patch) | |
tree | d2951902cddd1fcb1d533164885f0bc8298380b4 /web-admin | |
parent | cc559ffc165f3748f018ec6ba179f8c4edb17c7e (diff) |
Add text only link for ease of email replying.
Diffstat (limited to 'web-admin')
-rwxr-xr-x | web-admin/index.cgi | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/web-admin/index.cgi b/web-admin/index.cgi index 9d3318cb7..df58a4743 100755 --- a/web-admin/index.cgi +++ b/web-admin/index.cgi @@ -7,10 +7,10 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: index.cgi,v 1.64 2008-11-17 18:38:31 matthew Exp $ +# $Id: index.cgi,v 1.65 2009-01-22 10:12:40 matthew Exp $ # -my $rcsid = ''; $rcsid .= '$Id: index.cgi,v 1.64 2008-11-17 18:38:31 matthew Exp $'; +my $rcsid = ''; $rcsid .= '$Id: index.cgi,v 1.65 2009-01-22 10:12:40 matthew Exp $'; use strict; @@ -252,12 +252,22 @@ sub admin_council_contacts ($$) { $updated = $q->p($q->em("Values updated")); dbh()->commit(); } - $q->delete_all(); # No need for state! my $bci_data = select_all("select * from contacts where area_id = ? order by category", $area_id); - my $mapit_data = mySociety::MaPit::get_voting_area_info($area_id); + + if ($q->param('text')) { + print $q->header(-type => 'text/plain', -charset => 'utf-8'); + foreach my $l (@$bci_data) { + next if $l->{deleted} || !$l->{confirmed}; + print $l->{category} . "\t" . $l->{email} . "\n"; + } + return; + } + + $q->delete_all(); # No need for state! # Title + my $mapit_data = mySociety::MaPit::get_voting_area_info($area_id); my $title = 'Council contacts for ' . $mapit_data->{name}; print html_head($q, $title); print $q->h1($title); @@ -272,6 +282,8 @@ sub admin_council_contacts ($$) { } $links_html .= ' ' . $q->a({ href => mySociety::Config::get('BASE_URL') . "/reports?council=" . $area_id }, " List all reported problems"); + $links_html .= ' ' . + $q->a({ href => NewURL($q, area_id => $area_id, page => 'councilcontacts', text => 1) }, 'Text only version'); print $q->p($links_html); # Display of addresses / update statuses form @@ -688,7 +700,7 @@ sub admin_timeline { print "Questionnaire $_->{id} answered for problem $_->{problem_id}, $_->{old_state} to $_->{new_state}"; } elsif ($type eq 'update') { my $url = mySociety::Config::get('BASE_URL') . "/report/$_->{problem_id}#$_->{id}"; - my $name = $_->{name} || 'anonymous'; + my $name = $_->{name} || 'anonymous'; print "Update <a href='$url'>$_->{id}</a> created for problem $_->{problem_id}; by $name <$_->{email}>"; } elsif ($type eq 'alertSub') { my $param = $_->{parameter} || ''; |