From d5fd7fc9ce8f2e977e377589f2fd5209cf9355bc Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Wed, 7 Feb 2007 21:53:57 +0000 Subject: [PATCH] Removed tabs git-svn-id: svn://10.0.0.236/trunk@219666 18797224-902f-48f8-a5cc-f745e15eee43 --- .../Bugzilla/Testopia/Environment/Xml.pm | 168 ++++++++--------- .../testopia/Bugzilla/Testopia/Search.pm | 30 +-- .../testopia/Bugzilla/Testopia/TestCaseRun.pm | 6 +- .../Bugzilla/Testopia/XmlReferences.pm | 56 +++--- .../WebService/Testopia/Environment.pm | 128 ++++++------- .../en/default/testopia/case/list.csv.tmpl | 2 +- .../en/default/testopia/case/list.html.tmpl | 12 +- .../en/default/testopia/case/list.xml.tmpl | 2 +- .../en/default/testopia/case/show.html.tmpl | 12 +- .../en/default/testopia/case/show.xml.tmpl | 2 +- .../testopia/caserun/short-form.html.tmpl | 5 +- .../environment/admin/category.html.tmpl | 12 +- .../environment/admin/element.html.tmpl | 172 +++++++++--------- .../environment/admin/property.html.tmpl | 28 +-- .../environment/admin/valid_exp.html.tmpl | 52 +++--- .../testopia/environment/import.xml.tmpl | 22 +-- .../en/default/testopia/export/csv.case.tmpl | 116 ++++++------ .../testopia/export/csv.caseheader.tmpl | 16 +- .../en/default/testopia/plan/show.csv.tmpl | 2 +- .../en/default/testopia/plan/show.html.tmpl | 16 +- .../en/default/testopia/plan/show.xml.tmpl | 2 +- .../en/default/testopia/run/list.html.tmpl | 2 +- .../testopia/testopia/js/tr_showcase.js | 22 +-- mozilla/webtools/testopia/testopia/js/util.js | 36 ++-- .../testopia/testopia/scripts/readme.txt | 42 ++--- .../testopia/tr_admin_environment.cgi | 8 +- mozilla/webtools/testopia/tr_builds.cgi | 1 - mozilla/webtools/testopia/tr_categories.cgi | 1 - .../testopia/tr_import_environment.cgi | 44 ++--- .../webtools/testopia/tr_new_environment.cgi | 34 ++-- .../webtools/testopia/tr_show_environment.cgi | 1 - 31 files changed, 524 insertions(+), 528 deletions(-) diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Xml.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Xml.pm index 3b89a7b655d..0eb13c2e33a 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Xml.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Environment/Xml.pm @@ -142,16 +142,16 @@ sub parse() { else { $self->{'message'} = "Parsing and Validating XML Environment...
"; } - $self->{'error'} = undef; - if ($xml) { - trick_taint($xml); - } - my $twig = XML::Twig->new(); - $twig->parse($xml); - my $root = $twig->root; - # Checking if Product and Environment already exist. - my $product_name = $root->{'att'}->{'product'}; - my $product_id; + $self->{'error'} = undef; + if ($xml) { + trick_taint($xml); + } + my $twig = XML::Twig->new(); + $twig->parse($xml); + my $root = $twig->root; + # Checking if Product and Environment already exist. + my $product_name = $root->{'att'}->{'product'}; + my $product_id; if (lc($product_name) eq "--all--") { $self->{'message'} .= "..Using the --ALL-- PRODUCT.
"; $product_id = 0; @@ -171,33 +171,33 @@ sub parse() { ($self->{'product_id'}) = $product_id; $self->{'product_name'} = $product_name; my $environment_name = $root->{'att'}->{'name'}; - $self->{'name'} = $environment_name; + $self->{'name'} = $environment_name; $self->{'message'} .= "..Checking if $environment_name ENVIRONMENT NAME already exists for the $product_name PRODUCT..."; my $environment = Bugzilla::Testopia::Environment->new({}); my ($env_id) = $environment->check_environment($environment_name, $product_id); - my $environment_id; - if ($env_id < 1) { - $self->{'message'} .= "DOESN'T EXIST
"; - # Storing New Environment if Admin + my $environment_id; + if ($env_id < 1) { + $self->{'message'} .= "DOESN'T EXIST
"; + # Storing New Environment if Admin if ($admin) { $self->{'message'} .= "....Storing new $environment_name ENVIRONMENT NAME in the $self->{'product_name'} PRODUCT..."; $environment->{'name'} = $environment_name; ($environment_id) = Bugzilla::Testopia::Environment->store_environment_name($self->{'name'}, $product_id); $self->{'message'} .= "DONE.
"; } - } - else { - ($environment_id) = $env_id; - $self->{'message'} .= "EXISTS
Importing XML Environment Failed!
"; + } + else { + ($environment_id) = $env_id; + $self->{'message'} .= "EXISTS
Importing XML Environment Failed!
"; $self->{'error'} .= "$environment_name ENVIRONMENT NAME already exists for the $product_name PRODUCT. Please use another name."; - return 0; - } - ($self->{'environment_id'}) = $environment_id; - ($environment->{'product_id'}) = $self->{'product_id'}; - # Parse recursively through the nested child elements. - foreach my $twig_category ($root->children("category")) { - my $category_name = $twig_category->{'att'}->{'name'}; - # Makes sure to get the category_id by name and product_id + return 0; + } + ($self->{'environment_id'}) = $environment_id; + ($environment->{'product_id'}) = $self->{'product_id'}; + # Parse recursively through the nested child elements. + foreach my $twig_category ($root->children("category")) { + my $category_name = $twig_category->{'att'}->{'name'}; + # Makes sure to get the category_id by name and product_id my $category = Bugzilla::Testopia::Environment::Category->new({}); my ($cat_id) = $category->check_category($category_name, $product_id); my $category_id; @@ -252,24 +252,24 @@ sub parse_child_elements() { } $depth++; my $element_name = $twig_element->{'att'}->{'name'}; - # Checking if Elements already exist. - for (my $i = 1; $i < $depth; $i++) { - $self->{'message'} .= "...."; - } - $self->{'message'} .= "Checking if $element_name ELEMENT already exists in the $category_name CATEGORY..."; - my ($product_id) = $self->{'product_id'}; + # Checking if Elements already exist. + for (my $i = 1; $i < $depth; $i++) { + $self->{'message'} .= "...."; + } + $self->{'message'} .= "Checking if $element_name ELEMENT already exists in the $category_name CATEGORY..."; + my ($product_id) = $self->{'product_id'}; my $element = Bugzilla::Testopia::Environment::Element->new({}); my ($elem_id) = $element->check_element($element_name, $env_category_id); my $element_id; - if ($elem_id < 1) { - $self->{'message'} .= "DOESN'T EXIST.
"; - my $new_category_elements = $self->{'new_category_elements'}; + if ($elem_id < 1) { + $self->{'message'} .= "DOESN'T EXIST.
"; + my $new_category_elements = $self->{'new_category_elements'}; my $new_category_element = {'env_category_id' => $env_category_id, 'category_name' => $category_name, 'element_name' => $element_name}; push (@$new_category_elements, $new_category_element); $self->{'new_category_elements'} = $new_category_elements; # Storing New Elements if Admin if ($admin) { - for (my $i = 1; $i < $depth; $i++) { + for (my $i = 1; $i < $depth; $i++) { $self->{'message'} .= "...."; } $self->{'message'} .= "..Storing new $element_name ELEMENT in the $category_name CATEGORY..."; @@ -283,11 +283,11 @@ sub parse_child_elements() { ($element_id) = $element->store(); $self->{'message'} .= "DONE.
"; } - } - else { + } + else { ($element_id) = $elem_id; $self->{'message'} .= "EXISTS.
"; - } + } ($element->{'element_id'}) = $element_id; ($element->{'env_category_id'}) = $env_category_id; $element->{'name'} = $element_name; @@ -302,13 +302,13 @@ sub parse_child_elements() { $self->{'message'} .= "....Checking if $property_name PROPERTY already exists..."; my $property = Bugzilla::Testopia::Environment::Property->new({}); my ($prop_id) = $property->check_property($property_name, $element_id); - my $property_id; - if ($prop_id < 1) { - $self->{'message'} .= "DOESN'T EXIST.
"; - my $new_property_names = $self->{'new_property_names'}; - push (@$new_property_names, $property_name); - $self->{'new_property_names'} = $new_property_names; - # Storing New Property if Admin + my $property_id; + if ($prop_id < 1) { + $self->{'message'} .= "DOESN'T EXIST.
"; + my $new_property_names = $self->{'new_property_names'}; + push (@$new_property_names, $property_name); + $self->{'new_property_names'} = $new_property_names; + # Storing New Property if Admin if ($admin) { for (my $i = 1; $i < $depth; $i++) { $self->{'message'} .= "...."; @@ -319,30 +319,30 @@ sub parse_child_elements() { ($property_id) = $property->store(); $self->{'message'} .= "DONE.
"; } - } - else { + } + else { ($property_id) = $prop_id; $self->{'message'} .= "EXISTS.
"; - } - $property = Bugzilla::Testopia::Environment::Property->new($property_id); - # Checking if new Selected Value and Valid Expression exist. - my $validexp; - if ($property) { - $validexp = $property->validexp(); - } - my $value = $twig_property->field('value'); - for (my $i = 1; $i < $depth; $i++) { + } + $property = Bugzilla::Testopia::Environment::Property->new($property_id); + # Checking if new Selected Value and Valid Expression exist. + my $validexp; + if ($property) { + $validexp = $property->validexp(); + } + my $value = $twig_property->field('value'); + for (my $i = 1; $i < $depth; $i++) { $self->{'message'} .= "...."; } - $self->{'message'} .= "........Checking if $value VALUE exists in the list of selectable values..."; - if ( $validexp !~ m/$value/) { - $self->{'message'} .= "DOESN'T EXIST.
"; - if ($admin) { - if (!defined($validexp)) { - for (my $i = 1; $i < $depth; $i++) { + $self->{'message'} .= "........Checking if $value VALUE exists in the list of selectable values..."; + if ( $validexp !~ m/$value/) { + $self->{'message'} .= "DOESN'T EXIST.
"; + if ($admin) { + if (!defined($validexp)) { + for (my $i = 1; $i < $depth; $i++) { $self->{'message'} .= "...."; } - $self->{'message'} .= "..........Setting $value VALID EXPRESSION equal to the VALUE for the first time..."; + $self->{'message'} .= "..........Setting $value VALID EXPRESSION equal to the VALUE for the first time..."; $validexp = $value; } else { @@ -354,22 +354,22 @@ sub parse_child_elements() { } $property->update_property_validexp($validexp); $self->{'message'} .= "DONE.
"; - } - else { + } + else { my $new_validexp_values = $self->{'new_validexp_values'}; my $new_validexp_value = {'property_id' => $property_id, 'property_name' => $property_name, 'value' => $value}; push (@$new_validexp_values, $new_validexp_value); $self->{'new_validexp_values'} = $new_validexp_values; - } - } - elsif (!defined($validexp)) { - $self->{'message'} .= "VALID EXPRESSION DOESN'T EXIST YET.
"; - } - else { + } + } + elsif (!defined($validexp)) { + $self->{'message'} .= "VALID EXPRESSION DOESN'T EXIST YET.
"; + } + else { $self->{'message'} .= "EXISTS.
"; - } - if ($property_id && $admin) { - for (my $i = 1; $i < $depth; $i++) { + } + if ($property_id && $admin) { + for (my $i = 1; $i < $depth; $i++) { $self->{'message'} .= "...."; } $self->{'message'} .= "............Storing new VALUE SELECTED $value..."; @@ -379,14 +379,14 @@ sub parse_child_elements() { } $property->{'value_selected'} = $value; push (@properties, $property); - } - my $elm_properties = $element->{'properties'}; - push (@$elm_properties, @properties); - if ($parent_element) { - my $children = $parent_element->{'children'}; - push (@$children, $element); - $parent_element->{'children'} = $children; - } + } + my $elm_properties = $element->{'properties'}; + push (@$elm_properties, @properties); + if ($parent_element) { + my $children = $parent_element->{'children'}; + push (@$children, $element); + $parent_element->{'children'} = $children; + } foreach my $twig_element_child ($twig_element->children("element")) { $self->parse_child_elements($depth, $env_category_id, $category_name, $twig_element_child, $admin, $element); } diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm index 9a9f1bffe98..eb3bbe4ff53 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm @@ -848,13 +848,13 @@ sub init { my $type = "anyexact"; if ($cgi->param('caseidtype')) { - if ($cgi->param('caseidtype') eq 'exclude') - { - $type = "nowords"; - } + if ($cgi->param('caseidtype') eq 'exclude') + { + $type = "nowords"; + } else { - $type = $cgi->param('caseidtype') + $type = $cgi->param('caseidtype') } } if ($obj eq 'run'){ @@ -871,13 +871,13 @@ sub init { my $type = "anyexact"; if ($cgi->param('runidtype')) { - if ($cgi->param('runidtype') eq 'exclude') - { - $type = "nowords"; - } + if ($cgi->param('runidtype') eq 'exclude') + { + $type = "nowords"; + } else { - $type = $cgi->param('runidtype') + $type = $cgi->param('runidtype') } } if ($obj eq 'case'){ @@ -891,13 +891,13 @@ sub init { my $type = "anyexact"; if ($cgi->param('planidtype')) { - if ($cgi->param('planidtype') eq 'exclude') - { - $type = "nowords"; - } + if ($cgi->param('planidtype') eq 'exclude') + { + $type = "nowords"; + } else { - $type = $cgi->param('planidtype') + $type = $cgi->param('planidtype') } } if ($obj eq 'case'){ diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm index 380f81432eb..1a04c2fc8d1 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm @@ -476,9 +476,9 @@ sub lookup_status_by_name { my ($value) = $dbh->selectrow_array( "SELECT case_run_status_id - FROM test_case_run_status - WHERE name = ?", - undef, $name); + FROM test_case_run_status + WHERE name = ?", + undef, $name); return $value; } diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/XmlReferences.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/XmlReferences.pm index 27ac20acd36..006eee6272a 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/XmlReferences.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/XmlReferences.pm @@ -52,50 +52,50 @@ sub new $self{IGNORECASE} = $ignorecase; for my $field ( split(/ /, $fields) ) { - $field = uc $field if ( $self{IGNORECASE} ); - $self->{$field} = []; + $field = uc $field if ( $self{IGNORECASE} ); + $self->{$field} = []; } return $self; } sub add { - my ($self, $type, $object) = @_; - - $type = uc $type if ( $self{IGNORECASE} ); + my ($self, $type, $object) = @_; + + $type = uc $type if ( $self{IGNORECASE} ); - return 0 if ( ! exists $self->{$type} ); + return 0 if ( ! exists $self->{$type} ); - push @{$self->{$type}}, $object; + push @{$self->{$type}}, $object; } sub display { - my ($self) = @_; - - print "display() self=" . $self . "\n"; - foreach $key (keys %$self) - { - if ( defined $self->{$key} ) - { - print "display() key=$key value=" . $self->{$key} . "\n"; - } - else - { - print "display() key=$key value=undefined\n"; - } - } + my ($self) = @_; + + print "display() self=" . $self . "\n"; + foreach $key (keys %$self) + { + if ( defined $self->{$key} ) + { + print "display() key=$key value=" . $self->{$key} . "\n"; + } + else + { + print "display() key=$key value=undefined\n"; + } + } } sub get { - my ($self, $type) = @_; - - $type = uc $type if ( $self{IGNORECASE} ); - - return 0 if ( ! exists $self->{$type} ); - - return $self->{$type}; + my ($self, $type) = @_; + + $type = uc $type if ( $self{IGNORECASE} ); + + return 0 if ( ! exists $self->{$type} ); + + return $self->{$type}; } 1; diff --git a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Environment.pm b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Environment.pm index 372051f1e36..8bbcc0836c0 100644 --- a/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Environment.pm +++ b/mozilla/webtools/testopia/Bugzilla/WebService/Testopia/Environment.pm @@ -36,18 +36,18 @@ sub _list foreach (keys(%$query)) { - $cgi->param($_, $$query{$_}); + $cgi->param($_, $$query{$_}); } - + my $search = Bugzilla::Testopia::Search->new($cgi); - # Result is an array of environment hash maps - return Bugzilla::Testopia::Table->new('environment', - 'tr_xmlrpc.cgi', - $cgi, - undef, - $search->query() - )->list(); + # Result is an array of environment hash maps + return Bugzilla::Testopia::Table->new('environment', + 'tr_xmlrpc.cgi', + $cgi, + undef, + $search->query() + )->list(); } sub get @@ -57,20 +57,20 @@ sub get $self->login; - #Result is a environment hash map + #Result is a environment hash map my $environment = new Bugzilla::Testopia::Environment($environment_id); - if (not defined $environment) - { - $self->logout; + if (not defined $environment) + { + $self->logout; die "Environment, " . $environment_id . ", not found"; - } - - if (not $environment->canview) - { - $self->logout; + } + + if (not $environment->canview) + { + $self->logout; die "User Not Authorized"; - } + } $self->logout; @@ -84,88 +84,88 @@ sub list $self->login; - my $list = _list($query); - + my $list = _list($query); + $self->logout; - return $list; + return $list; } sub create { - my $self =shift; - my ($new_values) = @_; + my $self =shift; + my ($new_values) = @_; $self->login; - my $environment = new Bugzilla::Testopia::Environment($new_values); - - my $result = $environment->store(); - - $self->logout; - - # Result is new environment id - return $result; + my $environment = new Bugzilla::Testopia::Environment($new_values); + + my $result = $environment->store(); + + $self->logout; + + # Result is new environment id + return $result; } sub update { - my $self =shift; - my ($environment_id, $new_values) = @_; + my $self =shift; + my ($environment_id, $new_values) = @_; $self->login; - my $environment = new Bugzilla::Testopia::Environment($environment_id); - - if (not defined $environment) - { - $self->logout; + my $environment = new Bugzilla::Testopia::Environment($environment_id); + + if (not defined $environment) + { + $self->logout; die "Environment, " . $environment_id . ", not found"; - } - - if (not $environment->canedit) - { - $self->logout; + } + + if (not $environment->canedit) + { + $self->logout; die "User Not Authorized"; - } + } my $result = $environment->update($new_values); - $environment = new Bugzilla::Testopia::Environment($environment_id); - - $self->logout; + $environment = new Bugzilla::Testopia::Environment($environment_id); + + $self->logout; - # Result is modified environment, otherwise an exception will be thrown - return $environment; + # Result is modified environment, otherwise an exception will be thrown + return $environment; } sub get_runs { - my $self = shift; + my $self = shift; my ($environment_id) = @_; $self->login; my $environment = new Bugzilla::Testopia::Environment($environment_id); - if (not defined $environment) - { - $self->logout; + if (not defined $environment) + { + $self->logout; die "Environment, " . $environment_id . ", not found"; - } - - if (not $environment->canview) - { - $self->logout; + } + + if (not $environment->canview) + { + $self->logout; die "User Not Authorized"; - } + } my $result = $environment->runs(); - - $self->logout; + + $self->logout; - # Result is list of test runs for the given environment - return $result; + # Result is list of test runs for the given environment + return $result; } 1; \ No newline at end of file diff --git a/mozilla/webtools/testopia/template/en/default/testopia/case/list.csv.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/case/list.csv.tmpl index ad62af77f1a..4a61c5191fb 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/case/list.csv.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/case/list.csv.tmpl @@ -28,6 +28,6 @@ [% PROCESS testopia/export/csv.caseheader.tmpl %] [% FOREACH test_case = table.list %] - [% PROCESS testopia/export/csv.case.tmpl case=test_case %] + [% PROCESS testopia/export/csv.case.tmpl case=test_case %] [% END %] \ No newline at end of file diff --git a/mozilla/webtools/testopia/template/en/default/testopia/case/list.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/case/list.html.tmpl index f4d88797e2a..ac491429d5e 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/case/list.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/case/list.html.tmpl @@ -205,12 +205,12 @@ found. [% IF table.list_count >0 %]
- +
[% END %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/case/list.xml.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/case/list.xml.tmpl index 5844f86cfab..f63423c1b74 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/case/list.xml.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/case/list.xml.tmpl @@ -23,7 +23,7 @@ [% PROCESS testopia/export/xml.header.tmpl -%] [% FOREACH test_case = table.list %] - [%+ PROCESS testopia/export/xml.case.tmpl case=test_case %] + [%+ PROCESS testopia/export/xml.case.tmpl case=test_case %] [% END %] [%- PROCESS testopia/export/xml.footer.tmpl %] \ No newline at end of file diff --git a/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl index ec06289d8ef..398942ad11e 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl @@ -306,12 +306,12 @@
- +
[%##### Footer #####%] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/case/show.xml.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/case/show.xml.tmpl index e453cc055c9..d3a7cb02545 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/case/show.xml.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/case/show.xml.tmpl @@ -21,6 +21,6 @@ [%# Testopia Show Test Case XML export template #%] [% PROCESS testopia/export/xml.header.tmpl %] - [%+ PROCESS testopia/export/xml.case.tmpl %] + [%+ PROCESS testopia/export/xml.case.tmpl %] [% PROCESS testopia/export/xml.footer.tmpl %] \ No newline at end of file diff --git a/mozilla/webtools/testopia/template/en/default/testopia/caserun/short-form.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/caserun/short-form.html.tmpl index 90da7562fb4..14642f4eeaa 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/caserun/short-form.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/caserun/short-form.html.tmpl @@ -32,7 +32,7 @@ Action:
[% caserun.case.text.action %] - +
Expected Results:
[% caserun.case.text.effect %] @@ -128,8 +128,7 @@ [%##### Assignee #####%]
Classic interface... diff --git a/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/category.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/category.html.tmpl index c4448dfa093..ad65913860d 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/category.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/category.html.tmpl @@ -16,7 +16,7 @@ # Maciej Maczynski. All Rights Reserved. # # Contributor(s): Greg Hendricks - # Michael Hight + # Michael Hight #%] [%# INTERFACE: @@ -30,11 +30,11 @@ Parent Product: diff --git a/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/element.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/element.html.tmpl index 1ce6685c3c3..5d1b7313640 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/element.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/element.html.tmpl @@ -16,8 +16,8 @@ # Maciej Maczynski. All Rights Reserved. # # Contributor(s): Greg Hendricks - # Brian Kramer - # Michael Hight + # Brian Kramer + # Michael Hight #%] [%# INTERFACE: @@ -28,94 +28,94 @@

Element Administration

- - - - - + - + + + + + + +
Change Element Parent
- - - - - + + + + - - - + + + - + + + +
Product - - +
Change Element Parent
+ + + + + - -
Product + + [%### Product ###################################################################################### %] - -
-
- - - - + +
Category + +
+
+ + + + - -
Category [%### Category ###################################################################################### %] - -
-
+
- - - - - - - - - - - + + + +
Parent + + + + + - -
Parent [%### Element ###################################################################################### %] - -
-
-
Element Name
- - - - - -
Name:
-
+
+
Element Name
+ + + + + +
Name:
+

diff --git a/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/property.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/property.html.tmpl index 92f9cf1f8f6..28faed46e4e 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/property.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/property.html.tmpl @@ -16,8 +16,8 @@ # Maciej Maczynski. All Rights Reserved. # # Contributor(s): Greg Hendricks - # Michael Hight - # Scott Sudweeks + # Michael Hight + # Scott Sudweeks #%] [%# INTERFACE: @@ -28,21 +28,21 @@

Property Administration

- - + + - +
Assiged to Element: - - Assiged to Element: + +
Property Name:
diff --git a/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/valid_exp.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/valid_exp.html.tmpl index 4f2be2f08ad..4bf5d048e21 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/valid_exp.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/environment/admin/valid_exp.html.tmpl @@ -16,8 +16,8 @@ # Maciej Maczynski. All Rights Reserved. # # Contributor(s): Greg Hendricks - # Michael Hight - # Scott Sudweeks + # Michael Hight + # Scott Sudweeks #%] [%# INTERFACE: @@ -32,33 +32,33 @@ - + - - + + - - + +
Values For:
[% property.name %]
Values For:
[% property.name %]
- - - -
- -
+ + + +
+ +
- Value: - - - + Value: + + +
diff --git a/mozilla/webtools/testopia/template/en/default/testopia/environment/import.xml.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/environment/import.xml.tmpl index 63756ad1e93..8df9edae242 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/environment/import.xml.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/environment/import.xml.tmpl @@ -40,18 +40,18 @@ [% PROCESS testopia/messages.html.tmpl %] [% IF action == "admin" %] -
-

Add the above new data?

- - - -
+
+

Add the above new data?

+ + + +
[% ELSE %] -
-

Upload XML Environment:

- -

-
+
+

Upload XML Environment:

+ +

+
[% END %] [% PROCESS global/footer.html.tmpl %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/export/csv.case.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/export/csv.case.tmpl index 68560732312..d64370b5d3e 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/export/csv.case.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/export/csv.case.tmpl @@ -26,62 +26,62 @@ [% colsepchar = user.settings.csv_colsepchar.value %] [% FOREACH column = displaycolumns %] - [% SWITCH column %] - [% CASE 'action' %] - [% case.text.action FILTER csv %] - [% CASE 'author_id' %] - [% case.author.email FILTER csv %] - [% CASE 'blocks' %] - [% case.blocked_list FILTER csv %] - [% CASE 'break_down' %] - [% case.text.breakdown FILTER csv %] - [% CASE 'case_status_id' %] - [% case.status FILTER csv %] - [% CASE 'category_id' %] - [% case.category.name FILTER csv %] - [% CASE 'components' %] - [% FILTER csv %] - [% FOREACH component = case.components %] - [% component.name %](product=[% component.product_name %]) - [% IF component != case.components.last %] - [% colsepchar %] - [% END %] - [% END %] - [% END %] - [% CASE 'default_tester_id' %] - [% case.default_tester.email FILTER csv %] - [% CASE 'depends_on' %] - [% case.dependson_list FILTER csv %] - [% CASE 'expected_results' %] - [% case.text.effect FILTER csv %] - [% CASE 'isautomated' %] - [% case.isautomated ? "YES" : "NO" FILTER csv %] - [% CASE 'plans' %] - [% FILTER csv %] - [% FOREACH plan = case.plans %] - [% plan.id %] - [% IF plan != case.plans.last %] - [% colsepchar %] - [% END %] - [% END %] - [% END %] - [% CASE 'priority_id' %] - [% case.priority FILTER csv %] - [% CASE 'set_up' %] - [% case.text.setup FILTER csv %] - [% CASE 'tags' %] - [% FILTER csv %] - [% FOREACH tag = case.tags %] - [% tag.name %] - [% IF tag != case.tags.last %] - [% colsepchar %] - [% END %] - [% END %] - [% END %] - [% CASE DEFAULT %] - [% case.$column FILTER csv %] - [% END %] - [% IF column != displaycolumns.last %] - [% colsepchar %] - [% END %] + [% SWITCH column %] + [% CASE 'action' %] + [% case.text.action FILTER csv %] + [% CASE 'author_id' %] + [% case.author.email FILTER csv %] + [% CASE 'blocks' %] + [% case.blocked_list FILTER csv %] + [% CASE 'break_down' %] + [% case.text.breakdown FILTER csv %] + [% CASE 'case_status_id' %] + [% case.status FILTER csv %] + [% CASE 'category_id' %] + [% case.category.name FILTER csv %] + [% CASE 'components' %] + [% FILTER csv %] + [% FOREACH component = case.components %] + [% component.name %](product=[% component.product_name %]) + [% IF component != case.components.last %] + [% colsepchar %] + [% END %] + [% END %] + [% END %] + [% CASE 'default_tester_id' %] + [% case.default_tester.email FILTER csv %] + [% CASE 'depends_on' %] + [% case.dependson_list FILTER csv %] + [% CASE 'expected_results' %] + [% case.text.effect FILTER csv %] + [% CASE 'isautomated' %] + [% case.isautomated ? "YES" : "NO" FILTER csv %] + [% CASE 'plans' %] + [% FILTER csv %] + [% FOREACH plan = case.plans %] + [% plan.id %] + [% IF plan != case.plans.last %] + [% colsepchar %] + [% END %] + [% END %] + [% END %] + [% CASE 'priority_id' %] + [% case.priority FILTER csv %] + [% CASE 'set_up' %] + [% case.text.setup FILTER csv %] + [% CASE 'tags' %] + [% FILTER csv %] + [% FOREACH tag = case.tags %] + [% tag.name %] + [% IF tag != case.tags.last %] + [% colsepchar %] + [% END %] + [% END %] + [% END %] + [% CASE DEFAULT %] + [% case.$column FILTER csv %] + [% END %] + [% IF column != displaycolumns.last %] + [% colsepchar %] + [% END %] [% END %] \ No newline at end of file diff --git a/mozilla/webtools/testopia/template/en/default/testopia/export/csv.caseheader.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/export/csv.caseheader.tmpl index df016afdae9..df82ff7d327 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/export/csv.caseheader.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/export/csv.caseheader.tmpl @@ -26,12 +26,12 @@ [% colsepchar = user.settings.csv_colsepchar.value %] [% FOREACH column = displaycolumns %] - [% IF column == 'case_id' %] - [% column FILTER csv %] - [% ELSE %] - [% column FILTER remove('_id') FILTER csv %] - [% END %] - [% IF column != displaycolumns.last %] - [% colsepchar %] - [% END %] + [% IF column == 'case_id' %] + [% column FILTER csv %] + [% ELSE %] + [% column FILTER remove('_id') FILTER csv %] + [% END %] + [% IF column != displaycolumns.last %] + [% colsepchar %] + [% END %] [% END %] \ No newline at end of file diff --git a/mozilla/webtools/testopia/template/en/default/testopia/plan/show.csv.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/plan/show.csv.tmpl index bb6703177ca..33eff1434f3 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/plan/show.csv.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/plan/show.csv.tmpl @@ -28,6 +28,6 @@ [% PROCESS testopia/export/csv.caseheader.tmpl %] [% FOREACH test_case = case_table.list %] - [% PROCESS testopia/export/csv.case.tmpl case=test_case %] + [% PROCESS testopia/export/csv.case.tmpl case=test_case %] [% END %] \ No newline at end of file diff --git a/mozilla/webtools/testopia/template/en/default/testopia/plan/show.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/plan/show.html.tmpl index 5f89b1254b3..80305835363 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/plan/show.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/plan/show.html.tmpl @@ -283,14 +283,14 @@ [% IF case_table.list_count >0 %]
- +
[% END %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/plan/show.xml.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/plan/show.xml.tmpl index e726f3d581e..38a2d9fc111 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/plan/show.xml.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/plan/show.xml.tmpl @@ -25,7 +25,7 @@ [% PROCESS testopia/export/xml.header.tmpl -%] [% FOREACH test_case = case_table.list %] - [%+ PROCESS testopia/export/xml.case.tmpl case=test_case %] + [%+ PROCESS testopia/export/xml.case.tmpl case=test_case %] [% END %] [%- PROCESS testopia/export/xml.footer.tmpl %] \ No newline at end of file diff --git a/mozilla/webtools/testopia/template/en/default/testopia/run/list.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/run/list.html.tmpl index a0ea50a1333..70eea7bfef8 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/run/list.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/run/list.html.tmpl @@ -90,7 +90,7 @@ found. Environment - + [% IF NOT multiprod %] diff --git a/mozilla/webtools/testopia/testopia/js/tr_showcase.js b/mozilla/webtools/testopia/testopia/js/tr_showcase.js index 6e6d4582316..a12f30c16c6 100755 --- a/mozilla/webtools/testopia/testopia/js/tr_showcase.js +++ b/mozilla/webtools/testopia/testopia/js/tr_showcase.js @@ -96,8 +96,8 @@ function sx_done () { if (s.substring(0,2)=='OK') { s = s.substring(3); - updateStatus(list_id, _newStatus); - _newStatus = null; + updateStatus(list_id, _newStatus); + _newStatus = null; displayMsg('floatMsg', 1, MSG_TEST_CASE_STATUS_UPDATED); setTimeout("clearMsg('floatMsg')",OK_TIMEOUT); @@ -164,20 +164,20 @@ function ss_done () { if (s.substring(0,2)=='OK') { if(_inOrder){ - if (_order == 'up') { - for(var i=0; i-1; i--) { movedown(list_index[i]); } - } + } - _order = null; - - displayMsg('floatMsg', 1, MSG_TEST_CASE_ORDER_UPDATED); + _order = null; + + displayMsg('floatMsg', 1, MSG_TEST_CASE_ORDER_UPDATED); setTimeout("clearMsg('floatMsg')",OK_TIMEOUT); } else { //I give up refreshing the list dinamically, let the server do it: diff --git a/mozilla/webtools/testopia/testopia/js/util.js b/mozilla/webtools/testopia/testopia/js/util.js index 85bf7eb6de0..2f2eef4ca33 100755 --- a/mozilla/webtools/testopia/testopia/js/util.js +++ b/mozilla/webtools/testopia/testopia/js/util.js @@ -40,8 +40,8 @@ function _cset(newstate) { var myform = document.getElementById('table'); for(i=0;iname =~ s/|<\/span>//g; - $ret .= $c->id.'||'.$c->name.'|||'; + $ret .= $c->id.'||'.$c->name.'|||'; } chop($ret); print $ret; @@ -172,14 +172,14 @@ elsif ($action eq 'getelements'){ foreach my $e (@{$elements}){ my $elem = Bugzilla::Testopia::Environment::Element->new(@$e{'element_id'}); $elem->{'name'} =~ s/|<\/span>//g; - $ret .= $elem->{'element_id'}.'||'.$elem->{'name'}.'|||'; + $ret .= $elem->{'element_id'}.'||'.$elem->{'name'}.'|||'; } $ret = substr($ret, 0, length($ret) - 3); print $ret; } elsif ($action eq 'getproperties'){ - my $env = Bugzilla::Testopia::Environment->new({}); + my $env = Bugzilla::Testopia::Environment->new({}); my $elem_id = $cgi->param('elem_id'); @@ -189,7 +189,7 @@ elsif ($action eq 'getproperties'){ my $ret; foreach my $p (@{$properties}){ @$p[1] =~ s/|<\/span>//g; - $ret .= @$p[0].'||'.@$p[1].'|||'; + $ret .= @$p[0].'||'.@$p[1].'|||'; } chop($ret); print $ret; diff --git a/mozilla/webtools/testopia/tr_builds.cgi b/mozilla/webtools/testopia/tr_builds.cgi index b18759de362..211314fa63f 100755 --- a/mozilla/webtools/testopia/tr_builds.cgi +++ b/mozilla/webtools/testopia/tr_builds.cgi @@ -190,7 +190,6 @@ sub get_builds_xml { $ret .= ""; } $ret .= ""; - print STDERR "$ret"; return $ret; } diff --git a/mozilla/webtools/testopia/tr_categories.cgi b/mozilla/webtools/testopia/tr_categories.cgi index e9f5ce1222c..93e1d46dcc4 100755 --- a/mozilla/webtools/testopia/tr_categories.cgi +++ b/mozilla/webtools/testopia/tr_categories.cgi @@ -177,7 +177,6 @@ sub get_categories_xml { $ret .= ""; } $ret .= ""; - print STDERR "$ret"; return $ret; } diff --git a/mozilla/webtools/testopia/tr_import_environment.cgi b/mozilla/webtools/testopia/tr_import_environment.cgi index 9d90ae4b0f5..c34cef525a2 100755 --- a/mozilla/webtools/testopia/tr_import_environment.cgi +++ b/mozilla/webtools/testopia/tr_import_environment.cgi @@ -71,7 +71,7 @@ $CGI::POST_MAX = 1024 * 500; # max file size 500K print $cgi->header; # Make sure the file isn't too big. if (!$env_filename && $cgi->cgi_error()) { - $vars->{'tr_error'} .= "File size cannot exceed 500K.
"; + $vars->{'tr_error'} .= "File size cannot exceed 500K.
"; } # Upload the file and read it into a string if it's been posted. if ($action eq 'import' && $env_filename) { @@ -169,8 +169,8 @@ new data. =cut sub admin_approve { - $vars->{'action'} = "admin"; - $vars->{'xml'} = $xml; + $vars->{'action'} = "admin"; + $vars->{'xml'} = $xml; } @@ -183,7 +183,7 @@ Stores the Environment based on existing Categories, Elements, Properties, and s =cut sub store_environment { - $environment->store(); + $environment->store(); } @@ -199,22 +199,22 @@ sub slurp_env_file { my $untainted_filename; my $post_max = $CGI::POST_MAX; if (!$env_filename) { - $vars->{'tr_error'} .= "Please upload an Environment XML file.
"; - return 0; - } - # untaint $env_file - if ($env_filename =~ /^([-\@:\/\\\w.]+)$/) { - $untainted_filename = $1; - } - else { - $vars->{'tr_error'} .= "The filename must contain numbers and letters only. Please try again.
"; - return 0; - } - if ($untainted_filename =~ m/\.\./) { - $vars->{'tr_error'} .= "The filename cannot conain the sequence '..' Please try again.
"; - return 0; - } - my $num_bytes = $CGI::POST_MAX; + $vars->{'tr_error'} .= "Please upload an Environment XML file.
"; + return 0; + } + # untaint $env_file + if ($env_filename =~ /^([-\@:\/\\\w.]+)$/) { + $untainted_filename = $1; + } + else { + $vars->{'tr_error'} .= "The filename must contain numbers and letters only. Please try again.
"; + return 0; + } + if ($untainted_filename =~ m/\.\./) { + $vars->{'tr_error'} .= "The filename cannot conain the sequence '..' Please try again.
"; + return 0; + } + my $num_bytes = $CGI::POST_MAX; my ($totalbytes, $byteswritten, $buffer); while ($byteswritten = read($env_fh, $buffer, $num_bytes)) { $xml .= $buffer; @@ -342,6 +342,6 @@ Displays the Import Environment template =cut sub display { - $vars->{'tr_message'} .= $message . $environment->{'message'}; - $template->process("testopia/environment/import.xml.tmpl", $vars) || print $template->error(); + $vars->{'tr_message'} .= $message . $environment->{'message'}; + $template->process("testopia/environment/import.xml.tmpl", $vars) || print $template->error(); } \ No newline at end of file diff --git a/mozilla/webtools/testopia/tr_new_environment.cgi b/mozilla/webtools/testopia/tr_new_environment.cgi index ebc0d120218..2c106cd1833 100755 --- a/mozilla/webtools/testopia/tr_new_environment.cgi +++ b/mozilla/webtools/testopia/tr_new_environment.cgi @@ -49,22 +49,22 @@ if ($action eq 'Add'){ my $name = $cgi->param('name'); my $product = $cgi->param('product'); - trick_taint($name); - detaint_natural($product); - - my $env = Bugzilla::Testopia::Environment->new({'environment_id' => 0}); - - my $success = $env->store_environment_name($name, $product); - unless ($success){ - $vars->{'tr_error'} = "The environment name '$name' is already taken."; - $vars->{'environment'} = $env; - $template->process("testopia/environment/add.html.tmpl", $vars) - || print $template->error(); - exit; - } - $vars->{'tr_message'} = "The environment '$name' was successfully added."; - - $env = Bugzilla::Testopia::Environment->new($success); + trick_taint($name); + detaint_natural($product); + + my $env = Bugzilla::Testopia::Environment->new({'environment_id' => 0}); + + my $success = $env->store_environment_name($name, $product); + unless ($success){ + $vars->{'tr_error'} = "The environment name '$name' is already taken."; + $vars->{'environment'} = $env; + $template->process("testopia/environment/add.html.tmpl", $vars) + || print $template->error(); + exit; + } + $vars->{'tr_message'} = "The environment '$name' was successfully added."; + + $env = Bugzilla::Testopia::Environment->new($success); my $category = Bugzilla::Testopia::Environment::Category->new({'id' => 0}); if (Param('useclassification')){ $vars->{'allhaschild'} = $category->get_all_child_count; @@ -80,7 +80,7 @@ if ($action eq 'Add'){ $vars->{'environment'} = $env; $template->process("testopia/environment/show.html.tmpl", $vars) || print $template->error(); - + } else { diff --git a/mozilla/webtools/testopia/tr_show_environment.cgi b/mozilla/webtools/testopia/tr_show_environment.cgi index a7d63a83236..86758f64dfb 100755 --- a/mozilla/webtools/testopia/tr_show_environment.cgi +++ b/mozilla/webtools/testopia/tr_show_environment.cgi @@ -115,7 +115,6 @@ elsif ($action eq 'edit'){ elsif ($action eq 'getChildren'){ my $json = new JSON; - print STDERR $cgi->param('data'); my $data = $json->jsonToObj($cgi->param('data')); my $node = $data->{'node'};