From bf646df2bc21afc10dc0b074b13c8742ef43d461 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 2 Mar 2006 06:10:22 +0000 Subject: =?UTF-8?q?Bug=20311258:=20use=20objects=20in=20admin=20templates?= =?UTF-8?q?=20(products=20&=20co)=20-=20Patch=20by=20Andr=C3=A9=20Batosti?= =?UTF-8?q?=20=20r=3DLpSolit=20a=3Djustdave?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editversions.cgi | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'editversions.cgi') diff --git a/editversions.cgi b/editversions.cgi index be2c8a3c6..dc6992ba8 100755 --- a/editversions.cgi +++ b/editversions.cgi @@ -91,8 +91,7 @@ $user->can_see_product($product->name) unless ($action) { $vars->{'showbugcounts'} = $showbugcounts; - $vars->{'product'} = $product->name; - $vars->{'versions'} = $product->versions; + $vars->{'product'} = $product; $template->process("admin/versions/list.html.tmpl", $vars) || ThrowTemplateError($template->error()); @@ -111,7 +110,7 @@ unless ($action) { if ($action eq 'add') { - $vars->{'product'} = $product->name; + $vars->{'product'} = $product; $template->process("admin/versions/create.html.tmpl", $vars) || ThrowTemplateError($template->error()); @@ -148,8 +147,9 @@ if ($action eq 'new') { # Make versioncache flush unlink "$datadir/versioncache"; - $vars->{'name'} = $version_name; - $vars->{'product'} = $product->name; + $version = new Bugzilla::Version($product->id, $version_name); + $vars->{'version'} = $version; + $vars->{'product'} = $product; $template->process("admin/versions/created.html.tmpl", $vars) || ThrowTemplateError($template->error()); @@ -170,11 +170,9 @@ if ($action eq 'del') { my $version = Bugzilla::Version::check_version($product, $version_name); - my $bugs = $version->bug_count; - $vars->{'bug_count'} = $bugs; - $vars->{'name'} = $version->name; - $vars->{'product'} = $product->name; + $vars->{'version'} = $version; + $vars->{'product'} = $product; $template->process("admin/versions/confirm-delete.html.tmpl", $vars) || ThrowTemplateError($template->error()); @@ -205,8 +203,8 @@ if ($action eq 'delete') { unlink "$datadir/versioncache"; - $vars->{'name'} = $version->name; - $vars->{'product'} = $product->name; + $vars->{'version'} = $version; + $vars->{'product'} = $product; $template->process("admin/versions/deleted.html.tmpl", $vars) || ThrowTemplateError($template->error()); @@ -226,8 +224,8 @@ if ($action eq 'edit') { my $version = Bugzilla::Version::check_version($product, $version_name); - $vars->{'name'} = $version->name; - $vars->{'product'} = $product->name; + $vars->{'version'} = $version; + $vars->{'product'} = $product; $template->process("admin/versions/edit.html.tmpl", $vars) @@ -290,8 +288,11 @@ if ($action eq 'update') { $dbh->bz_unlock_tables(); - $vars->{'name'} = $version_name; - $vars->{'product'} = $product->name; + my $version = + Bugzilla::Version::check_version($product, + $version_name); + $vars->{'version'} = $version; + $vars->{'product'} = $product; $template->process("admin/versions/updated.html.tmpl", $vars) || ThrowTemplateError($template->error()); -- cgit v1.2.1