From 7f35993f73874ada96f7b01caef233a19ec122e7 Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Fri, 28 Mar 2008 21:56:33 +0000 Subject: [PATCH] can't add tags from "My Cases" git-svn-id: svn://10.0.0.236/trunk@248800 18797224-902f-48f8-a5cc-f745e15eee43 --- .../testopia/Bugzilla/Testopia/Category.pm | 15 ++++++++++++--- .../en/default/testopia/case/list.html.tmpl | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Category.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Category.pm index 598005a90e2..dfc405638f6 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Category.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Category.pm @@ -78,7 +78,7 @@ sub _check_product { } sub _check_name { - my ($invocant, $name, $product_id) = @_; + my ($invocant, $name, $product) = @_; $name = clean_text($name) if $name; if (!defined $name || $name eq '') { @@ -88,7 +88,7 @@ sub _check_name { trick_taint($name); # Check that we don't already have a build with that name in this product. - my $orig_id = check_case_category($name, $product_id); + my $orig_id = check_case_category($name, $product); my $notunique; if (ref $invocant){ @@ -112,7 +112,7 @@ sub _check_name { sub set_description { $_[0]->set('description', $_[1]); } sub set_name { my ($self, $value) = @_; - $value = $self->_check_name($value, $self->product_id); + $value = $self->_check_name($value, $self->product); $self->set('name', $value); } @@ -224,6 +224,15 @@ sub product_id { return $_[0]->{'product_id'}; } sub name { return $_[0]->{'name'}; } sub description { return $_[0]->{'description'}; } +sub product { + my ($self) = @_; + + return $self->{'product'} if exists $self->{'product'}; + + $self->{'product'} = Bugzilla::Testopia::Product->new($self->product_id); + return $self->{'product'}; +} + sub case_count { my ($self) = @_; my $dbh = Bugzilla->dbh; 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 b4a60acc114..51cc0dee3a0 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 @@ -28,6 +28,8 @@ [% PROCESS testopia/style.none.tmpl %] [% javascript_urls.push("testopia/js/case.js") %] +[% javascript_urls.push("testopia/js/tags.js") %] +[% javascript_urls.push("testopia/js/caserun.js") %] [% PROCESS global/header.html.tmpl %]