From ea094fc3805e3ec1ae2bb7fcffabcef64be31dc8 Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Tue, 17 Jun 2008 23:29:18 +0000 Subject: [PATCH] Multiple bug fixes git-svn-id: svn://10.0.0.236/trunk@252417 18797224-902f-48f8-a5cc-f745e15eee43 --- .../webtools/testopia/Bugzilla/Testopia/Search.pm | 4 ++++ .../testopia/code/post_bug-after_creation.pl | 8 ++++++-- .../links/testopia.html.tmpl | 8 ++++---- .../useful-links.html.tmpl/end/tr.html.tmpl | 8 ++++---- .../testopia/admin/plantypes/add.html.tmpl | 2 +- .../testopia/admin/plantypes/delete.html.tmpl | 2 +- .../testopia/admin/plantypes/edit.html.tmpl | 2 +- .../testopia/admin/plantypes/show.html.tmpl | 2 +- .../en/default/testopia/admin/show.html.tmpl | 2 +- .../default/testopia/attachment/choose.html.tmpl | 2 +- .../en/default/testopia/case/choose.html.tmpl | 2 +- .../en/default/testopia/case/list.html.tmpl | 1 + .../en/default/testopia/environment/add.html.tmpl | 2 +- .../testopia/environment/admin/show.html.tmpl | 2 +- .../default/testopia/environment/choose.html.tmpl | 2 +- .../default/testopia/environment/delete.html.tmpl | 2 +- .../default/testopia/environment/export.xml.tmpl | 2 +- .../default/testopia/environment/import.xml.tmpl | 2 +- .../default/testopia/environment/list.html.tmpl | 2 +- .../en/default/testopia/quicksearch.html.tmpl | 2 +- .../default/testopia/reports/bug-count.html.tmpl | 2 +- .../reports/bug-severity-status-form.html.tmpl | 2 +- .../testopia/reports/bug-stats-form.html.tmpl | 2 +- .../testopia/reports/build-coverage.html.tmpl | 2 +- .../testopia/reports/test-burnout-form.html.tmpl | 2 +- .../en/default/testopia/run/choose.html.tmpl | 2 +- .../en/default/testopia/tag/show.html.tmpl | 2 +- mozilla/webtools/testopia/testopia/js/case.js | 15 +++++++++++++-- mozilla/webtools/testopia/testopia/js/caserun.js | 1 + mozilla/webtools/testopia/testopia/js/run.js | 9 ++++----- mozilla/webtools/testopia/testopia/js/util.js | 3 ++- 31 files changed, 61 insertions(+), 40 deletions(-) diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm index 5cf168a38a0..91cb2237a10 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm @@ -389,6 +389,10 @@ sub init { push @supptables, "INNER JOIN test_case_plans AS case_plans ON test_cases.case_id = case_plans.case_id"; push @orderby, 'case_plans.plan_id'; } + elsif($order eq 'requirement' && $obj eq 'case_run'){ + push @supptables, "INNER JOIN test_cases ON test_cases.case_id = test_case_runs.case_id"; + push @orderby, 'test_cases.requirement'; + } elsif ($order eq 'priority') { if ($obj eq 'case_run'){ push @supptables, "INNER JOIN test_cases ON test_cases.case_id = test_case_runs.case_id"; diff --git a/mozilla/webtools/testopia/extensions/testopia/code/post_bug-after_creation.pl b/mozilla/webtools/testopia/extensions/testopia/code/post_bug-after_creation.pl index 19fce47fb3e..6b11e052f46 100644 --- a/mozilla/webtools/testopia/extensions/testopia/code/post_bug-after_creation.pl +++ b/mozilla/webtools/testopia/extensions/testopia/code/post_bug-after_creation.pl @@ -6,16 +6,20 @@ use Bugzilla::Testopia::TestCase; my $vars = Bugzilla->hook_args->{vars}; my $cgi = Bugzilla->cgi; -if ($cgi->param('case_id')) { +my $caserun_id = $cgi->param('caserun_id'); +my $case_id = $cgi->param('case_id'); +if (detaint_natural($case_id)) { my $case = Bugzilla::Testopia::TestCase->new($cgi->param('case_id')); + ThrowUserError("invalid-test-id-non-existent", {'id' => $case_id, 'type' => 'Case'}) unless $case; ThrowUserError("testopia-read-only", {'object' => $case}) unless $case->canedit; $case->attach_bug($vars->{'id'}); $vars->{'case'} = $case; } -if ($cgi->param('caserun_id')) { +if (detaint_natural($caserun_id)) { my $caserun = Bugzilla::Testopia::TestCaseRun->new($cgi->param('caserun_id')); + ThrowUserError("invalid-test-id-non-existent", {'id' => $caserun_id, 'type' => 'Case-Run'}) unless $caserun; ThrowUserError("testopia-read-only", {'object' => $caserun}) unless $caserun->canedit; $caserun->attach_bug($vars->{'id'}); diff --git a/mozilla/webtools/testopia/template/en/default/hook/global/common-links.html.tmpl/links/testopia.html.tmpl b/mozilla/webtools/testopia/template/en/default/hook/global/common-links.html.tmpl/links/testopia.html.tmpl index 88d0b57186b..2c17d7c1539 100644 --- a/mozilla/webtools/testopia/template/en/default/hook/global/common-links.html.tmpl/links/testopia.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/hook/global/common-links.html.tmpl/links/testopia.html.tmpl @@ -41,10 +41,10 @@