From be5298bd7e028df4249ce38844dedecf7879f9bc Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Tue, 11 Mar 2008 20:25:38 +0000 Subject: [PATCH] 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 --- .../testopia/Bugzilla/Testopia/Attachment.pm | 4 +- .../testopia/Bugzilla/Testopia/Build.pm | 2 - .../testopia/Bugzilla/Testopia/Category.pm | 2 - .../Bugzilla/Testopia/Classification.pm | 34 +- .../Bugzilla/Testopia/Environment/Category.pm | 74 +- .../Bugzilla/Testopia/Environment/Element.pm | 65 +- .../Bugzilla/Testopia/Environment/Property.pm | 22 +- .../testopia/Bugzilla/Testopia/Product.pm | 3 +- .../testopia/Bugzilla/Testopia/Search.pm | 2 +- .../testopia/Bugzilla/Testopia/TestCase.pm | 124 +-- .../testopia/Bugzilla/Testopia/TestCaseRun.pm | 2 +- .../testopia/Bugzilla/Testopia/TestPlan.pm | 3 +- .../testopia/Bugzilla/Testopia/TestRun.pm | 8 +- .../testopia/Bugzilla/Testopia/Util.pm | 2 +- .../Bugzilla/WebService/Testopia/Build.pm | 43 +- .../WebService/Testopia/Environment.pm | 57 +- .../Bugzilla/WebService/Testopia/Product.pm | 105 ++- .../Bugzilla/WebService/Testopia/TestCase.pm | 194 +++-- .../WebService/Testopia/TestCaseRun.pm | 132 ++- .../Bugzilla/WebService/Testopia/TestPlan.pm | 95 ++- .../Bugzilla/WebService/Testopia/TestRun.pm | 94 ++- .../errors/tr-user-error.html.tmpl | 11 +- .../hook/index.html.tmpl/links/tr.html.tmpl | 2 +- .../testopia/environment/show.html.tmpl | 764 +++++++++--------- .../testopia/plan/access-list.html.tmpl | 2 +- .../default/testopia/product/show.html.tmpl | 2 +- .../testopia/contrib/drivers/perl/client.pl | 20 +- mozilla/webtools/testopia/tr_attachment.cgi | 90 +-- mozilla/webtools/testopia/tr_history.cgi | 40 +- .../webtools/testopia/tr_show_environment.cgi | 316 ++++---- 30 files changed, 1136 insertions(+), 1178 deletions(-) diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Attachment.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Attachment.pm index 7f4d2e7527d..38c6d3a2257 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Attachment.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Attachment.pm @@ -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; diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Build.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Build.pm index 97046c7fbeb..20d42b3bc87 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Build.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Build.pm @@ -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); diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Category.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Category.pm index 67e26e88c54..f31ed0755ec 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Category.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Category.pm @@ -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; diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Classification.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Classification.pm index 7082d484872..380ca9c3faf 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Classification.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Classification.pm @@ -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}){ diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Category.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Category.pm index 01591065a45..4703a28c6ff 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Category.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Category.pm @@ -19,7 +19,7 @@ # Contributor(s): Greg Hendricks # Michael Hight # Garrett Braden +# Andrew Nelson =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'} .'",'; diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Element.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Element.pm index 35c81b0fb02..6b58e1ad6c5 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Element.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Element.pm @@ -19,7 +19,7 @@ # Contributor(s): Greg Hendricks # Michael Hight # Garrett Braden -# Andrew Nelson +# Andrew Nelson =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; } diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Property.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Property.pm index 1b4537db9c3..2fe37e5861e 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Property.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Property.pm @@ -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); diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Product.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Product.pm index 6832ce3f0e3..646633651c9 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Product.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Product.pm @@ -281,8 +281,7 @@ sub canedit { } sub to_json { - my $self = shift; - my $cgi = shift; + my $self = shift; my $obj; my $json = new JSON; diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm index 38edee5af66..bf964164b37 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm @@ -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 diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm index 83db3379409..50cd643d7cd 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm @@ -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 =<dbh(); + + my @cases; + + foreach my $case (split /,/, $case_ids) + { + detaint_natural($case); + push @cases, $case; + } + + my $query =<_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 =<dbh(); + + my @cases; + + foreach my $case (split /,/, $case_ids) + { + detaint_natural($case); + push @cases, $case; + } + + my $query =< 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, diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestPlan.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestPlan.pm index 250c96fc6c0..c0f8cf4e7d1 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestPlan.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestPlan.pm @@ -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, diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestRun.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestRun.pm index b3e7b3c4a3e..8c30689673e 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestRun.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestRun.pm @@ -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, diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Util.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Util.pm index dfea94f8b4f..1f3435f1b46 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Util.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Util.pm @@ -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 ### diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Build.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Build.pm index eaeb4cc4560..009b7c8cfa0 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Build.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Build.pm @@ -27,6 +27,7 @@ use base qw(Bugzilla::WebService); use Bugzilla::Constants; use Bugzilla::Testopia::Build; +use Bugzilla::Testopia::Product; sub get { my $self = shift; @@ -109,7 +110,7 @@ sub update{ next; } unless ($build->product->canedit){ - ThrowUserError('testopia-read-only', {'object' => $product}) if scalar @ids == 1; + ThrowUserError('testopia-read-only', {'object' => $build->product}) if scalar @ids == 1; push @builds, {FAILED => 1, message => "You do not have rights to view this product"}; next; } @@ -187,21 +188,21 @@ Provides methods for automated scripts to manipulate Testopia Builds =over =item C - + Description: Looks up and returns a build by name. - + Params: $name - String: name of the build. $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Hash: Matching Build object hash or error if not found. - + =item C - + Description: Creates a new build object and stores it in the database - + Params: $values - Hash: A reference to a hash with keys and values matching the fields of the build to be created. +-------------+----------------+-----------+------------------------------------+ @@ -213,31 +214,31 @@ Provides methods for automated scripts to manipulate Testopia Builds | description | String | Optional | | | isactive | Boolean | Optional | Defaults to True (1) | +-------------+----------------+-----------+------------------------------------+ - + Returns: The newly created object hash. - + =item C Description: Used to load an existing build from the database. - + Params: $id - An integer representing the ID in the database - + Returns: A blessed Bugzilla::Testopia::Build object hash - + =item C B Use Build::check_build instead - + =item C B Use Build::get instead - + =item C - + Description: Updates the fields of the selected build or builds. - + Params: $ids - Integer/String/Array Integer: A single build ID. String: A comma separates string of Build IDs for batch processing. Array: An array of build IDs for batch mode processing - + $values - Hash of keys matching Build fields and the new values to set each field to. +-------------+----------------+ @@ -248,23 +249,19 @@ Provides methods for automated scripts to manipulate Testopia Builds | description | String | | isactive | Boolean | +-------------+----------------+ - + Returns: Hash/Array: In the case of a single build it is returned. If a list was passed, it returns an array of build hashes. If the update on any particular build failed, the hash will contain a FAILED key and the message as to why it failed. - + =back =head1 SEE ALSO -=over - L L -=back - =head1 AUTHOR Greg Hendricks \ No newline at end of file diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Environment.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Environment.pm index ba7a536d849..adab5a7e359 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Environment.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Environment.pm @@ -169,21 +169,21 @@ Provides methods for automated scripts to manipulate Testopia Environments =over =item C - + Description: Looks up and returns an environment by name. - + Params: $name - String: name of the environment. $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Hash: Matching Environment object hash or error if not found. - + =item C - + Description: Creates a new environment object and stores it in the database - + Params: $values - Hash: A reference to a hash with keys and values matching the fields of the environment to be created. +-------------+----------------+-----------+------------------------------------+ @@ -194,37 +194,36 @@ Provides methods for automated scripts to manipulate Testopia Environments | isactive | Boolean | Optional | Defaults to True (1) | +-------------+----------------+-----------+------------------------------------+ - Returns: The newly created object hash. - + =item C Description: Used to load an existing Environment from the database. - + Params: $id - An integer representing the ID in the database - + Returns: A blessed Bugzilla::Testopia::Environment object hash - + =item C - + Description: Returns the list of case-runs that this Environment is used in. - + Params: $id - Integer: Environment ID. - + Returns: Array: List of case-run object hashes. - + =item C - + Description: Returns the list of runs that this Environment is used in. - + Params: $id - Integer: Environment ID. - + Returns: Array: List of run object hashes. - + =item C - + Description: Performs a search and returns the resulting list of Environments - + Params: $query - Hash: keys must match valid search fields. +--------------------------+ @@ -237,15 +236,15 @@ Provides methods for automated scripts to manipulate Testopia Environments | name | | env_value_selected_type | +--------------------------+ - + Returns: Array: Matching Environments are retuned in a list of hashes. - + =item C - + Description: Updates the fields of the selected environment or environments. - + Params: $ids - Integer A single environment ID. - + $values - Hash of keys matching Environment fields and the new values to set each field to. +-------------+----------------+ @@ -256,18 +255,14 @@ Provides methods for automated scripts to manipulate Testopia Environments +-------------+----------------+ Returns: Hash: The updated environment object hash. - + =back =head1 SEE ALSO -=over - L L -=back - =head1 AUTHOR Greg Hendricks \ No newline at end of file diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Product.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Product.pm index 3e13e31f326..aa41cf4fd19 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Product.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Product.pm @@ -43,7 +43,7 @@ sub _validate { $product = Bugzilla::Testopia::Product->new($product->id); } - ThrowUserError('invalid-test-id-non-existent', {type => 'Product', id => $id}) unless $product; + ThrowUserError('invalid-test-id-non-existent', {type => 'Product', id => $product}) unless $product; ThrowUserError('testopia-permission-denied', {'object' => $product}) if $product && !$product->canedit; return $product; @@ -195,150 +195,145 @@ Provides methods for automated scripts to expose Testopia Product data. =item C Description: Used to load an existing product from the database. - + Params: $id - An integer representing the ID in the database - + Returns: A blessed Bugzilla::Testopia::Product object hash - + =item C - + Description: Looks up and returns a validated product. - + Params: $name - String: name of the product. $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Hash: Matching Product object hash or error if not found. - + =item C - + Description: Get the list of builds associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object $active - Boolean: True to only include builds where isactive is true. - + Returns: Array: Returns an array of Build objects. - + =item C - + Description: Get the list of cases associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Array: Returns an array of TestCase objects. - + =item C - + Description: Get the list of categories associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Array: Returns an array of Case Category objects. - + =item C - + Description: Get the list of components associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Array: Returns an array of Component objects. - + =item C - + Description: Get the list of environments associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Array: Returns an array of Environment objects. - + =item C - + Description: Get the list of milestones associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Array: Returns an array of Milestone objects. - + =item C - + Description: Get the list of plans associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Array: Returns an array of Test Plan objects. - + =item C - + Description: Get the list of runs associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Array: Returns an array of Test Run objects. - + =item C - + Description: Get the list of tags associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Array: Returns an array of Tags objects. - + =item C - + Description: Get the list of versions associated with this product. - + Params: $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Array: Returns an array of Version objects. - + =item C B Use Product::get instead - + =item C B Use Product::check_product instead - + =back =head1 SEE ALSO -=over - L - L -=back - =head1 AUTHOR Greg Hendricks \ No newline at end of file diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCase.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCase.pm index d652fee58e9..36e48a398bd 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCase.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCase.pm @@ -253,7 +253,7 @@ sub attach_bug { } eval { $case->attach_bug($bug_ids); - } + }; if ($@){ push @results, {FAILED => 1, message => $@}; } @@ -314,7 +314,7 @@ sub add_component { } eval { $case->add_component($component_ids); - } + }; if ($@){ push @results, {FAILED => 1, message => $@}; } @@ -375,7 +375,7 @@ sub add_tag { } eval { $case->add_tag($tags); - } + }; if ($@){ push @results, {FAILED => 1, message => $@}; } @@ -456,7 +456,7 @@ sub link_plan { } eval { $case->link_plan($test_plan_id); - } + }; if ($@){ push @results, {FAILED => 1, message => $@}; } @@ -468,7 +468,7 @@ sub link_plan { sub unlink_plan { my $self = shift; - my ($case_id, $test_plan_id) = @_; + my ($case_id, $plan_id) = @_; Bugzilla->login(LOGIN_REQUIRED); @@ -477,7 +477,7 @@ sub unlink_plan { ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case; ThrowUserError("testopia-read-only", {'object' => 'case'}) unless ($case->can_unlink_plan($plan_id)); - $case->unlink_plan($test_plan_id); + $case->unlink_plan($plan_id); # Result is list of plans for test case on success, otherwise an exception will be thrown return $case->plans; @@ -503,7 +503,7 @@ sub add_to_run { } eval { $case->add_to_run($run_ids); - } + }; if ($@){ push @results, {FAILED => 1, message => $@}; } @@ -652,79 +652,79 @@ Provides methods for automated scripts to manipulate Testopia TestCases =item C Description: Adds one or more components to the selected test cases. - + Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database, an arry of case_ids or aliases, or a string of comma separated case_ids. - + $component_ids - Integer/Array/String - The component ID, an array of Component IDs, or a comma separated list of component IDs - + Returns: undef/Array: undef on success or an array of hashes with failure codes if a failure occured. - + =item C Description: Add one or more tags to the selected test cases. - + Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database, an arry of case_ids or aliases, or a string of comma separated case_ids. - + $tags - String/Array - A single tag, an array of tags, or a comma separated list of tags. - + Returns: undef/Array: undef on success or an array of hashes with failure codes if a failure occured. =item C Description: Add one or more cases to the selected test runs. - + Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database, an arry of case_ids or aliases, or a string of comma separated case_ids. - + $run_ids - Integer/Array/String: An integer representing the ID in the database an array of IDs, or a comma separated list of IDs. - + Returns: undef/Array: undef on success or an array of hashes with failure codes if a failure occured. =item C Description: Add one or more bugs to the selected test cases. - + Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database, an array of case_ids or aliases, or a string of comma separated case_ids. - + $bug_ids - Integer/Array/String: An integer or alias representing the ID in the database, an array of bug_ids or aliases, or a string of comma separated bug_ids. - + Returns: undef/Array: undef on success or an array of hashes with failure codes if a failure occured. =item C Description: Returns an average time for completion accross all runs. - + Params: $case_id - Integer/String: An integer or alias representing the ID in the database. - + Returns: String: Time in "HH:MM:SS" format. =item C - + Description: Looks up and returns a category by name. - + Params: $name - String: name of the category. $product - Integer/String/Object Integer: product_id of the product in the Database String: Product name Object: Blessed Bugzilla::Product object - + Returns: Hash: Matching Category object hash or error if not found. - + =item C - + Description: Creates a new Test Case object and stores it in the database. - + Params: $values - Hash: A reference to a hash with keys and values matching the fields of the test case to be created. +-------------------+----------------+-----------+------------------------+ @@ -753,112 +753,112 @@ Provides methods for automated scripts to manipulate Testopia TestCases | plans | Array/String | Optional | String Comma separated | | components | Array/String | Optional | String Comma separated | +-------------------+----------------+-----------+------------------------+ - + Returns: The newly created object hash. - + =item C Description: Remove a bug from a test case. - + Params: $case_id - Integer/String: An integer or alias representing the ID in the database. - + $bug_ids - Integer/Array/String: An integer or alias representing the ID in the database, an array of bug_ids or aliases, or a string of comma separated bug_ids. - + Returns: 0 on success. =item C Description: Used to load an existing test case from the database. - + Params: $id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this case. - + Returns: A blessed Bugzilla::Testopia::TestCase object hash - + =item C Description: Get the list of bugs that are associated with this test case. - + Params: $case_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this case. - + Returns: Array: An array of bug object hashes. - + =item C Description: Get the list of case-runs for all runs this case appears in. To limit this list by build or other attribute, see TestCaseRun::list. - + Params: $case_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this case. - + Returns: Array: An array of case-run object hashes. - + =item C Description: Get the list of changes to the fields of this case. - + Params: $case_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this case. - + Returns: Array: An array of hashes with changed fields and their details. - + =item C Description: Get the list of components attached to this case. - + Params: $case_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this case. - + Returns: Array: An array of component object hashes. - + =item C Description: Get the list of plans that this case is linked to. - + Params: $case_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this case. - + Returns: Array: An array of test plan object hashes. - + =item C Description: Get the list of tags attached to this case. - + Params: $case_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this case. - + Returns: Array: An array of tag object hashes. - + =item C Description: The associated large text fields: Action, Expected Results, Setup, Breakdown for a given version. - + Params: $case_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this case. - + $version - Integer: (OPTIONAL) The version of the text you want returned. Defaults to the latest. - + Returns: Hash: Text fields and values. - + =item C Description: Link test cases to the given plan. - + Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database, an array of case_ids or aliases, or a string of comma separated case_ids. - + $plan_id - Integer: An integer or alias representing the ID in the database. - + Returns: undef/Hash: undef on success, hash of failures if not. - + =item C - + Description: Performs a search and returns the resulting list of test cases. - + Params: $query - Hash: keys must match valid search fields. +--------------------------------------------------------+ @@ -896,7 +896,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases | tceffect | String | | tceffect_type | (select from query_variants) | +--------------------------------------------------------+ - + +---------------------------------------------------+ | Paging and Sorting | +---------------------------------------------------+ @@ -912,7 +912,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases +---------------------------------------------------+ | viewall | 1: returns all records | +---------------------------------------------------+ - + +----------------------------------------------------+ | query_variants | +----------------+-----------------------------------+ @@ -926,7 +926,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases | regexp | matches the regexp | | notregexp | doesn't match the regexp | +----------------+-----------------------------------+ - + +-------------------------------------+ | email_variants | +--------------+----------------------+ @@ -936,7 +936,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases | regexp | matches regexp | | notregexp | doesn't match regexp | +--------------+----------------------+ - + +----------------------------------------------------+ | tag_variants | +----------------+-----------------------------------+ @@ -952,85 +952,85 @@ Provides methods for automated scripts to manipulate Testopia TestCases | anywords | contains any of the words | | nowords | contains none of the words | +----------------------------------------------------+ - + Returns: Array: Matching test cases are retuned in a list of hashes. - + =item C Params: $id - Integer: ID of the case status to return - + Returns: String: the status name. - + =item C B Use check_category instead - + =item C Params: $id - Integer: ID of the case status to return - + Returns: String: the status name. - + =item C Params: $name - String: the status name. - + Returns: Integer: ID of the case status. - + =item C Params: $id - Integer: ID of the case status to return - + Returns: String: the status name. =item C Params: $name - String: the status name. - + Returns: Integer: ID of the case status. =item C Description: Removes selected component from the selected test case. - + Params: $case_id - Integer/String: An integer or alias representing the ID in the database. - + $component_id - Integer: - The component ID to be removed. - + Returns: 0 on success. - + =item C Description: Remove a tag from a case. - + Params: $case_id - Integer/String: An integer or alias representing the ID in the database. - + $tag - String - A single tag to be removed. - + Returns: 0 on success. =item C Description: Unlink a test case from the given plan. If only one plan is linked, this will delete the test case. - + Params: $case_ids - Integer/String: An integer or alias representing the ID in the database. - + $plan_id - Integer: An integer representing the ID in the database. - + Returns: undef/Array: Array of plans still linked if any, undef if not. - + =item C - + Description: Updates the fields of the selected case or cases. - + Params: $ids - Integer/String/Array Integer: A single TestCase ID. String: A comma separates string of TestCase IDs for batch processing. Array: An array of case IDs for batch mode processing - + $values - Hash of keys matching TestCase fields and the new values to set each field to. - + Returns: Hash/Array: In the case of a single case it is returned. If a list was passed, it returns an array of case hashes. If the update on any particular case failed, the has will contain a @@ -1053,18 +1053,14 @@ Provides methods for automated scripts to manipulate Testopia TestCases | dependson | Array/String | | blocks | Array/String | +-------------------+----------------+ - + =back =head1 SEE ALSO -=over - L L -=back - =head1 AUTHOR Greg Hendricks \ No newline at end of file diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCaseRun.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCaseRun.pm index 03c156fb791..0c30a32778b 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCaseRun.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestCaseRun.pm @@ -105,7 +105,7 @@ sub update { Bugzilla->login(LOGIN_REQUIRED); my @caseruns; - my @ids = use Bugzilla::Testopia::Util::process_list($run_id); + my @ids = Bugzilla::Testopia::Util::process_list($run_id); if (ref $case_id eq 'HASH' && !$build_id){ $new_values = $case_id; foreach my $id (@ids){ @@ -181,8 +181,8 @@ sub update { } # Remove assignee user object and replace with just assignee id - if (ref $caserun{'assignee'} eq 'Bugzilla::User'){ - $caserun{assignee} = $caserun{assignee}->id(); + if (ref $caserun->{'assignee'} eq 'Bugzilla::User'){ + $caserun->{assignee} = $caserun->{assignee}->id(); } # Result is modified test case run on success, otherwise an exception will be thrown @@ -264,7 +264,7 @@ sub detach_bug { ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case Run', id => $run_id}) unless $caserun; ThrowUserError('testopia-read-only', {'object' => $caserun}) unless $caserun->canedit; - $caserun->detach_bug($bug_ids); + $caserun->detach_bug($bug_id); # Result 0 on success, otherwise an exception will be thrown return 0; @@ -321,7 +321,7 @@ Provides methods for automated scripts to manipulate Testopia TestCaseRuns. Test case-runs are the mapping of a test case in a given run for a particular build and environment. There are therefore two ways to refer to a given case-run: - + By ID: The unique case_run_id By Combination: $run_id, $case_id, $build_id, $environment_id @@ -340,32 +340,32 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) =item C Description: Add one or more bugs to the selected test case-runs. - + Params: $case_run_id - Integer: An integer representing the ID in the database. - + $bug_ids - Integer/Array/String: An integer or alias representing the ID in the database, an array of bug_ids or aliases, or a string of comma separated bug_ids. - + Returns: undef. =item C Description: Add one or more bugs to the selected test case-runs. - + Params: $case_id - Integer: An integer representing the ID of the test case in the database. $run_id - Integer: An integer representing the ID of the test run in the database. $build_id - Integer: An integer representing the ID of the test build in the database. $environment_id - Integer: An integer representing the ID of the environment in the database. - + $bug_ids - Integer/Array/String: An integer or alias representing the ID in the database, an array of bug_ids or aliases, or a string of comma separated bug_ids. - + Returns: undef. =item C - + Description: Creates a new Test Case Run object and stores it in the database. - + Params: $values - Hash: A reference to a hash with keys and values matching the fields of the test case to be created. +--------------------+----------------+-----------+------------------------------------------------+ @@ -382,18 +382,18 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) | sortkey | Integer | Optional | a.k.a. Index | +--------------------+----------------+-----------+------------------------------------------------+ Valid statuses include: IDLE, PASSED, FAILED, RUNNING, PAUSED, BLOCKED - + Returns: The newly created object hash. - + =item C Description: Remove a bug from a test case-run. - + Params: $caserun_id - Integer: An integer representing the ID in the database. - + $bug_ids - Integer/Array/String: An integer or alias representing the ID in the database, an array of bug_ids or aliases, or a string of comma separated bug_ids. - + Returns: undef. =item C @@ -404,98 +404,98 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) $run_id - Integer: An integer representing the ID of the test run in the database. $build_id - Integer: An integer representing the ID of the test build in the database. $environment_id - Integer: An integer representing the ID of the environment in the database. - + $bug_id - Integer: An integer or alias representing the ID of the bug in the database, - + Returns: undef. =item C Description: Used to load an existing test case-run from the database. - + Params: $caserun_id - Integer: An integer representing the ID in the database for this case-run. - + Returns: A blessed Bugzilla::Testopia::TestCase object hash - + =item C Description: Used to load an existing test case from the database. - + Params: $case_id - Integer: An integer representing the ID of the test case in the database. $run_id - Integer: An integer representing the ID of the test run in the database. $build_id - Integer: An integer representing the ID of the test build in the database. $environment_id - Integer: An integer representing the ID of the environment in the database. - + Returns: A blessed Bugzilla::Testopia::TestCase object hash - + =item C Description: Get the list of bugs that are associated with this test case. - + Params: $caserun_id - Integer: An integer representing the ID in the database for this case-run. - + Returns: Array: An array of bug object hashes. - + =item C Description: Get the list of bugs that are associated with this test case. - + Params: $case_id - Integer: An integer representing the ID of the test case in the database. $run_id - Integer: An integer representing the ID of the test run in the database. $build_id - Integer: An integer representing the ID of the test build in the database. $environment_id - Integer: An integer representing the ID of the environment in the database. - + Returns: Array: An array of bug object hashes. - + =item C Description: Get the list of components attached to this case. - + Params: $caserun_id - Integer: An integer representing the ID in the database for this case-run. - + Returns: Array: An array of component object hashes. - + =item C Description: Get the list of components attached to this case. - + Params: $case_id - Integer: An integer representing the ID of the test case in the database. $run_id - Integer: An integer representing the ID of the test run in the database. $build_id - Integer: An integer representing the ID of the test build in the database. $environment_id - Integer: An integer representing the ID of the environment in the database. - + Returns: Array: An array of component object hashes. - + =item C Description: Get the list of case-runs for all runs this case appears in. To limit this list by build or other attribute, see TestCaseRun::list. - + Params: $caserun_id - Integer: An integer representing the ID in the database for this case-run. - + Returns: Array: An array of case-run object hashes. - + =item C Description: Get the list of case-runs for all runs this case appears in. To limit this list by build or other attribute, see TestCaseRun::list. - + Params: $case_id - Integer: An integer representing the ID of the test case in the database. $run_id - Integer: An integer representing the ID of the test run in the database. $build_id - Integer: An integer representing the ID of the test build in the database. $environment_id - Integer: An integer representing the ID of the environment in the database. - + Returns: Array: An array of case-run object hashes. - + =item C - + Description: Performs a search and returns the resulting list of test cases. - + Params: $query - Hash: keys must match valid search fields. +--------------------------------------------------------+ @@ -537,7 +537,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) | testedby | A bugzilla login (email address) | | testedby_type | (select from email_variants) | +--------------------------------------------------------+ - + +---------------------------------------------------+ | Paging and Sorting | +---------------------------------------------------+ @@ -553,7 +553,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) +---------------------------------------------------+ | viewall | 1: returns all records | +---------------------------------------------------+ - + +----------------------------------------------------+ | query_variants | +----------------+-----------------------------------+ @@ -567,7 +567,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) | regexp | matches the regexp | | notregexp | doesn't match the regexp | +----------------+-----------------------------------+ - + +-------------------------------------+ | email_variants | +--------------+----------------------+ @@ -577,7 +577,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) | regexp | matches regexp | | notregexp | doesn't match regexp | +--------------+----------------------+ - + +----------------------------------------------------+ | tag_variants | +----------------+-----------------------------------+ @@ -593,31 +593,31 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) | anywords | contains any of the words | | nowords | contains none of the words | +----------------------------------------------------+ - + Returns: Array: Matching test cases are retuned in a list of hashes. - + =item C Params: $id - Integer: ID of the case status to return - + Returns: String: the status name. - + =item C Params: $name - String: the status name. - + Returns: Integer: ID of the case status. - + =item C - + Description: Updates the fields of the selected case-runs. - + Params: $caserun_ids - Integer/String/Array Integer: A single TestCaseRun ID. String: A comma separates string of TestCaseRun IDs for batch processing. Array: An array of TestCaseRun IDs for batch mode processing - + $values - Hash of keys matching TestCaseRun fields and the new values to set each field to. +--------------------+----------------+ @@ -631,24 +631,24 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) | sortkey | Integer | | update_bugs | Boolean | 1: Reopen bugs on FAILED 0: Don't change bug status +--------------------+----------------+ - + Returns: Hash/Array: In the case of a single object, it is returned. If a list was passed, it returns an array of object hashes. If the update on any particular object failed, the hash will contain a FAILED key and the message as to why it failed. =item C - + Description: Updates the fields of the selected case-run. - + Params: $case_id - Integer: An integer representing the ID of the test case in the database. $run_id - Integer: An integer representing the ID of the test run in the database. $build_id - Integer: An integer representing the ID of the test build in the database. $environment_id - Integer: An integer representing the ID of the environment in the database. - + $values - Hash of keys matching TestCaseRun fields and the new values to set each field to. See above. - + Returns: Hash/Array: In the case of a single object, it is returned. If a list was passed, it returns an array of object hashes. If the update on any particular object failed, the hash will contain a @@ -658,13 +658,9 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id) =head1 SEE ALSO -=over - L L -=back - =head1 AUTHOR Greg Hendricks \ No newline at end of file diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestPlan.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestPlan.pm index 916bfdd954f..cbf83090fc8 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestPlan.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestPlan.pm @@ -32,7 +32,6 @@ use Bugzilla::Testopia::TestPlan; use Bugzilla::Testopia::Search; use Bugzilla::Testopia::Table; - sub get { my $self = shift; my ($plan_id) = @_; @@ -244,7 +243,7 @@ sub add_tag { } eval { $plan->add_tag($tags); - } + }; if ($@){ push @results, {FAILED => 1, message => $@}; } @@ -308,20 +307,20 @@ Provides methods for automated scripts to manipulate Testopia TestPlans =item C Description: Add one or more tags to the selected test plans. - + Params: $plan_ids - Integer/Array/String: An integer or alias representing the ID in the database, an arry of plan_ids or aliases, or a string of comma separated plan_ids. - + $tags - String/Array - A single tag, an array of tags, or a comma separated list of tags. - + Returns: undef/Array: undef on success or an array of hashes with failure codes if a failure occured. =item C - + Description: Creates a new Test Plan object and stores it in the database. - + Params: $values - Hash: A reference to a hash with keys and values matching the fields of the test plan to be created. +-------------------------+----------------+-----------+------------------------------------+ @@ -333,71 +332,71 @@ Provides methods for automated scripts to manipulate Testopia TestPlans | default_product_version | String | Required | | | isactive | Boolean | Optional | 0: Archived 1: Active (Default 1) | +-------------------------+----------------+-----------+------------------------------------+ - + Returns: The newly created object hash. - + =item C Description: Used to load an existing test plan from the database. - + Params: $id - Integer/String: An integer representing the ID in the database for this plan. - + Returns: A blessed Bugzilla::Testopia::TestPlan object hash - + =item C Description: Get the list of changes to the fields of this plan. - + Params: $plan_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this plan. - + Returns: Array: An array of hashes with changed fields and their details. - + =item C Description: Get the list of tags attached to this plan. - + Params: $plan_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this plan. - + Returns: Array: An array of tag object hashes. - + =item C Description: Get the list of cases that this plan is linked to. - + Params: $plan_id - Integer/String: An integer representing the ID in the database for this plan. - + Returns: Array: An array of test case object hashes. - + =item C Description: Get the list of runs in this plan. - + Params: $plan_id - Integer/String: An integer representing the ID in the database for this plan. - + Returns: Array: An array of test run object hashes. - + =item C Description: The associated large text fields: Action, Expected Results, Setup, Breakdown for a given version. - + Params: $plan_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this plan. - + $version - Integer: (OPTIONAL) The version of the text you want returned. Defaults to the latest. - + Returns: Hash: Text fields and values. - + =item C - + Description: Performs a search and returns the resulting list of test plans. - + Params: $query - Hash: keys must match valid search fields. +--------------------------------------------------------+ @@ -417,7 +416,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans | type_id | Integer | | version | String: Product version | +--------------------------------------------------------+ - + +--------------------------------------------------------+ | Paging and Sorting | +--------------------------------------------------------+ @@ -433,7 +432,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans +--------------------------------------------------------+ | viewall | 1: returns all records 0: first 25 | +--------------------------------------------------------+ - + +----------------------------------------------------+ | query_variants | +----------------+-----------------------------------+ @@ -447,7 +446,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans | regexp | matches the regexp | | notregexp | doesn't match the regexp | +----------------+-----------------------------------+ - + +-------------------------------------+ | email_variants | +--------------+----------------------+ @@ -457,7 +456,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans | regexp | matches regexp | | notregexp | doesn't match regexp | +--------------+----------------------+ - + +----------------------------------------------------+ | tag_variants | +----------------+-----------------------------------+ @@ -473,37 +472,37 @@ Provides methods for automated scripts to manipulate Testopia TestPlans | anywords | contains any of the words | | nowords | contains none of the words | +----------------------------------------------------+ - + Returns: Array: Matching test plans are retuned in a list of hashes. - + =item C Params: $name - String: the status name. - + Returns: Integer: ID of the plan type. - + =item C Params: $id - Integer: ID of the plan stype to return - + Returns: String: the type name. =item C Description: Remove a tag from a plan. - + Params: $plan_id - Integer/String: An integer or alias representing the ID in the database. - + $tag - String - A single tag to be removed. - + Returns: 0 on success. =item C - + Description: Updates the fields of the selected test plan. - + Params: $ids - Integer: A single TestPlan ID. - + $values - Hash of keys matching TestPlan fields and the new values to set each field to. +-------------------------+----------------+ @@ -514,20 +513,16 @@ Provides methods for automated scripts to manipulate Testopia TestPlans | default_product_version | String | | isactive | Boolean | +-------------------------+----------------+ - + Returns: Hash: The updated test plan object. =back =head1 SEE ALSO -=over - L L -=back - =head1 AUTHOR Greg Hendricks \ No newline at end of file diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestRun.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestRun.pm index a3179a9e9e8..df04112d9eb 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestRun.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/TestRun.pm @@ -105,11 +105,11 @@ sub update { ThrowUserError('testopia-read-only', {'object' => $run}) unless $run->canedit; if (trim($new_values->{'build_id'}) !~ /^\d+$/ ){ - my $build = Bugzilla::Testopia::Build::check_build($new_values->{'build_id'}, $plan->product); + my $build = Bugzilla::Testopia::Build::check_build($new_values->{'build_id'}, $run->plan->product); $new_values->{'build_id'} = $build->id; } if (trim($new_values->{'environment_id'}) !~ /^\d+$/ ){ - my $environment = Bugzilla::Testopia::Environment::check_environment($new_values->{'environment_id'}, $plan->product); + my $environment = Bugzilla::Testopia::Environment::check_environment($new_values->{'environment_id'}, $run->plan->product); $new_values->{'environment_id'} = $environment->id; } @@ -124,7 +124,7 @@ sub update { $run->set_build($new_values->{'build_id'}) if $new_values->{'build_id'}; $run->set_environment($new_values->{'environment_id'}) if $new_values->{'environment_id'}; $run->set_manager($new_values->{'manager_id'}) if $new_values->{'manager_id'}; - $run->set_notes($new_values->{'notes'}} if exists $cgi->{'notes'}; + $run->set_notes($new_values->{'notes'}) if exists $new_values->{'notes'}; $run->set_stop_date($timestamp) if $new_values->{'status'}; $run->update(); @@ -225,7 +225,7 @@ sub add_tag { } eval { $run->add_tag($tags); - } + }; if ($@){ push @results, {FAILED => 1, message => $@}; } @@ -289,20 +289,20 @@ Provides methods for automated scripts to manipulate Testopia TestRuns =item C Description: Add one or more tags to the selected test runs. - + Params: $run_ids - Integer/Array/String: An integer or alias representing the ID in the database, an arry of run_ids or aliases, or a string of comma separated run_ids. - + $tags - String/Array - A single tag, an array of tags, or a comma separated list of tags. - + Returns: undef/Array: undef on success or an array of hashes with failure codes if a failure occured. =item C - + Description: Creates a new Test Run object and stores it in the database. - + Params: $values - Hash: A reference to a hash with keys and values matching the fields of the test run to be created. +-------------------+----------------+-----------+------------------------------------+ @@ -318,70 +318,70 @@ Provides methods for automated scripts to manipulate Testopia TestRuns | notes | String | Optional | | | status | Integer | Optional | 0:STOPPED 1: RUNNING (default 1) | +-------------------+----------------+-----------+------------------------------------+ - + Returns: The newly created object hash. - + =item C Description: Used to load an existing test run from the database. - + Params: $id - Integer/String: An integer representing the ID in the database for this run. - + Returns: A blessed Bugzilla::Testopia::TestRun object hash - + =item C Description: Get the list of changes to the fields of this run. - + Params: $run_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this run. - + Returns: Array: An array of hashes with changed fields and their details. - + =item C Description: Get the list of tags attached to this run. - + Params: $run_id - Integer/String: An integer representing the ID in the database or a string representing the unique alias for this run. - + Returns: Array: An array of tag object hashes. - + =item C Description: Get the list of cases that this run is linked to. - + Params: $run_id - Integer/String: An integer representing the ID in the database for this run. - + $current - Boolean: 1 to only include the current set (what is displayed in the web page) 0: to return all, current and historical. - + Returns: Array: An array of test case object hashes. - + =item C Description: Get the list of cases that this run is linked to. - + Params: $run_id - Integer/String: An integer representing the ID in the database for this run. - + Returns: Array: An array of test case object hashes. - + =item C Description: Get the plan that this run is associated with. - + Params: $run_id - Integer/String: An integer representing the ID in the database for this run. - + Returns: Hash: A plan object hash. - + =item C - + Description: Performs a search and returns the resulting list of test runs. - + Params: $query - Hash: keys must match valid search fields. +--------------------------------------------------------+ @@ -409,7 +409,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns | type_id | Integer | | version | String: Product version | +--------------------------------------------------------+ - + +--------------------------------------------------------+ | Paging and Sorting | +--------------------------------------------------------+ @@ -425,7 +425,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns +--------------------------------------------------------+ | viewall | 1: returns all records 0: first 25 | +--------------------------------------------------------+ - + +----------------------------------------------------+ | query_variants | +----------------+-----------------------------------+ @@ -439,7 +439,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns | regexp | matches the regexp | | notregexp | doesn't match the regexp | +----------------+-----------------------------------+ - + +-------------------------------------+ | email_variants | +--------------+----------------------+ @@ -449,7 +449,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns | regexp | matches regexp | | notregexp | doesn't match regexp | +--------------+----------------------+ - + +----------------------------------------------------+ | tag_variants | +----------------+-----------------------------------+ @@ -465,25 +465,25 @@ Provides methods for automated scripts to manipulate Testopia TestRuns | anywords | contains any of the words | | nowords | contains none of the words | +----------------------------------------------------+ - + Returns: Array: Matching test runs are retuned in a list of hashes. - + =item C Description: Remove a tag from a run. - + Params: $run_id - Integer/String: An integer or alias representing the ID in the database. - + $tag - String - A single tag to be removed. - + Returns: 0 on success. =item C - + Description: Updates the fields of the selected test run. - + Params: $ids - Integer: A single TestRun ID. - + $values - Hash of keys matching TestRun fields and the new values to set each field to. See L for description +-------------------+----------------+ @@ -499,20 +499,16 @@ Provides methods for automated scripts to manipulate Testopia TestRuns | notes | String | | status | Integer | +-------------------+----------------+ - + Returns: Hash: The updated test run object. =back =head1 SEE ALSO -=over - L L -=back - =head1 AUTHOR Greg Hendricks \ No newline at end of file diff --git a/mozilla/webtools/testopia/template/en/default/hook/global/user-error.html.tmpl/errors/tr-user-error.html.tmpl b/mozilla/webtools/testopia/template/en/default/hook/global/user-error.html.tmpl/errors/tr-user-error.html.tmpl index e831fa30859..4b9de8be05f 100644 --- a/mozilla/webtools/testopia/template/en/default/hook/global/user-error.html.tmpl/errors/tr-user-error.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/hook/global/user-error.html.tmpl/errors/tr-user-error.html.tmpl @@ -29,8 +29,8 @@ You are not authorized to delete [% object.type FILTER html %] [% object.id FILTER html %] [% IF user.in_group('admin') %] If you are the administrator, you can check that your installation - allows deletion of Testopia objects in the - paramaters . + allows deletion of Testopia objects in the paramaters + and then add delete rights to your plan on the "Permissions" tab. [% END %] [% ELSIF error == "testopia-create-denied" %] [% title = "Cannot Create Object" %] @@ -152,5 +152,12 @@ [% ELSIF error == "testopia-regexp-too-inclusive" %] You are attempting to allow access to your test plan to more people than the limit set by your administrator allows. Please contatct your administrator. + [% ELSIF error == "testopia-unknown-tab" %] + I don't know what a [% tab FILTER html %] is. + [% ELSIF error == "testopia_component_attached" %] + The component you are attemting to add is already attached to this case. + [% ELSIF error == "testopia-no-action" %] + I give up. What were you trying to do? + Either there was no action specified, or I didn't recognize it. [% END %] diff --git a/mozilla/webtools/testopia/template/en/default/hook/index.html.tmpl/links/tr.html.tmpl b/mozilla/webtools/testopia/template/en/default/hook/index.html.tmpl/links/tr.html.tmpl index efdb7e9fa14..7f1eae0c6d8 100644 --- a/mozilla/webtools/testopia/template/en/default/hook/index.html.tmpl/links/tr.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/hook/index.html.tmpl/links/tr.html.tmpl @@ -22,7 +22,7 @@ Search existing test cases
Manage run environments

[% ELSE %] - You must login to Bugzilla to see Testopia features. + You must login to [% terms.Bugzilla %] to see Testopia features. [% END %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/environment/show.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/environment/show.html.tmpl index be9cd22eb4b..b1e6e498b7e 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/environment/show.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/environment/show.html.tmpl @@ -17,7 +17,7 @@ # # Contributor(s): Greg Hendricks # Scott Sudweeks - # Andrew Nelson + # Andrew Nelson #%] [%# INTERFACE: @@ -85,60 +85,60 @@ Ext.onReady(function(){ loader: new Tree.TreeLoader({ url: "tr_show_environment.cgi", listeners: {'beforeload':function(l, node) { - l.baseParams.action = 'getChildren'; - l.baseParams.id = node.attributes.id; - l.baseParams.type = node.attributes.type; - l.baseParams.env_id = node.attributes.id; - l.baseParams.environmentPanel = 'true'; - l.baseParams.environmentId = '[% environment.id %]'; + l.baseParams.action = 'getChildren'; + l.baseParams.id = node.attributes.id; + l.baseParams.type = node.attributes.type; + l.baseParams.env_id = node.attributes.id; + l.baseParams.environmentPanel = 'true'; + l.baseParams.environmentId = '[% environment.id %]'; }} }), listeners:{ "textchange": function(node, text, oldText){ - var httpRequest = new Ext.data.Connection(); - httpRequest.request({ - url: 'tr_show_environment.cgi', - params:{ - action: 'rename', - name: text, - env_id: node.id, - isactive: true - }, - success:function(object){ - TestopiaUtil.notify.msg('Test Environment updated', 'Environment renamed successfully'); - }, - failure: testopiaError - }); + var httpRequest = new Ext.data.Connection(); + httpRequest.request({ + url: 'tr_show_environment.cgi', + params:{ + action: 'rename', + name: text, + env_id: node.id, + isactive: true + }, + success:function(object){ + TestopiaUtil.notify.msg('Test Environment updated', 'Environment renamed successfully'); + }, + failure: testopiaError + }); }, - "contextmenu": function(node, event){ - if(node.attributes.type == 'category' || node.attributes.type == 'element'){ - var context = new Ext.menu.Menu({ - id: 'context menu', - items: [{ - text: 'Remove ' + node.attributes.text, - id: node.attributes.id, - type: node.attributes.type, - handler: deleteNode - }] - }); - } - else if(node.attributes.type == 'validexp'){ - var context = new Ext.menu.Menu({ - id: 'context menu', - items: [{ - text: 'Select ' + node.attributes.text, - id: node.attributes.id, - type: node.attributes.type, - value: node.attributes.value, - handler: changeNode - }] - }); - } - - else - return; - - context.showAt([event.getPageX(), event.getPageY()]); + "contextmenu": function(node, event){ + if(node.attributes.type == 'category' || node.attributes.type == 'element'){ + var context = new Ext.menu.Menu({ + id: 'context menu', + items: [{ + text: 'Remove ' + node.attributes.text, + id: node.attributes.id, + type: node.attributes.type, + handler: deleteNode + }] + }); + } + else if(node.attributes.type == 'validexp'){ + var context = new Ext.menu.Menu({ + id: 'context menu', + items: [{ + text: 'Select ' + node.attributes.text, + id: node.attributes.id, + type: node.attributes.type, + value: node.attributes.value, + handler: changeNode + }] + }); + } + + else + return; + + context.showAt([event.getPageX(), event.getPageY()]); } } }); @@ -162,10 +162,10 @@ Ext.onReady(function(){ loader: new Tree.TreeLoader({ url: "tr_show_environment.cgi", listeners: {"beforeload": function(l, node) { - l.baseParams.action = 'getChildren'; - l.baseParams.id = node.attributes.id; - l.baseParams.type = node.attributes.type; - l.baseParams.env_id = node.attributes.id; + l.baseParams.action = 'getChildren'; + l.baseParams.id = node.attributes.id; + l.baseParams.type = node.attributes.type; + l.baseParams.env_id = node.attributes.id; }} }), root: new Tree.AsyncTreeNode({ @@ -178,29 +178,29 @@ Ext.onReady(function(){ }), listeners: { "textchange": function(node, text, oldText){ - var nodeText = node.text; - var id = node.attributes.id; - var type = node.attributes.type; - var httpRequest = new Ext.data.Connection(); - - httpRequest.request({ - url: 'tr_show_environment.cgi', - params:{ - action: 'edit', - text: text, - id: id, - type:type, - value: oldText, - isactive: true - }, - success:function(object){ - if(object.responseText != "action successful") - Ext.MessageBox.alert("response", object.responseText); - }, - failure:function(){ - alert("Failure"); - } - }); + var nodeText = node.text; + var id = node.attributes.id; + var type = node.attributes.type; + var httpRequest = new Ext.data.Connection(); + + httpRequest.request({ + url: 'tr_show_environment.cgi', + params:{ + action: 'edit', + text: text, + id: id, + type:type, + value: oldText, + isactive: true + }, + success:function(object){ + if(object.responseText != "action successful") + Ext.MessageBox.alert("response", object.responseText); + }, + failure:function(){ + alert("Failure"); + } + }); } @@ -226,349 +226,349 @@ Ext.onReady(function(){ * Functions */ function deleteNode(item){ - if(item.type == 'category' || item.type == 'element'){ - var node = etree.getNodeById(item.id); - if(item.type == 'category'){ - node.expand(false, true, expandCallBack); - return; - } - - else if(item.type == 'element'){ - if(node.getDepth() > 2){ - Ext.MessageBox.alert("response", "only first-level elements can be deleted from your environment"); - return; - } - } - } - - else{ - Ext.MessageBox.alert("response", "only first-level elements can be deleted from your environment"); - return; - } + if(item.type == 'category' || item.type == 'element'){ + var node = etree.getNodeById(item.id); + if(item.type == 'category'){ + node.expand(false, true, expandCallBack); + return; + } + + else if(item.type == 'element'){ + if(node.getDepth() > 2){ + Ext.MessageBox.alert("response", "only first-level elements can be deleted from your environment"); + return; + } + } + } + + else{ + Ext.MessageBox.alert("response", "only first-level elements can be deleted from your environment"); + return; + } - var httpRequest = new Ext.data.Connection(); - - httpRequest.request({ - url: 'tr_show_environment.cgi', - params:{ - action: 'removeNode', - id: item.id, - type: item.type, - isactive: true, - environmentId: [% environment.id %] - }, - success:function(object){ - if(object.responseText != "action successful") - { - Ext.MessageBox.alert("response", object.responseText); - return; - } - - var node = etree.getNodeById(item.id); - if(node != null) - node.remove(); - - }, - failure:function(){ - alert("Failure"); - } - }); + var httpRequest = new Ext.data.Connection(); + + httpRequest.request({ + url: 'tr_show_environment.cgi', + params:{ + action: 'removeNode', + id: item.id, + type: item.type, + isactive: true, + environmentId: [% environment.id %] + }, + success:function(object){ + if(object.responseText != "action successful") + { + Ext.MessageBox.alert("response", object.responseText); + return; + } + + var node = etree.getNodeById(item.id); + if(node != null) + node.remove(); + + }, + failure:function(){ + alert("Failure"); + } + }); } function changeNode(item){ - var httpRequest = new Ext.data.Connection(); - - httpRequest.request({ - url: 'tr_show_environment.cgi', - params:{ - action: 'set_selected', - id: item.id, - type: item.type, - isactive: true, - environmentId: [% environment.id %], - value: item.value - }, - success:function(object){ - if(object.responseText != "action successful"){ - Ext.MessageBox.alert("response", object.responseText); - return; - } - - var node = etree.getNodeById(item.id); - var parentNode = node.parentNode; - var children = parentNode.childNodes; - for(i=0; i 2) - return; - - var item = {}; - item.id = node.attributes.id; - item.type = node.attributes.type; - deleteNode(item); + if(node.attributes.type != 'element') + return; + if(node.getDepth() > 2) + return; + + var item = {}; + item.id = node.attributes.id; + item.type = node.attributes.type; + deleteNode(item); } - vtree.on("contextmenu", function(node, event){ - - if(node.attributes.type == 'product'){ - var context = new Ext.menu.Menu({ - id: 'context menu', - items: [{ - text: 'Add category to ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: addNode - }] + vtree.on("contextmenu", function(node, event){ + + if(node.attributes.type == 'product'){ + var context = new Ext.menu.Menu({ + id: 'context menu', + items: [{ + text: 'Add category to ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: addNode + }] }); - } - - else if(node.attributes.type == 'category'){ - var context = new Ext.menu.Menu({ - id: 'context menu', - items: [{ - text: 'Add element to ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: addNode - },{ - text: 'Delete ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: deleteElement - },{ - text: 'Rename ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: renameElement - }] - }); - } - - else if(node.attributes.type == 'element'){ - var context = new Ext.menu.Menu({ - id: 'context menu', - items: [{ - text: 'Add element to ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: addNode, - property: 'false' - },{ - text: 'Add property to ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: addNode, - property: 'true' - },{ - text: 'Delete ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: deleteElement - },{ - text: 'Rename ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: renameElement - }] - }); - } - - else if(node.attributes.type == 'property'){ - var context = new Ext.menu.Menu({ - id: 'context menu', - items: [{ - text: 'Add Value to ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: addNode, - property: 'false' - },{ - text: 'Delete ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: deleteElement - },{ - text: 'Rename ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: renameElement - }] - }); - } - - else if(node.attributes.type == 'validexp'){ - var context = new Ext.menu.Menu({ - id: 'context menu', - items: [{ - text: 'Delete ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: deleteElement, - value: node.attributes.value - },{ - text: 'Rename ' + node.attributes.text, - nodeId: node.attributes.id, - type: node.attributes.type, - handler: renameElement - }] - }); - } - - else - return; - - context.showAt([event.getPageX(), event.getPageY()]); - + } + + else if(node.attributes.type == 'category'){ + var context = new Ext.menu.Menu({ + id: 'context menu', + items: [{ + text: 'Add element to ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: addNode + },{ + text: 'Delete ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: deleteElement + },{ + text: 'Rename ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: renameElement + }] + }); + } + + else if(node.attributes.type == 'element'){ + var context = new Ext.menu.Menu({ + id: 'context menu', + items: [{ + text: 'Add element to ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: addNode, + property: 'false' + },{ + text: 'Add property to ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: addNode, + property: 'true' + },{ + text: 'Delete ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: deleteElement + },{ + text: 'Rename ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: renameElement + }] + }); + } + + else if(node.attributes.type == 'property'){ + var context = new Ext.menu.Menu({ + id: 'context menu', + items: [{ + text: 'Add Value to ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: addNode, + property: 'false' + },{ + text: 'Delete ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: deleteElement + },{ + text: 'Rename ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: renameElement + }] + }); + } + + else if(node.attributes.type == 'validexp'){ + var context = new Ext.menu.Menu({ + id: 'context menu', + items: [{ + text: 'Delete ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: deleteElement, + value: node.attributes.value + },{ + text: 'Rename ' + node.attributes.text, + nodeId: node.attributes.id, + type: node.attributes.type, + handler: renameElement + }] + }); + } + + else + return; + + context.showAt([event.getPageX(), event.getPageY()]); + }); function addNode(item){ - if(item.type == 'category' || item.type == 'element' || item.type == 'product' || item.type == 'property'){ - var node = vtree.getNodeById(item.nodeId); - } - - else{ - Ext.MessageBox.alert("response", "Elements can only be added to categories or elements"); - return; - } + if(item.type == 'category' || item.type == 'element' || item.type == 'product' || item.type == 'property'){ + var node = vtree.getNodeById(item.nodeId); + } + + else{ + Ext.MessageBox.alert("response", "Elements can only be added to categories or elements"); + return; + } - var httpRequest = new Ext.data.Connection(); - var type = item.type; - if(type == 'element' && item.property == 'false'){ - type = 'child'; - } - - httpRequest.request({ - url: 'tr_show_environment.cgi', - params:{ - action: 'createChild', - id: item.nodeId, - type: type, - isactive: true, - environmentId: [% environment.id %] - }, - success:function(object){ - var node = vtree.getNodeById(item.nodeId); - node.leaf = false; - var json = new Ext.data.JsonReader(); - var newNode = new Ext.tree.TreeNode(Ext.util.JSON.decode(object.responseText)); - node.appendChild(newNode); - }, - failure:function(){ - alert("Failure"); - } - }); + var httpRequest = new Ext.data.Connection(); + var type = item.type; + if(type == 'element' && item.property == 'false'){ + type = 'child'; + } + + httpRequest.request({ + url: 'tr_show_environment.cgi', + params:{ + action: 'createChild', + id: item.nodeId, + type: type, + isactive: true, + environmentId: [% environment.id %] + }, + success:function(object){ + var node = vtree.getNodeById(item.nodeId); + node.leaf = false; + var json = new Ext.data.JsonReader(); + var newNode = new Ext.tree.TreeNode(Ext.util.JSON.decode(object.responseText)); + node.appendChild(newNode); + }, + failure:function(){ + alert("Failure"); + } + }); } function deleteElement(item){ - if(item.type == 'category' || item.type == 'element' || item.type == 'product' || item.type == 'property' || item.type == 'validexp'){ - var node = vtree.getNodeById(item.nodeId); - } - - else{ - Ext.MessageBox.alert("response", "Error handling delete"); - return; - } - - var httpRequest = new Ext.data.Connection(); - - httpRequest.request({ - url: 'tr_show_environment.cgi', - params:{ - action: 'deleteElement', - id: item.nodeId, - type: item.type, - isactive: true, - environmentId: [% environment.id %], - value: item.value - }, - success:function(object){ - if(object.responseText == 'action successful') - { - var node = vtree.getNodeById(item.nodeId); - node.remove(); - } - - else - Ext.MessageBox.alert("response", object.responseText); - - }, - failure:function(){ - alert("Failure"); - } - }); + if(item.type == 'category' || item.type == 'element' || item.type == 'product' || item.type == 'property' || item.type == 'validexp'){ + var node = vtree.getNodeById(item.nodeId); + } + + else{ + Ext.MessageBox.alert("response", "Error handling delete"); + return; + } + + var httpRequest = new Ext.data.Connection(); + + httpRequest.request({ + url: 'tr_show_environment.cgi', + params:{ + action: 'deleteElement', + id: item.nodeId, + type: item.type, + isactive: true, + environmentId: [% environment.id %], + value: item.value + }, + success:function(object){ + if(object.responseText == 'action successful') + { + var node = vtree.getNodeById(item.nodeId); + node.remove(); + } + + else + Ext.MessageBox.alert("response", object.responseText); + + }, + failure:function(){ + alert("Failure"); + } + }); } function renameElement(item){ - var node = vtree.getNodeById(item.nodeId); - var el = node.getUI().getTextEl(); - itemTreeEditor.startEdit(el); + var node = vtree.getNodeById(item.nodeId); + var el = node.getUI().getTextEl(); + itemTreeEditor.startEdit(el); } function copyNode(node){ - var copy = new Tree.TreeNode(Ext.apply({}, node.attributes)); - for(var i=0; i < node.childNodes.length; i++){ - n = node.childNodes[i]; - if(n){ - copy.appendChild(copyNode(n)); - } - } - return copy; + var copy = new Tree.TreeNode(Ext.apply({}, node.attributes)); + for(var i=0; i < node.childNodes.length; i++){ + n = node.childNodes[i]; + if(n){ + copy.appendChild(copyNode(n)); + } + } + return copy; }; itemTreeEditor.on("beforestartedit", function(editor, element, value){ - if(!editor.editNode) - return true; - var type = editor.editNode.attributes.type; - if(type == 'product' || type == 'classification') - return false; + if(!editor.editNode) + return true; + var type = editor.editNode.attributes.type; + if(type == 'product' || type == 'classification') + return false; }); environmentTreeEditor.on('beforestartedit', function(editor, element, value){ if(editor.editNode.attributes.type != "environment") - return false; + return false; }); vtree.on("enddrag", function(treePanel, node, dd, e){ - var connection = new Ext.data.Connection; - connection.request({ - url: 'tr_show_environment.cgi', - method: 'POST', - params: {element_id: node.id, environment_id: [%environment.id%], type: node.attributes.type, action: 'move'}, - failure: function() { + var connection = new Ext.data.Connection; + connection.request({ + url: 'tr_show_environment.cgi', + method: 'POST', + params: {element_id: node.id, environment_id: [%environment.id%], type: node.attributes.type, action: 'move'}, + failure: function() { Ext.Msg.alert('Status', '"the item could not be added to the list"'); - } - }); + } + }); }, this); etree.on("beforenodedrop", function(event){ - //alert("please let it fire"); - event.dropNode = copyNode(event.dropNode); + //alert("please let it fire"); + event.dropNode = copyNode(event.dropNode); }); diff --git a/mozilla/webtools/testopia/template/en/default/testopia/plan/access-list.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/plan/access-list.html.tmpl index 7f4bfe02a0d..3e162fa77f8 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/plan/access-list.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/plan/access-list.html.tmpl @@ -61,7 +61,7 @@ function planAccess(o){

This page allows plan managers to permit access to a test plan. By -default, members of the Testers group in Bugzilla have read +default, members of the Testers group in [% terms.Bugzilla %] have read and write access. Beyond this, login names (email addresses) that match a given regular expression are granted the level of permissions specified. Lastly, individuals can be granted additional permissions diff --git a/mozilla/webtools/testopia/template/en/default/testopia/product/show.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/product/show.html.tmpl index 99e23b415f8..49ae2757b93 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/product/show.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/product/show.html.tmpl @@ -54,7 +54,7 @@ margin-bottom:10px; } .x-grid3-row .x-grid-row-checker { - width: 18px; + width: 18px; }