зеркало из https://github.com/mozilla/pjs.git
Remove tabs.
This commit is contained in:
Родитель
aca7360746
Коммит
c7c1cedaaf
|
@ -61,16 +61,16 @@ Litmus::DB::Testresult->autoinflate(dates => 'Time::Piece');
|
|||
# for historical reasons, note() is a shorthand way of saying "the text of the first
|
||||
# comment on this result if that comment was submitted by the result submitter"
|
||||
sub note {
|
||||
my $self = shift;
|
||||
|
||||
my @comments = $self->comments();
|
||||
|
||||
if (@comments && $comments[0] &&
|
||||
$comments[0]->user() == $self->user()) {
|
||||
return $comments[0]->comment();
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
my $self = shift;
|
||||
|
||||
my @comments = $self->comments();
|
||||
|
||||
if (@comments && $comments[0] &&
|
||||
$comments[0]->user() == $self->user()) {
|
||||
return $comments[0]->comment();
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
# is this test result recent?
|
||||
|
|
|
@ -23,9 +23,9 @@ Litmus::DBI->set_db('Main',
|
|||
# Litmus::DBI's subclasses to set column aliases with the column_alias() sub.
|
||||
# Takes the database column name and the alias name.
|
||||
sub column_alias {
|
||||
my ($self, $db_name, $alias_name) = @_;
|
||||
|
||||
$column_aliases{$alias_name} = $db_name;
|
||||
my ($self, $db_name, $alias_name) = @_;
|
||||
|
||||
$column_aliases{$alias_name} = $db_name;
|
||||
}
|
||||
|
||||
# here's where the actual work happens. We consult our alias list
|
||||
|
@ -33,32 +33,32 @@ sub column_alias {
|
|||
# database column if we find a match
|
||||
memoize('find_column');
|
||||
sub find_column {
|
||||
my $self = shift;
|
||||
my $wanted = shift;
|
||||
|
||||
if (ref $self) {
|
||||
$wanted =~ s/^.*::(\w+)$/$1/;
|
||||
}
|
||||
if ($column_aliases{$wanted}) {
|
||||
return $column_aliases{$wanted};
|
||||
} else {
|
||||
# not an alias, so we use the normal
|
||||
# find_column() from Class::DBI
|
||||
$self->SUPER::find_column($wanted);
|
||||
}
|
||||
my $self = shift;
|
||||
my $wanted = shift;
|
||||
|
||||
if (ref $self) {
|
||||
$wanted =~ s/^.*::(\w+)$/$1/;
|
||||
}
|
||||
if ($column_aliases{$wanted}) {
|
||||
return $column_aliases{$wanted};
|
||||
} else {
|
||||
# not an alias, so we use the normal
|
||||
# find_column() from Class::DBI
|
||||
$self->SUPER::find_column($wanted);
|
||||
}
|
||||
}
|
||||
|
||||
sub AUTOLOAD {
|
||||
my $self = shift;
|
||||
my @args = @_;
|
||||
my $name = our $AUTOLOAD;
|
||||
|
||||
my $col = $self->find_column($name);
|
||||
if (!$col) {
|
||||
internalEror("tried to call Litmus::DBI method $name which does not exist");
|
||||
}
|
||||
|
||||
return $self->$col(@args);
|
||||
my $self = shift;
|
||||
my @args = @_;
|
||||
my $name = our $AUTOLOAD;
|
||||
|
||||
my $col = $self->find_column($name);
|
||||
if (!$col) {
|
||||
internalEror("tried to call Litmus::DBI method $name which does not exist");
|
||||
}
|
||||
|
||||
return $self->$col(@args);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
@ -151,9 +151,9 @@ sub create {
|
|||
|
||||
# anti-spam filtering of email addresses
|
||||
email => sub {
|
||||
my ($var) = @_;
|
||||
$var =~ s/\@/\@/g;
|
||||
return $var;
|
||||
my ($var) = @_;
|
||||
$var =~ s/\@/\@/g;
|
||||
return $var;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
@ -148,43 +148,43 @@ create table test_format_lookup (
|
|||
);
|
||||
|
||||
create table test_result_bugs (
|
||||
test_result_id int(11) not null auto_increment,
|
||||
last_updated datetime not null,
|
||||
submission_time datetime not null,
|
||||
user_id int(11),
|
||||
bug_id int(11),
|
||||
|
||||
PRIMARY KEY (test_result_id,bug_id),
|
||||
|
||||
INDEX(test_result_id),
|
||||
INDEX(last_updated),
|
||||
INDEX(submission_time),
|
||||
INDEX(user_id)
|
||||
test_result_id int(11) not null auto_increment,
|
||||
last_updated datetime not null,
|
||||
submission_time datetime not null,
|
||||
user_id int(11),
|
||||
bug_id int(11),
|
||||
|
||||
PRIMARY KEY (test_result_id,bug_id),
|
||||
|
||||
INDEX(test_result_id),
|
||||
INDEX(last_updated),
|
||||
INDEX(submission_time),
|
||||
INDEX(user_id)
|
||||
);
|
||||
|
||||
create table test_result_comments (
|
||||
comment_id int(11) not null primary key auto_increment,
|
||||
test_result_id int(11) not null,
|
||||
last_updated datetime not null,
|
||||
submission_time datetime not null,
|
||||
user_id int(11),
|
||||
comment text,
|
||||
|
||||
INDEX(test_result_id),
|
||||
INDEX(last_updated),
|
||||
INDEX(submission_time),
|
||||
INDEX(user_id)
|
||||
comment_id int(11) not null primary key auto_increment,
|
||||
test_result_id int(11) not null,
|
||||
last_updated datetime not null,
|
||||
submission_time datetime not null,
|
||||
user_id int(11),
|
||||
comment text,
|
||||
|
||||
INDEX(test_result_id),
|
||||
INDEX(last_updated),
|
||||
INDEX(submission_time),
|
||||
INDEX(user_id)
|
||||
);
|
||||
|
||||
create table test_result_logs (
|
||||
log_id int(11) not null primary key auto_increment,
|
||||
test_result_id int(11) not null,
|
||||
last_updated datetime not null,
|
||||
submission_time datetime not null,
|
||||
log_path varchar(255),
|
||||
|
||||
INDEX(test_result_id),
|
||||
INDEX(last_updated),
|
||||
INDEX(submission_time),
|
||||
INDEX(log_path)
|
||||
log_id int(11) not null primary key auto_increment,
|
||||
test_result_id int(11) not null,
|
||||
last_updated datetime not null,
|
||||
submission_time datetime not null,
|
||||
log_path varchar(255),
|
||||
|
||||
INDEX(test_result_id),
|
||||
INDEX(last_updated),
|
||||
INDEX(submission_time),
|
||||
INDEX(log_path)
|
||||
);
|
|
@ -141,10 +141,10 @@ foreach my $curtestid (@tests) {
|
|||
|
||||
# if there's a note, create an entry in the comments table for it
|
||||
Litmus::DB::Comment->create({
|
||||
testresult => $tr,
|
||||
submission_time => $time,
|
||||
user => $user,
|
||||
comment => $note
|
||||
testresult => $tr,
|
||||
submission_time => $time,
|
||||
user => $user,
|
||||
comment => $note
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ sub page_pickGroupSubgroup {
|
|||
|
||||
my $product = Litmus::DB::Product->retrieve($c->param("product"));
|
||||
if (! $product) {
|
||||
print $c->header();
|
||||
print $c->header();
|
||||
invalidInputError("Invalid product ".$c->param("product"));
|
||||
}
|
||||
|
||||
|
@ -85,8 +85,8 @@ sub page_pickGroupSubgroup {
|
|||
# get the user id and set a login cookie:
|
||||
my $email = $c->param("email");
|
||||
if (!$email) {
|
||||
print $c->header();
|
||||
invalidInputError("You must enter your email address so we can track your results and contact you if we have any questions.");
|
||||
print $c->header();
|
||||
invalidInputError("You must enter your email address so we can track your results and contact you if we have any questions.");
|
||||
}
|
||||
$user = Litmus::DB::User->find_or_create(email => $email);
|
||||
|
||||
|
|
|
@ -54,9 +54,9 @@ sub showTest {
|
|||
my $prod = Litmus::DB::Product->search(name => "Firefox")->next();
|
||||
my @detectbranch = $ua->branch($prod);
|
||||
if ((! $ua->buildid()) || (! $detectbranch[0]) ||
|
||||
$curbuildtime - $ua->buildid() > $maxbuildage ||
|
||||
($detectbranch[0]->branchid() != $branch->branchid() &&
|
||||
$detectbranch[0]->branchid() != $branch2->branchid())) {
|
||||
$curbuildtime - $ua->buildid() > $maxbuildage ||
|
||||
($detectbranch[0]->branchid() != $branch->branchid() &&
|
||||
$detectbranch[0]->branchid() != $branch2->branchid())) {
|
||||
Litmus->template()->process("simpletest/simpletest.html.tmpl") ||
|
||||
internalError(Litmus->template()->error());
|
||||
exit;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
[% FOREACH test=testlist %]
|
||||
<tr>
|
||||
<td><div align="center">
|
||||
<a href="show_test.cgi?id=[% test.testid FILTER html | uri %]">[% test.testid FILTER html %]</a>
|
||||
<a href="show_test.cgi?id=[% test.testid FILTER html | uri %]">[% test.testid FILTER html %]</a>
|
||||
</div></td>
|
||||
<td><div align="center">[% INCLUDE product_to_img product=test.product %]</div></td>
|
||||
<td><div align="center">[% test.summary FILTER html %]</div></td>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<td colspan="2" style="[% curresult.result.style %]">
|
||||
------- Test Result From
|
||||
<a href="mailto:[% curresult.user.email FILTER html | email %]">
|
||||
[% curresult.user.email FILTER html | email %]</a>
|
||||
[% curresult.user.email FILTER html | email %]</a>
|
||||
[% curresult.timestamp FILTER html %] -------
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
<td id="product_text_[% test.testid FILTER html %]">
|
||||
[% test.product.name FILTER html %]</td></tr>
|
||||
<input type="hidden" name="product_initial_[% test.testid FILTER html %]"
|
||||
value="[% test.product.productid FILTER html %]">
|
||||
value="[% test.product.productid FILTER html %]">
|
||||
|
||||
<tr><td><div align="right"><strong>Group:</strong></div></td>
|
||||
[% IF showedit %]
|
||||
|
|
|
@ -41,22 +41,22 @@ my @testlist;
|
|||
|
||||
my $tests = $c->param("tests");
|
||||
if ($tests) {
|
||||
my @tests = split("," => $tests);
|
||||
foreach my $curtest (@tests) {
|
||||
my $test = Litmus::DB::Test->retrieve($curtest);
|
||||
push(@testlist, $test);
|
||||
}
|
||||
my @tests = split("," => $tests);
|
||||
foreach my $curtest (@tests) {
|
||||
my $test = Litmus::DB::Test->retrieve($curtest);
|
||||
push(@testlist, $test);
|
||||
}
|
||||
} else {
|
||||
Litmus::DB::Test->set_sql('failing' => qq {
|
||||
SELECT tests.test_id
|
||||
FROM tests, test_results
|
||||
WHERE
|
||||
test_results.result_id != 1 AND
|
||||
test_results.test_id = tests.test_id
|
||||
GROUP BY tests.test_id
|
||||
|
||||
});
|
||||
@testlist = Litmus::DB::Test->search_failing();
|
||||
Litmus::DB::Test->set_sql('failing' => qq {
|
||||
SELECT tests.test_id
|
||||
FROM tests, test_results
|
||||
WHERE
|
||||
test_results.result_id != 1 AND
|
||||
test_results.test_id = tests.test_id
|
||||
GROUP BY tests.test_id
|
||||
|
||||
});
|
||||
@testlist = Litmus::DB::Test->search_failing();
|
||||
}
|
||||
|
||||
my $vars = {
|
||||
|
|
Загрузка…
Ссылка в новой задаче