diff options
author | matthew <matthew> | 2007-05-15 13:43:20 +0000 |
---|---|---|
committer | matthew <matthew> | 2007-05-15 13:43:20 +0000 |
commit | fbe6dff68a4c5ed8f1c00646a01bf1cbc8fab95b (patch) | |
tree | ae28a137b37b6cfdbcb88c554fd23132da0bf4a4 /web/report.cgi | |
parent | 25851744776d0d78cc3347d5769a4999fcebe0f9 (diff) |
If someone leaves an update on a problem, count that as "refreshing" the
problem. Rename db field to lastupdate to make this all clearer. Tidy up
some code.
Diffstat (limited to 'web/report.cgi')
-rwxr-xr-x | web/report.cgi | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/web/report.cgi b/web/report.cgi index 8189573a5..462e16081 100755 --- a/web/report.cgi +++ b/web/report.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: report.cgi,v 1.28 2007-05-14 21:32:32 matthew Exp $ +# $Id: report.cgi,v 1.29 2007-05-15 13:43:21 matthew Exp $ use strict; require 5.8.0; @@ -47,9 +47,9 @@ sub main { } my (%fixed, %open, %councils); my $problem = select_all( - "select id, title, detail, council, state, laststatechange, whensent, - extract(epoch from ms_current_timestamp()-laststatechange) as duration, - extract(epoch from laststatechange-confirmed) as laststateage + "select id, title, detail, council, state, + extract(epoch from ms_current_timestamp()-lastupdate) as duration, + extract(epoch from lastupdate-confirmed) as timetolastupdate from problem where state in ('confirmed', 'fixed') and whensent is not null @@ -62,7 +62,7 @@ sub main { my @council = split /,/, $council; my $type = ($row->{duration} > 2 * $fourweeks) ? 'unknown' - : ($row->{laststateage} > $fourweeks ? 'ongoing' : 'new'); + : ($row->{timetolastupdate} > $fourweeks ? 'ongoing' : 'new'); my $duration = ($row->{duration} > 2 * $fourweeks) ? 'old' : 'new'; foreach (@council) { next if $one_council && $_ != $one_council; |