- use Date::Manip to set timestamps

This commit is contained in:
ccooper%deadsquid.com 2005-10-15 01:09:42 +00:00
Родитель 6a22ca291f
Коммит 1950d49f33
2 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -38,7 +38,7 @@ use Litmus::Auth;
use Litmus::Utils; use Litmus::Utils;
use CGI; use CGI;
use Time::Piece::MySQL; use Date::Manip;
use diagnostics; use diagnostics;
use Data::Dumper; use Data::Dumper;
@ -130,7 +130,7 @@ foreach my $curtestid (@tests) {
my $note = $c->param("testnote_".$curtestid); my $note = $c->param("testnote_".$curtestid);
my $time = localtime; my $time = &Date::Manip::UnixDate("now","%q");
# normally, the user comes with a cookie, but for simpletest # normally, the user comes with a cookie, but for simpletest
# users, we just use the web-user@mozilla.org user: # users, we just use the web-user@mozilla.org user:

Просмотреть файл

@ -36,14 +36,18 @@ use Litmus::Auth;
use Litmus::Error; use Litmus::Error;
use Litmus::DB::Testresult; use Litmus::DB::Testresult;
use Litmus::DB::Resultbug; use Litmus::DB::Resultbug;
use CGI; use CGI;
use Date::Manip;
my $c = new CGI; my $c = new CGI;
print $c->header(); print $c->header();
if ($c->param && $c->param('id')) { if ($c->param && $c->param('id')) {
my $time = localtime; my $result = Litmus::DB::Testresult->retrieve($c->param('id'));
my $time = &Date::Manip::UnixDate("now","%q");
my $cookie = Litmus::Auth::getCookie(); my $cookie = Litmus::Auth::getCookie();
my $user; my $user;
if ($cookie) { if ($cookie) {
@ -57,7 +61,7 @@ if ($c->param && $c->param('id')) {
if (!Litmus::DB::Resultbug->search(test_result_id =>$c->param('id'), if (!Litmus::DB::Resultbug->search(test_result_id =>$c->param('id'),
bug_id => $new_bug)) { bug_id => $new_bug)) {
my $bug = Litmus::DB::Resultbug->create({ my $bug = Litmus::DB::Resultbug->create({
test_result_id => $c->param('id'), testresult => $result,
last_updated => $time, last_updated => $time,
submission_time => $time, submission_time => $time,
user => $user, user => $user,
@ -71,7 +75,7 @@ if ($c->param && $c->param('id')) {
$c->param('new_comment') and $c->param('new_comment') and
$c->param('new_comment') ne '') { $c->param('new_comment') ne '') {
my $comment = Litmus::DB::Comment->create({ my $comment = Litmus::DB::Comment->create({
test_result_id => $c->param('id'), testresult => $result,
last_updated => $time, last_updated => $time,
submission_time => $time, submission_time => $time,
user => $user, user => $user,
@ -79,8 +83,6 @@ if ($c->param && $c->param('id')) {
}); });
} }
} }
my $result = Litmus::DB::Testresult->retrieve($c->param('id'));
my $title = 'Test Result #' . $c->param('id') . ' - Details'; my $title = 'Test Result #' . $c->param('id') . ' - Details';
my $vars = { my $vars = {