Multiple bugs

git-svn-id: svn://10.0.0.236/trunk@221840 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ghendricks%novell.com
2007-03-13 22:26:53 +00:00
parent 3de2326b72
commit 595a5b1f6d
14 changed files with 45 additions and 19 deletions

View File

@@ -420,7 +420,9 @@ sub obliterate {
my $self = shift;
my $dbh = Bugzilla->dbh;
$p->obliterate foreach my $p (@{$self->get_properties});
foreach my $p (@{$self->get_properties}){
$p->obliterate;
}
$dbh->do("DELETE FROM test_environment_map
WHERE element_id = ?", undef, $self->id);

View File

@@ -489,9 +489,14 @@ sub init {
$f = 'case_status.name';
},
"^priority," => sub {
if ($obj eq 'case_run'){
push(@supptables,
"INNER JOIN test_cases
ON test_cases.case_id = test_case_runs.case_id");
}
push(@supptables,
"INNER JOIN priority ".
"ON test_". $obj ."s.priority_id = priority.id");
"ON test_cases.priority_id = priority.id");
$f = 'priority.value';
},
"^environment," => sub {

View File

@@ -1297,6 +1297,8 @@ sub get_user_rights {
my $plan_ids = $dbh->selectcol_arrayref(
"SELECT plan_id FROM test_case_plans WHERE case_id = ?",
undef, $self->id);
return 0 unless $plan_ids;
$plan_ids = join(',',@$plan_ids);
my ($perms) = $dbh->selectrow_array(
@@ -1305,7 +1307,7 @@ sub get_user_rights {
INNER JOIN test_cases ON test_case_plans.case_id = test_cases.case_id
WHERE userid = ? AND test_plan_permissions.plan_id IN ($plan_ids)",
undef, $userid);
print STDERR $perms;
return $perms;
}
###############################

View File

@@ -695,11 +695,11 @@ Removes this caserun, its history, and all things that reference it.
sub obliterate {
my $self = shift;
my $dbh = Bugzilla->dbh;
$dbh->do("DELETE FROM test_case_bugs WHERE case_run_id IN (" .
join(",", @{$self->get_case_run_list}) . ")", undef, $self->id)
if $self->get_case_run_list;
my $sth = $dbh->prepare_cached("DELETE FROM test_case_bugs WHERE case_run_id = ?");
foreach my $id (@{$self->get_case_run_list}){
$sth->execute($id);
}
$dbh->do("DELETE FROM test_case_runs WHERE case_id = ? AND run_id = ?",
undef, ($self->case_id, $self->run_id));
return 1;

View File

@@ -38,11 +38,15 @@
<div class="links">
<a href="tr_query.cgi">Search</a>&nbsp;|&nbsp;
<a href="tr_query.cgi?report=1">Reports</a>&nbsp;|&nbsp;
[% IF UserInGroup('Testers') %]
<a href="tr_new_plan.cgi">New Plan</a>&nbsp;|&nbsp;
[% END %]
<a href="tr_new_case.cgi?plan_id=[% plan_id FILTER none %]">New Case</a>&nbsp;|&nbsp;
<a href="tr_new_run.cgi?plan_id=[% plan_id FILTER none %]&case_status_id=2">New Run</a>&nbsp;|&nbsp;
[% IF UserInGroup('Testers') %]
<a href="tr_new_environment.cgi">New Environment</a>&nbsp;|&nbsp;
<a href="tr_admin_environment.cgi">Environment Variables</a>&nbsp;|&nbsp;
[% END %]
[% IF UserInGroup('admin') %]
<a href="tr_admin.cgi">Admin</a>&nbsp;|&nbsp;
[% END %]

View File

@@ -32,7 +32,8 @@
<a href="editparams.cgi">paramaters </a>.
[% ELSIF error == "testopia-create-denied" %]
[% title = "Cannot Create Object" %]
You do not have sufficient rights to create new [% object FILTER html %]s.
You do not have sufficient rights to create new [% object FILTER html %]s
[% IF plan %] for plan [% plan.id %][% END %].
[% ELSIF error == "testopia-missing-parameter" %]
[% title = "Missing Parameter" %]
Missing required parameter [% param FILTER html %]

View File

@@ -32,7 +32,7 @@
</tr>
<tr>
<td>
[% PROCESS select sel = { name => 'category',
[% PROCESS select sel = { name => 'category_id',
accesskey => 't',
list => plan.product.categories,
elements => 5,
@@ -46,7 +46,7 @@
mult => 1 } %]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'component',
[% PROCESS select sel = { name => 'component_id',
accesskey => 'm',
list => plan.product.components
elements => 5,

View File

@@ -24,7 +24,6 @@
# ...
#%]
[% IF case.canedit %]
<script src="testopia/js/DocumentManager.js" type="text/javascript"></script>
<script type="text/javascript">
dojo.require("dojo.widget.Editor2");
@@ -52,7 +51,7 @@
}
);
</script>
[% END %]
<a name="attributes"></a>
<input type="hidden" name="case_id" value="[% case.id FILTER none %]"/>
<table>

View File

@@ -89,7 +89,7 @@ No test cases
[% END %]
found.</b>
</p>
[% IF table.list_count > 0 && Param('allow-test-deletion') %]
[% IF candelete %]
<p style="float: right;"><input type="submit" name="action" value="Delete Selected"></p>
[% END %]
[% IF dotweak AND table.list_count %]

View File

@@ -304,7 +304,8 @@ if ($vars->{'run'}) {
}
else {
$vars->{'dotweak'} = Bugzilla->user->in_group('Testers');
$vars->{'candelete'} = Param('testopia-allow-group-member-deletes');
$vars->{'candelete'} = Bugzilla->user->in_group('admin')
|| (Bugzilla->user->in_group('Testers') && Param('testopia-allow-group-member-deletes'));
}
if ($serverpush && !$cgi->param('debug')) {
print $cgi->multipart_end;

View File

@@ -387,10 +387,19 @@ $vars->{'fullwidth'} = 1; #novellonly
$vars->{'case'} = $c;
$vars->{'status_list'} = $status_list;
$vars->{'priority_list'} = $priority_list;
$vars->{'dotweak'} = Bugzilla->user->in_group('Testers');
$vars->{'table'} = $table;
$vars->{'urlquerypart'} = $cgi->canonicalise_query('cmdtype');
if ($cgi->param('plan_id')){
my $plan_id = $cgi->param('plan_id');
my $plan = Bugzilla::Testopia::TestRun->new($plan_id);
$vars->{'dotweak'} = $plan->canedit;
$vars->{'candelete'} = $plan->candelete;
}
else{
$vars->{'dotweak'} = Bugzilla->user->in_group('Testers');
$vars->{'candelete'} = Bugzilla->user->in_group('admin')
|| (Bugzilla->user->in_group('Testers') && Param('testopia-allow-group-member-deletes'));
}
my $contenttype;
if ($format->{'extension'} eq "html") {

View File

@@ -68,7 +68,7 @@ foreach my $entry (@plan_id){
}
foreach my $id (keys %seen){
my $plan = Bugzilla::Testopia::TestPlan->new($id);
ThrowUserError("testopia-create-denied", {'object' => 'Test Case', 'plan' => $plan->id}) unless $plan->canedit;
ThrowUserError("testopia-create-denied", {'object' => 'Test Case', 'plan' => $plan}) unless $plan->canedit;
push @plan_ids, $id;
push @plans, $plan;
push @categories, @{$plan->product->categories};

View File

@@ -27,6 +27,7 @@ use lib ".";
use Bugzilla;
use Bugzilla::Util;
use Bugzilla::Config;
use Bugzilla::Error;
use Bugzilla::Constants;
use Bugzilla::Testopia::Util;
use Bugzilla::Testopia::Environment;
@@ -43,6 +44,8 @@ my $template = Bugzilla->template;
print $cgi->header;
ThrowUserError("testopia-create-denied", {'object' => 'Test Environment'}) unless Bugzilla->user->in_group('Testers');
my $action = $cgi->param('action') || '';
if ($action eq 'Add'){

View File

@@ -62,7 +62,7 @@ my $plan = Bugzilla::Testopia::TestPlan->new($plan_id);
unless ($plan->canedit){
print $cgi->header;
ThrowUserError("testopia-create-denied", {'object' => 'Test Run'});
ThrowUserError("testopia-create-denied", {'object' => 'Test Run', 'plan' => $plan});
}
unless (scalar @{$plan->product->builds(1)} > 0){