Clean out tabs, barewords, pod etc so files pass tests.
git-svn-id: svn://10.0.0.236/trunk@247566 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -236,8 +236,8 @@ sub store {
|
||||
}
|
||||
|
||||
sub to_json {
|
||||
my $self = shift;
|
||||
my $cgi = shift;
|
||||
my $self = shift;
|
||||
my $cgi = shift;
|
||||
my $obj;
|
||||
my $json = new JSON;
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ use strict;
|
||||
|
||||
use Bugzilla::Util;
|
||||
use Bugzilla::Error;
|
||||
use Bugzilla::Testopia::TestPlan;
|
||||
use Bugzilla::Testopia::TestCase;
|
||||
use JSON;
|
||||
|
||||
use base qw(Exporter Bugzilla::Object);
|
||||
|
||||
@@ -24,8 +24,6 @@ use strict;
|
||||
|
||||
use Bugzilla::Util;
|
||||
use Bugzilla::Error;
|
||||
use Bugzilla::Testopia::TestPlan;
|
||||
use Bugzilla::Testopia::TestCase;
|
||||
use Bugzilla::Testopia::Product;
|
||||
|
||||
use JSON;
|
||||
|
||||
@@ -72,27 +72,27 @@ sub products_to_json {
|
||||
$disable_move = ',"addChild","move"' if $disable_move;
|
||||
my $products = $self->user_visible_products;
|
||||
|
||||
|
||||
my @values;
|
||||
|
||||
my @values;
|
||||
|
||||
foreach my $product (@$products)
|
||||
{
|
||||
my $leaf;
|
||||
|
||||
if(scalar @{$product->environment_categories}> 0)
|
||||
{
|
||||
$leaf = "false";
|
||||
}
|
||||
else
|
||||
{
|
||||
$leaf = "true";
|
||||
}
|
||||
|
||||
push @values, {text=> $product->{'name'}, id=> $product->{'id'} . ' product', type=> 'product', leaf=>$leaf, draggable => 'false', cls => 'product'};
|
||||
{
|
||||
my $leaf;
|
||||
|
||||
if(scalar @{$product->environment_categories}> 0)
|
||||
{
|
||||
$leaf = "false";
|
||||
}
|
||||
else
|
||||
{
|
||||
$leaf = "true";
|
||||
}
|
||||
|
||||
push @values, {text=> $product->{'name'}, id=> $product->{'id'} . ' product', type=> 'product', leaf=>$leaf, draggable => 'false', cls => 'product'};
|
||||
}
|
||||
|
||||
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
# my $json = "[";
|
||||
# foreach my $obj (@{$products}){
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
|
||||
# Michael Hight <mjhight@gmail.com>
|
||||
# Garrett Braden <gbraden@novell.c
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
|
||||
=head1 NAME
|
||||
|
||||
@@ -280,23 +280,23 @@ sub product_categories_to_json {
|
||||
|
||||
my $categories = $self->get_element_categories_by_product($product_id);
|
||||
|
||||
my @values;
|
||||
my @values;
|
||||
|
||||
foreach my $cat (@$categories)
|
||||
{
|
||||
my $leaf;
|
||||
if($cat->check_for_elements)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $cat->{'name'}, id=> $cat->id . ' category', type=> 'category', leaf => $leaf, cls=> 'category'};
|
||||
}
|
||||
foreach my $cat (@$categories)
|
||||
{
|
||||
my $leaf;
|
||||
if($cat->check_for_elements)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $cat->{'name'}, id=> $cat->id . ' category', type=> 'category', leaf => $leaf, cls=> 'category'};
|
||||
}
|
||||
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
@@ -371,27 +371,27 @@ sub elements_to_json {
|
||||
my $elements = $self->get_parent_elements;
|
||||
my $json = '[';
|
||||
|
||||
my @values;
|
||||
my @values;
|
||||
|
||||
foreach my $element (@$elements)
|
||||
{
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $element->{'name'}, id=> ($element->{'element_id'}) . ' element', type=> 'element', leaf => $leaf, cls=> 'element'};
|
||||
}
|
||||
|
||||
$json = new JSON();
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
foreach my $element (@$elements)
|
||||
{
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $element->{'name'}, id=> ($element->{'element_id'}) . ' element', type=> 'element', leaf => $leaf, cls=> 'element'};
|
||||
}
|
||||
|
||||
$json = new JSON();
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
# foreach my $element (@$elements)
|
||||
# {
|
||||
# $json .= '{title:"'. $element->{'name'} .'",';
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
|
||||
# Michael Hight <mjhight@gmail.com>
|
||||
# Garrett Braden <gbraden@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
|
||||
=head1 NAME
|
||||
|
||||
@@ -136,7 +136,7 @@ Checks to see if the element has en environment mapping
|
||||
=cut
|
||||
|
||||
sub isMapped{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
|
||||
my $id = $self->id;
|
||||
@@ -147,7 +147,7 @@ sub isMapped{
|
||||
foreach my $val (@$ref){
|
||||
if($id == $val)
|
||||
{
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,26 +288,25 @@ my @values;
|
||||
|
||||
foreach my $element (@$elements)
|
||||
{
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $element->{'name'}, id=> $element->{'element_id'} . ' element', type=> 'element', leaf => $leaf, cls =>'element'};
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $element->{'name'}, id=> $element->{'element_id'} . ' element', type=> 'element', leaf => $leaf, cls =>'element'};
|
||||
}
|
||||
|
||||
foreach my $property (@$properties)
|
||||
{
|
||||
push @values, {text=> $property->{'name'}, id=> $property->id . ' property', type=> 'property', leaf => 'false', cls =>'property'};
|
||||
{
|
||||
push @values, {text=> $property->{'name'}, id=> $property->id . ' property', type=> 'property', leaf => 'false', cls =>'property'};
|
||||
}
|
||||
|
||||
my $json = new JSON;
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
|
||||
@@ -367,19 +366,19 @@ sub new_element_count{
|
||||
|
||||
sub this_to_json
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
my $element = {
|
||||
text=> $self->{'name'},
|
||||
id=> $self->{'element_id'} . ' element',
|
||||
type=> 'element',
|
||||
leaf => 'true',
|
||||
cls =>'element',
|
||||
allowDrop => 'false',
|
||||
disabled => 'true'
|
||||
};
|
||||
my $json = new JSON();
|
||||
print $json->objToJson($element);
|
||||
my $self = shift;
|
||||
|
||||
my $element = {
|
||||
text=> $self->{'name'},
|
||||
id=> $self->{'element_id'} . ' element',
|
||||
type=> 'element',
|
||||
leaf => 'true',
|
||||
cls =>'element',
|
||||
allowDrop => 'false',
|
||||
disabled => 'true'
|
||||
};
|
||||
my $json = new JSON();
|
||||
print $json->objToJson($element);
|
||||
|
||||
}
|
||||
=head2 check_for_properties
|
||||
@@ -572,9 +571,9 @@ sub get_parent {
|
||||
}
|
||||
|
||||
sub is_parent_a_category{
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
if ($self->{'parent_id'}){
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -290,24 +290,22 @@ sub valid_exp_to_json {
|
||||
|
||||
my @validexpressions = split(/\|/, @$validexp[0]);
|
||||
|
||||
my $json = '[';
|
||||
|
||||
|
||||
my @validExpressionsArray;
|
||||
foreach (@validexpressions)
|
||||
{
|
||||
my $class;
|
||||
if ($env && $env->get_value_selected($env->id, $self->element_id, $self->id) eq $_)
|
||||
{
|
||||
{
|
||||
my $class;
|
||||
if ($env && $env->get_value_selected($env->id, $self->element_id, $self->id) eq $_)
|
||||
{
|
||||
$class = "validexpYellow";
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = "validexp";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$class = "validexp";
|
||||
}
|
||||
|
||||
push @validExpressionsArray, {text=> $_, id=> $self->id . ' ' . $_ . ' validexp', value => $_, type=> 'validexp', leaf => 'true', cls=> $class};
|
||||
}
|
||||
}
|
||||
|
||||
my $json = new JSON;
|
||||
return $json->objToJson(\@validExpressionsArray);
|
||||
|
||||
@@ -281,8 +281,7 @@ sub canedit {
|
||||
}
|
||||
|
||||
sub to_json {
|
||||
my $self = shift;
|
||||
my $cgi = shift;
|
||||
my $self = shift;
|
||||
my $obj;
|
||||
my $json = new JSON;
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ sub init {
|
||||
my $type;
|
||||
|
||||
my $obj = trim($cgi->param('current_tab')) || ThrowUserError('testopia-missing-parameter', {'param' => 'current_tab'});
|
||||
ThrowUserError('unknown-tab') if $obj !~ '^(case|plan|run|case_run|environment)$';
|
||||
ThrowUserError('testopia-unknown-tab', {tab => $obj}) if $obj !~ '^(case|plan|run|case_run|environment)$';
|
||||
trick_taint($obj);
|
||||
|
||||
# If what we intend to do is generate a report, we need some tables
|
||||
|
||||
@@ -85,7 +85,7 @@ use constant UPDATE_COLUMNS => qw(case_status_id category_id priority_id
|
||||
isautomated sortkey script arguments summary requirement
|
||||
alias estimated_time dependson blocks runs tags components);
|
||||
|
||||
use constant VALIDATORS => {
|
||||
sub VALIDATORS {
|
||||
case_status_id => \&_check_status,
|
||||
category_id => \&_check_category,
|
||||
priority_id => \&_check_priority,
|
||||
@@ -883,7 +883,7 @@ sub add_to_run {
|
||||
my $runs = $self->_check_runs($runids);
|
||||
|
||||
foreach my $run (@$runs){
|
||||
$run->add_case_run($self->id);
|
||||
$run->add_case_run($self->id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -894,24 +894,24 @@ Adds a list of test cases to the current test cases being blocked by the testcas
|
||||
=cut
|
||||
|
||||
sub add_blocks {
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
my $cases = $self->_check_cases($case_ids);
|
||||
my @blocks;
|
||||
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
my $cases = $self->_check_cases($case_ids);
|
||||
my @blocks;
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
# Get a list of the cases this test case currently blocks
|
||||
my $current_blocks = $dbh->selectcol_arrayref("SELECT blocked
|
||||
FROM test_case_dependencies
|
||||
WHERE dependson = ?",
|
||||
undef,
|
||||
$self->id());
|
||||
|
||||
# Get a list of the cases this test case currently blocks
|
||||
my $current_blocks = $dbh->selectcol_arrayref("SELECT blocked
|
||||
FROM test_case_dependencies
|
||||
WHERE dependson = ?",
|
||||
undef,
|
||||
$self->id());
|
||||
|
||||
# update the list of items
|
||||
foreach (@$cases) {
|
||||
push @blocks, $_->id();
|
||||
push @blocks, $_->id();
|
||||
}
|
||||
|
||||
push @blocks, @$current_blocks;
|
||||
@@ -929,22 +929,22 @@ Removes a list of test cases from being blocked by the testcase
|
||||
=cut
|
||||
|
||||
sub remove_blocks {
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
return 0 if ($case_ids eq '' or !defined $case_ids);
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
my @cases;
|
||||
|
||||
foreach my $case (split /,/, $case_ids)
|
||||
{
|
||||
detaint_natural($case);
|
||||
push @cases, $case;
|
||||
}
|
||||
|
||||
my $query =<<QUERY;
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
return 0 if ($case_ids eq '' or !defined $case_ids);
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
my @cases;
|
||||
|
||||
foreach my $case (split /,/, $case_ids)
|
||||
{
|
||||
detaint_natural($case);
|
||||
push @cases, $case;
|
||||
}
|
||||
|
||||
my $query =<<QUERY;
|
||||
DELETE
|
||||
FROM test_case_dependencies
|
||||
WHERE dependson = ?
|
||||
@@ -964,24 +964,24 @@ Adds a list of test cases to the current test cases depended on by the testcase
|
||||
=cut
|
||||
|
||||
sub add_dependson {
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
my $cases = $self->_check_cases($case_ids);
|
||||
my @dependson;
|
||||
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
my $cases = $self->_check_cases($case_ids);
|
||||
my @dependson;
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
# Get a list of the cases this test case currently blocks
|
||||
my $current_dependson = $dbh->selectcol_arrayref("SELECT dependson
|
||||
FROM test_case_dependencies
|
||||
WHERE blocked = ?",
|
||||
undef,
|
||||
$self->id());
|
||||
|
||||
# Get a list of the cases this test case currently blocks
|
||||
my $current_dependson = $dbh->selectcol_arrayref("SELECT dependson
|
||||
FROM test_case_dependencies
|
||||
WHERE blocked = ?",
|
||||
undef,
|
||||
$self->id());
|
||||
|
||||
# update the list of items
|
||||
foreach (@$cases) {
|
||||
push @dependson, $_->id();
|
||||
push @dependson, $_->id();
|
||||
}
|
||||
|
||||
push @dependson, @$current_dependson;
|
||||
@@ -999,22 +999,22 @@ Adds a list of test cases to the current test cases depended on by the testcase
|
||||
=cut
|
||||
|
||||
sub remove_dependson {
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
return 0 if ($case_ids eq '' or !defined $case_ids);
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
my @cases;
|
||||
|
||||
foreach my $case (split /,/, $case_ids)
|
||||
{
|
||||
detaint_natural($case);
|
||||
push @cases, $case;
|
||||
}
|
||||
|
||||
my $query =<<QUERY;
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
return 0 if ($case_ids eq '' or !defined $case_ids);
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
my @cases;
|
||||
|
||||
foreach my $case (split /,/, $case_ids)
|
||||
{
|
||||
detaint_natural($case);
|
||||
push @cases, $case;
|
||||
}
|
||||
|
||||
my $query =<<QUERY;
|
||||
DELETE
|
||||
FROM test_case_dependencies
|
||||
WHERE blocked = ?
|
||||
|
||||
@@ -83,7 +83,7 @@ use constant DB_COLUMNS => qw(
|
||||
use constant REQUIRED_CREATE_FIELDS => qw(case_id run_id build_id environment_id case_run_status_id);
|
||||
use constant UPDATE_COLUMNS => qw(case_run_status_id case_text_version notes sortkey);
|
||||
|
||||
use constant VALIDATORS => {
|
||||
sub VALIDATORS {
|
||||
case_id => \&_check_case_id,
|
||||
build_id => \&_check_build_id,
|
||||
run_id => \&_check_run_id,
|
||||
|
||||
@@ -31,7 +31,6 @@ use Bugzilla::Version;
|
||||
use Bugzilla::Testopia::Constants;
|
||||
use Bugzilla::Testopia::Util;
|
||||
use Bugzilla::Testopia::TestRun;
|
||||
use Bugzilla::Testopia::TestCase;
|
||||
use Bugzilla::Testopia::Category;
|
||||
use Bugzilla::Testopia::Build;
|
||||
use Bugzilla::Testopia::TestTag;
|
||||
@@ -77,7 +76,7 @@ use constant DB_COLUMNS => qw(
|
||||
use constant REQUIRED_CREATE_FIELDS => qw(product_id author_id type_id default_product_version name);
|
||||
use constant UPDATE_COLUMNS => qw(product_id type_id default_product_version name isactive);
|
||||
|
||||
use constant VALIDATORS => {
|
||||
sub VALIDATORS {
|
||||
product_id => \&_check_product,
|
||||
author_id => \&_check_author,
|
||||
type_id => \&_check_type,
|
||||
|
||||
@@ -27,10 +27,10 @@ use strict;
|
||||
use Bugzilla::Util;
|
||||
use Bugzilla::User;
|
||||
use Bugzilla::Constants;
|
||||
use Bugzilla::Testopia::Constants;
|
||||
use Bugzilla::Config;
|
||||
use Bugzilla::Testopia::Environment;
|
||||
use Bugzilla::Bug;
|
||||
use Bugzilla::Config;
|
||||
use Bugzilla::Testopia::Constants;
|
||||
use Bugzilla::Testopia::Environment;
|
||||
|
||||
use JSON;
|
||||
use base qw(Exporter Bugzilla::Object);
|
||||
@@ -85,7 +85,7 @@ use constant UPDATE_COLUMNS => qw(environment_id build_id product_versio
|
||||
summary manager_id plan_text_version notes
|
||||
stop_date);
|
||||
|
||||
use constant VALIDATORS => {
|
||||
sub VALIDATORS {
|
||||
plan_id => \&_check_plan,
|
||||
environment_id => \&_check_env,
|
||||
build_id => \&_check_build,
|
||||
|
||||
@@ -46,7 +46,7 @@ use Bugzilla::Config;
|
||||
use Bugzilla::Error;
|
||||
use Bugzilla::Constants;
|
||||
use Bugzilla::Util;
|
||||
use Bugzilla::Testopia::TestPlan;
|
||||
#use Bugzilla::Testopia::TestPlan;
|
||||
|
||||
### Methods ###
|
||||
|
||||
|
||||
Reference in New Issue
Block a user