aboutsummaryrefslogtreecommitdiffstats
path: root/web/questionnaire.cgi
diff options
context:
space:
mode:
authormatthew <matthew>2007-05-09 16:54:48 +0000
committermatthew <matthew>2007-05-09 16:54:48 +0000
commitd6cfe54df9ffc7244487247a2ba7fb455f8e2ba8 (patch)
tree60af13c1469a90258ba129d18450365a5282418e /web/questionnaire.cgi
parentf4109f49d5bae73bf40e975300aa322db9a98c2d (diff)
Record old/new state of problem in questionnaire table, to have information
to hand. Should have done this in the first place, sigh.
Diffstat (limited to 'web/questionnaire.cgi')
-rwxr-xr-xweb/questionnaire.cgi6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/questionnaire.cgi b/web/questionnaire.cgi
index 910c87f87..bb2441aad 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.5 2007-05-09 16:30:36 matthew Exp $
+# $Id: questionnaire.cgi,v 1.6 2007-05-09 16:54:48 matthew Exp $
use strict;
require 5.8.0;
@@ -114,7 +114,9 @@ sub submit_questionnaire {
my $reported = $input{reported} eq 'Yes' ? 't' :
($input{reported} eq 'No' ? 'f' : undef);
dbh()->do('update questionnaire set whenanswered=ms_current_timestamp(),
- ever_reported=? where id=?', {}, $reported, $questionnaire->{id});
+ ever_reported=?, old_state=?, new_state=? where id=?', {},
+ $reported, $problem->{state}, $new_state ? $new_state : $problem->{state},
+ $questionnaire->{id});
# Record an update if they've given one, or if there's a state change
my $name = $problem->{anonymous} ? undef : $problem->{name};