diff options
author | travis%sedsystems.ca <> | 2005-02-09 01:51:02 +0100 |
---|---|---|
committer | travis%sedsystems.ca <> | 2005-02-09 01:51:02 +0100 |
commit | f8aeecaf8cd33d87315c5a50be9a762e142062a4 (patch) | |
tree | c92dc215a4f6780005bacf825fb6fbdc39552ae1 /CGI.pl | |
parent | c0df359943e8b746f02f5c43d25e5ffea99f8d19 (diff) | |
download | bugzilla-f8aeecaf8cd33d87315c5a50be9a762e142062a4.tar.gz bugzilla-f8aeecaf8cd33d87315c5a50be9a762e142062a4.tar.xz |
Bug 257315 : type of delta_ts in bugs table should not be timestamp
Patch by Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, LpSolit a=justdave
Diffstat (limited to 'CGI.pl')
-rw-r--r-- | CGI.pl | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -246,32 +246,34 @@ sub CheckIfVotedConfirmed { my ($id, $who) = (@_); PushGlobalSQLState(); SendSQL("SELECT bugs.votes, bugs.bug_status, products.votestoconfirm, " . - " bugs.everconfirmed " . + " bugs.everconfirmed, NOW() " . "FROM bugs, products " . "WHERE bugs.bug_id = $id AND products.id = bugs.product_id"); - my ($votes, $status, $votestoconfirm, $everconfirmed) = (FetchSQLData()); + my ($votes, $status, $votestoconfirm, $everconfirmed, $timestamp) = (FetchSQLData()); + my $sql_timestamp = SqlQuote($timestamp); my $ret = 0; if ($votes >= $votestoconfirm && $status eq 'UNCONFIRMED') { - SendSQL("UPDATE bugs SET bug_status = 'NEW', everconfirmed = 1 " . - "WHERE bug_id = $id"); + SendSQL("UPDATE bugs SET bug_status = 'NEW', everconfirmed = 1, " . + "delta_ts = $sql_timestamp WHERE bug_id = $id"); my $fieldid = GetFieldID("bug_status"); SendSQL("INSERT INTO bugs_activity " . - "(bug_id,who,bug_when,fieldid,removed,added) VALUES " . - "($id,$who,now(),$fieldid,'UNCONFIRMED','NEW')"); + "(bug_id, who, bug_when, fieldid, removed, added) VALUES " . + "($id, $who, $sql_timestamp, $fieldid, 'UNCONFIRMED', 'NEW')"); if (!$everconfirmed) { $fieldid = GetFieldID("everconfirmed"); SendSQL("INSERT INTO bugs_activity " . - "(bug_id,who,bug_when,fieldid,removed,added) VALUES " . - "($id,$who,now(),$fieldid,'0','1')"); + "(bug_id, who, bug_when, fieldid, removed, added) VALUES " . + "($id, $who, $sql_timestamp, $fieldid, '0', '1')"); } - + AppendComment($id, DBID_to_name($who), - "*** This bug has been confirmed by popular vote. ***", 0); - + "*** This bug has been confirmed by popular vote. ***", + 0, $timestamp); + $vars->{'type'} = "votes"; $vars->{'id'} = $id; $vars->{'mailrecipients'} = { 'changer' => $who }; - + $template->process("bug/process/results.html.tmpl", $vars) || ThrowTemplateError($template->error()); $ret = 1; |