diff options
Diffstat (limited to 'web')
-rwxr-xr-x | web/alert.cgi | 9 | ||||
-rwxr-xr-x | web/confirm.cgi | 6 | ||||
-rwxr-xr-x | web/contact.cgi | 7 | ||||
-rw-r--r-- | web/posters/.cvsignore | 1 | ||||
-rwxr-xr-x | web/questionnaire.cgi | 19 |
5 files changed, 32 insertions, 10 deletions
diff --git a/web/alert.cgi b/web/alert.cgi index d482d3513..daa94d8c2 100755 --- a/web/alert.cgi +++ b/web/alert.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: alert.cgi,v 1.7 2007-06-15 14:57:52 matthew Exp $ +# $Id: alert.cgi,v 1.8 2007-07-09 17:40:29 matthew Exp $ use strict; require 5.8.0; @@ -17,6 +17,7 @@ use lib "$FindBin::Bin/../perllib"; use lib "$FindBin::Bin/../../perllib"; use Digest::SHA1 qw(sha1_hex); +use CrossSell; use Page; use mySociety::Alert; use mySociety::AuthToken; @@ -48,6 +49,7 @@ sub main { my $alert_id = mySociety::Alert::create($email, 'new_updates', $id); mySociety::Alert::confirm($alert_id); $out .= $q->p(_('You have successfully subscribed to that alert.')); + $out .= CrossSell::display_advert($email); } else { $out = $q->p(_('We could not validate that alert.')); } @@ -55,12 +57,15 @@ sub main { my $data = mySociety::AuthToken::retrieve('alert', $token); if (my $id = $data->{id}) { my $type = $data->{type}; + my $email = $data->{email}; if ($type eq 'subscribe') { mySociety::Alert::confirm($id); $out = $q->p(_('You have successfully confirmed your alert.')); + $out .= CrossSell::display_advert($email); } elsif ($type eq 'unsubscribe') { mySociety::Alert::delete($id); $out = $q->p(_('You have successfully deleted your alert.')); + $out .= CrossSell::display_advert($email); } } else { $out = $q->p(_(<<EOF)); @@ -87,7 +92,7 @@ EOF } my %h = (); $h{url} = mySociety::Config::get('BASE_URL') . '/A/' - . mySociety::AuthToken::store('alert', { id => $alert_id, type => 'subscribe' } ); + . mySociety::AuthToken::store('alert', { id => $alert_id, type => 'subscribe', email => $email } ); dbh()->commit(); $out = Page::send_email($email, undef, 'alert', %h); } diff --git a/web/confirm.cgi b/web/confirm.cgi index afc7577f3..da7a6d07f 100755 --- a/web/confirm.cgi +++ b/web/confirm.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: confirm.cgi,v 1.24 2007-06-22 14:24:47 matthew Exp $ +# $Id: confirm.cgi,v 1.25 2007-07-09 17:40:29 matthew Exp $ use strict; require 5.8.0; @@ -17,6 +17,7 @@ use lib "$FindBin::Bin/../perllib"; use lib "$FindBin::Bin/../../perllib"; use Digest::SHA1 qw(sha1_hex); +use CrossSell; use Page; use mySociety::AuthToken; use mySociety::Config; @@ -149,7 +150,7 @@ EOF sub add_questionnaire { my ($q, $id, $token) = @_; - my $problem_id = dbh()->selectrow_array("select problem_id from comment where id=?", {}, $id); + my ($problem_id, $email, $name) = dbh()->selectrow_array("select problem_id, email, name from comment where id=?", {}, $id); my $reported = $q->param('reported'); $reported = $reported eq 'Yes' ? 't' : ($reported eq 'No' ? 'f' : undef); return ask_questionnaire($token) unless $reported; @@ -161,6 +162,7 @@ sub add_questionnaire { ms_current_timestamp(), ?, 'confirmed', 'fixed');", {}, $problem_id, $reported) unless $already; my $out = $q->p(sprintf('Thank you — you can <a href="%s">view your updated problem</a> on the site.', "/?id=$problem_id")); + $out .= CrossSell::display_advert($email, $name); return $out; } diff --git a/web/contact.cgi b/web/contact.cgi index eaaadcf91..f76f583a1 100755 --- a/web/contact.cgi +++ b/web/contact.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: contact.cgi,v 1.20 2007-06-15 14:57:52 matthew Exp $ +# $Id: contact.cgi,v 1.21 2007-07-09 17:40:29 matthew Exp $ use strict; require 5.8.0; @@ -15,6 +15,7 @@ require 5.8.0; use FindBin; use lib "$FindBin::Bin/../perllib"; use lib "$FindBin::Bin/../../perllib"; +use CrossSell; use Page; use mySociety::Config; use mySociety::DBHandle qw(dbh); @@ -83,7 +84,9 @@ sub contact_submit { }); my $result = mySociety::Util::send_email($email, $input{email}, mySociety::Config::get('CONTACT_EMAIL')); if ($result == mySociety::Util::EMAIL_SUCCESS) { - return $q->p("Thanks for your feedback. We'll get back to you as soon as we can!"); + my $out = $q->p("Thanks for your feedback. We'll get back to you as soon as we can!"); + $out .= CrossSell::display_advert($input{email}, $input{name}); + return $out; } else { return $q->p('Failed to send message. Please try again, or <a href="mailto:' . mySociety::Config::get('CONTACT_EMAIL') . '">email us</a>.'); } diff --git a/web/posters/.cvsignore b/web/posters/.cvsignore new file mode 100644 index 000000000..714f73c54 --- /dev/null +++ b/web/posters/.cvsignore @@ -0,0 +1 @@ +_Inline diff --git a/web/questionnaire.cgi b/web/questionnaire.cgi index c0dbb6dda..45b9d1611 100755 --- a/web/questionnaire.cgi +++ b/web/questionnaire.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: questionnaire.cgi,v 1.12 2007-06-22 14:20:45 matthew Exp $ +# $Id: questionnaire.cgi,v 1.13 2007-07-09 17:40:29 matthew Exp $ use strict; require 5.8.0; @@ -17,6 +17,7 @@ use lib "$FindBin::Bin/../perllib"; use lib "$FindBin::Bin/../../perllib"; use Error qw(:try); +use CrossSell; use Page; use mySociety::AuthToken; use mySociety::Config; @@ -134,10 +135,20 @@ sub submit_questionnaire { if $input{been_fixed} eq 'No' && $input{another} eq 'Yes'; dbh()->commit(); - return <<EOF; -<p>Thank you very much for filling in our questionnaire. -<a href="/?id=$problem->{id}">View your report on the site</a></p> + if ($new_state eq 'confirmed' || (!$new_state && $problem->{state} eq 'confirmed')) { + return <<EOF; +<p style="font-size:200%">We're sorry to hear that. We have two suggestions: why not try +<a href="http://www.writetothem.com/">writing direct to your councillor(s)</a> +or, if it's a problem that could be fixed by lcaol people working together +why not <a href="http://www.pledgebank.com/new">make and publicise a pledge</a>? +</p> +EOF + } else { + my $out = <<EOF; +<p>Thank you very much for filling in our questionnaire; glad to hear it's been fixed.</p> EOF + $out .= CrossSell::display_advert($problem->{email}, $problem->{name}); + } } sub display_questionnaire { |