Pre roll bug fixes
git-svn-id: svn://10.0.0.236/trunk@222422 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -741,7 +741,6 @@ Returns true if the logged in user has rights to view this test run.
|
||||
sub canview {
|
||||
my $self = shift;
|
||||
return 1 if Bugzilla->user->in_group('Testers');
|
||||
print STDERR "PLAN ID ". $self->plan->id;
|
||||
return 1 if $self->plan->get_user_rights(Bugzilla->user->id) & TR_READ;
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -75,14 +75,14 @@
|
||||
[% title = "No Categories Defined" %]
|
||||
No categories have been created for this product yet.
|
||||
[% IF plan %]
|
||||
You can create categories <a href="tr_categories.cgi?plan_id=[% plan.id FILTER none %]">
|
||||
You can create categories <a href="tr_categories.cgi?product_id=[% plan.product.id FILTER none %]">
|
||||
here</a>.
|
||||
[% END %]
|
||||
[% ELSIF error == "testopia-create-build" %]
|
||||
[% title = "No Builds Defined" %]
|
||||
No builds have been created for this product yet.
|
||||
[% IF plan %]
|
||||
You can create builds <a href="tr_builds.cgi?plan_id=[% plan.id FILTER none %]">
|
||||
You can create builds <a href="tr_builds.cgi?product_id=[% plan.product.id FILTER none %]">
|
||||
here</a>.
|
||||
[% END %]
|
||||
[% ELSIF error == "testopia-create-environment" %]
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
<tr class="bz_row_data">
|
||||
<td>
|
||||
[% FOREACH plan = case.plans %]
|
||||
<a href="tr_show_plan.cgi?plan_id=[% plan.id FILTER none %]">[% plan.id FILTER none %]: [% plan.name FILTER html %]</a>
|
||||
<a href="tr_show_plan.cgi?plan_id=[% plan.id FILTER none %]">[% plan.id FILTER none %][% IF plan.canview %]: [% plan.name FILTER html %][% END %]</a>
|
||||
[% IF case.can_unlink_plan(plan.id) %]
|
||||
<a href="tr_show_case.cgi?action=unlink&plan_id=[% plan.id FILTER none %]&case_id=[% case.id FILTER none %]"><img src="testopia/img/del.gif" alt="Unlink Test Plan" /></a>
|
||||
[% END %]
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
[% PROCESS global/variables.none.tmpl %]
|
||||
|
||||
[% PROCESS global/header.html.tmpl
|
||||
title = "Search by Test Case Number"
|
||||
title = "Search by Test Run Environment Number"
|
||||
%]
|
||||
|
||||
<form method="get" action="tr_show_environment.cgi">
|
||||
|
||||
@@ -153,12 +153,13 @@ elsif ($action eq 'getcategories'){
|
||||
detaint_natural($product_id);
|
||||
my $product = Bugzilla::Testopia::Product->new($product_id);
|
||||
exit unless $product && Bugzilla->user->can_see_product($product->name);
|
||||
my $cat = Bugzilla::Testopia::Environment::Category({});
|
||||
my $cat = Bugzilla::Testopia::Environment::Category->new({});
|
||||
my $categories = $cat->get_element_categories_by_product($product_id);
|
||||
my $ret;
|
||||
foreach my $c (@{$categories}){
|
||||
$c->name =~ s/<span style='color:blue'>|<\/span>//g;
|
||||
$ret .= $c->id.'||'.$c->name.'|||';
|
||||
my $name = $c->name;
|
||||
$name =~ s/<span style='color:blue'>|<\/span>//g;
|
||||
$ret .= $c->id.'||'.$name.'|||';
|
||||
}
|
||||
chop($ret);
|
||||
print $ret;
|
||||
@@ -179,23 +180,6 @@ elsif ($action eq 'getelements'){
|
||||
print $ret;
|
||||
}
|
||||
|
||||
elsif ($action eq 'getproperties'){
|
||||
my $env = Bugzilla::Testopia::Environment->new({});
|
||||
my $elem_id = $cgi->param('elem_id');
|
||||
|
||||
|
||||
detaint_natural($elem_id);
|
||||
|
||||
my $properties = $env->get_properties_by_element_id($elem_id);
|
||||
my $ret;
|
||||
foreach my $p (@{$properties}){
|
||||
@$p[1] =~ s/<span style='color:blue'>|<\/span>//g;
|
||||
$ret .= @$p[0].'||'.@$p[1].'|||';
|
||||
}
|
||||
chop($ret);
|
||||
print $ret;
|
||||
}
|
||||
|
||||
else{
|
||||
&display;
|
||||
}
|
||||
|
||||
@@ -94,17 +94,17 @@ if ($action eq 'Commit'){
|
||||
next;
|
||||
}
|
||||
my $manager = login_to_id(trim($cgi->param('manager')));
|
||||
unless ($manager){
|
||||
print $cgi->multipart_end;
|
||||
if ($cgi->param('manager') && !$manager){
|
||||
print $cgi->multipart_end if $serverpush;
|
||||
ThrowUserError("invalid_username", { name => $cgi->param('manager') }) if $cgi->param('manager');
|
||||
}
|
||||
my $status;
|
||||
my $stop_date;
|
||||
if ($cgi->param('run_status')){
|
||||
if ($cgi->param('run_status') == -1 || $run->status){
|
||||
$status = $run->stop_date;
|
||||
if ($cgi->param('run_status') == -1 || $run->stop_date){
|
||||
$stop_date = $run->stop_date;
|
||||
}
|
||||
else {
|
||||
$status = get_time_stamp();
|
||||
$stop_date = get_time_stamp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ if ($action eq 'Commit'){
|
||||
validate_test_id($build, 'build');
|
||||
my %newvalues = (
|
||||
'manager_id' => $manager || $run->manager->id,
|
||||
'stop_date' => $status,
|
||||
'stop_date' => $stop_date,
|
||||
'environment_id' => $enviro,
|
||||
'build_id' => $build
|
||||
);
|
||||
|
||||
@@ -164,6 +164,9 @@ elsif ($action eq 'do_clone'){
|
||||
$method = "linked";
|
||||
$vars->{'backlink'} = $case;
|
||||
}
|
||||
else {
|
||||
ThrowUserError('testopia-missing-parameter', {'param' => 'copymethod'});
|
||||
}
|
||||
|
||||
$vars->{'tr_message'} = "Case $method to $count plans.";
|
||||
display($case);
|
||||
|
||||
@@ -60,7 +60,8 @@ my $action = $cgi->param('action') || '';
|
||||
|
||||
if ($action eq 'Commit'){
|
||||
my $caserun = Bugzilla::Testopia::TestCaseRun->new($caserun_id);
|
||||
display(do_update($caserun));
|
||||
$caserun = do_update($caserun);
|
||||
display(Bugzilla::Testopia::TestCaseRun->new($caserun->id));
|
||||
}
|
||||
elsif ($action eq 'Attach'){
|
||||
my $caserun = do_update(Bugzilla::Testopia::TestCaseRun->new($caserun_id));
|
||||
@@ -93,7 +94,7 @@ elsif ($action eq 'Attach'){
|
||||
$attachment->store;
|
||||
$vars->{'tr_message'} = "File attached.";
|
||||
$vars->{'backlink'} = $caserun;
|
||||
display($caserun);
|
||||
display(Bugzilla::Testopia::TestCaseRun->new($caserun->id));
|
||||
}
|
||||
|
||||
elsif ($action eq 'delete'){
|
||||
@@ -339,7 +340,11 @@ sub do_update {
|
||||
my $notes = $cgi->param('notes');
|
||||
my $build = $cgi->param('caserun_build');
|
||||
my $env = $cgi->param('caserun_env');
|
||||
my $assignee = login_to_id(trim($cgi->param('assignee'))) || ThrowUserError("invalid_username", { name => $cgi->param('assignee') }) if $cgi->param('assignee');
|
||||
my $assignee;
|
||||
if ($cgi->param('assignee')) {
|
||||
$assignee = login_to_id(trim($cgi->param('assignee')));
|
||||
}
|
||||
ThrowUserError("invalid_username", { name => $cgi->param('assignee') }) unless $assignee;
|
||||
|
||||
ThrowUserError('testopia-missing-required-field', {field => 'Status'}) unless defined $status;
|
||||
ThrowUserError('testopia-missing-required-field', {field => 'build'}) unless defined $build;
|
||||
@@ -377,7 +382,7 @@ sub do_update {
|
||||
|
||||
sub display {
|
||||
my $caserun = shift;
|
||||
ThrowUserError('insufficient-view-perms') if !$caserun->canview;
|
||||
ThrowUserError("testopia-permission-denied", {'object' => $caserun}) if !$caserun->canview;
|
||||
my $table = Bugzilla::Testopia::Table->new('case_run');
|
||||
ThrowUserError('testopia-query-too-large', {'limit' => $query_limit}) if $table->list_count > $query_limit;
|
||||
$vars->{'table'} = $table;
|
||||
|
||||
@@ -104,7 +104,7 @@ elsif ($action eq 'Clone'){
|
||||
elsif ($action eq 'do_clone'){
|
||||
unless (Bugzilla->user->in_group('Testers')){
|
||||
print $cgi->header;
|
||||
ThrowUserError("testopia-create-denied", {'object' => 'plans'});
|
||||
ThrowUserError("testopia-create-denied", {'object' => 'plan'});
|
||||
}
|
||||
|
||||
if ($serverpush) {
|
||||
@@ -235,7 +235,7 @@ elsif ($action eq 'Print'){
|
||||
my $plan = Bugzilla::Testopia::TestPlan->new($plan_id);
|
||||
unless ($plan->canview){
|
||||
print $cgi->header;
|
||||
ThrowUserError("testopia-permission-denied", {'object' => 'plan'});
|
||||
ThrowUserError("testopia-permission-denied", {'object' => $plan});
|
||||
}
|
||||
$vars->{'printdoc'} = 1;
|
||||
$cgi->param('ctype', 'print');
|
||||
|
||||
Reference in New Issue
Block a user