Commit bf646df2 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 311258: use objects in admin templates (products & co) - Patch by André…

Bug 311258: use objects in admin templates (products & co) - Patch by André Batosti <batosti@async.com.br> r=LpSolit a=justdave
parent 6efc4495
...@@ -96,8 +96,7 @@ $user->can_see_product($product->name) ...@@ -96,8 +96,7 @@ $user->can_see_product($product->name)
unless ($action) { unless ($action) {
$vars->{'showbugcounts'} = $showbugcounts; $vars->{'showbugcounts'} = $showbugcounts;
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
$vars->{'components'} = $product->components;
$template->process("admin/components/list.html.tmpl", $vars) $template->process("admin/components/list.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -113,7 +112,7 @@ unless ($action) { ...@@ -113,7 +112,7 @@ unless ($action) {
if ($action eq 'add') { if ($action eq 'add') {
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
$template->process("admin/components/create.html.tmpl", $vars) $template->process("admin/components/create.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -212,8 +211,12 @@ if ($action eq 'new') { ...@@ -212,8 +211,12 @@ if ($action eq 'new') {
# Make versioncache flush # Make versioncache flush
unlink "$datadir/versioncache"; unlink "$datadir/versioncache";
$vars->{'name'} = $comp_name; $component =
$vars->{'product'} = $product->name; new Bugzilla::Component({product_id => $product->id,
name => $comp_name});
$vars->{'comp'} = $component;
$vars->{'product'} = $product;
$template->process("admin/components/created.html.tmpl", $template->process("admin/components/created.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -234,7 +237,7 @@ if ($action eq 'del') { ...@@ -234,7 +237,7 @@ if ($action eq 'del') {
$vars->{'comp'} = $vars->{'comp'} =
Bugzilla::Component::check_component($product, $comp_name); Bugzilla::Component::check_component($product, $comp_name);
$vars->{'prod'} = $product; $vars->{'product'} = $product;
$template->process("admin/components/confirm-delete.html.tmpl", $vars) $template->process("admin/components/confirm-delete.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -264,9 +267,7 @@ if ($action eq 'delete') { ...@@ -264,9 +267,7 @@ if ($action eq 'delete') {
{nb => $component->bug_count }); {nb => $component->bug_count });
} }
} }
$vars->{'deleted_bug_count'} = $component->bug_count;
$dbh->bz_lock_tables('components WRITE', 'flaginclusions WRITE', $dbh->bz_lock_tables('components WRITE', 'flaginclusions WRITE',
'flagexclusions WRITE'); 'flagexclusions WRITE');
...@@ -281,8 +282,8 @@ if ($action eq 'delete') { ...@@ -281,8 +282,8 @@ if ($action eq 'delete') {
unlink "$datadir/versioncache"; unlink "$datadir/versioncache";
$vars->{'name'} = $component->name; $vars->{'comp'} = $component;
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
$template->process("admin/components/deleted.html.tmpl", $vars) $template->process("admin/components/deleted.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
exit; exit;
...@@ -301,7 +302,7 @@ if ($action eq 'edit') { ...@@ -301,7 +302,7 @@ if ($action eq 'edit') {
$vars->{'comp'} = $vars->{'comp'} =
Bugzilla::Component::check_component($product, $comp_name); Bugzilla::Component::check_component($product, $comp_name);
$vars->{'prod'} = $product; $vars->{'product'} = $product;
$template->process("admin/components/edit.html.tmpl", $template->process("admin/components/edit.html.tmpl",
$vars) $vars)
...@@ -379,7 +380,6 @@ if ($action eq 'update') { ...@@ -379,7 +380,6 @@ if ($action eq 'update') {
undef, ($description, $component_old->id)); undef, ($description, $component_old->id));
$vars->{'updated_description'} = 1; $vars->{'updated_description'} = 1;
$vars->{'description'} = $description;
} }
if ($default_assignee ne $component_old->default_assignee->login) { if ($default_assignee ne $component_old->default_assignee->login) {
...@@ -388,8 +388,6 @@ if ($action eq 'update') { ...@@ -388,8 +388,6 @@ if ($action eq 'update') {
undef, ($default_assignee_id, $component_old->id)); undef, ($default_assignee_id, $component_old->id));
$vars->{'updated_initialowner'} = 1; $vars->{'updated_initialowner'} = 1;
$vars->{'initialowner'} = $default_assignee;
} }
if (Param('useqacontact') if (Param('useqacontact')
...@@ -399,13 +397,14 @@ if ($action eq 'update') { ...@@ -399,13 +397,14 @@ if ($action eq 'update') {
($default_qa_contact_id, $component_old->id)); ($default_qa_contact_id, $component_old->id));
$vars->{'updated_initialqacontact'} = 1; $vars->{'updated_initialqacontact'} = 1;
$vars->{'initialqacontact'} = $default_qa_contact;
} }
$dbh->bz_unlock_tables(); $dbh->bz_unlock_tables();
$vars->{'name'} = $comp_name; my $component = new Bugzilla::Component($component_old->id);
$vars->{'product'} = $product->name;
$vars->{'comp'} = $component;
$vars->{'product'} = $product;
$template->process("admin/components/updated.html.tmpl", $template->process("admin/components/updated.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
......
...@@ -84,9 +84,7 @@ $user->can_see_product($product->name) ...@@ -84,9 +84,7 @@ $user->can_see_product($product->name)
unless ($action) { unless ($action) {
$vars->{'showbugcounts'} = $showbugcounts; $vars->{'showbugcounts'} = $showbugcounts;
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
$vars->{'milestones'} = $product->milestones;
$vars->{'default_milestone'} = $product->default_milestone;
$template->process("admin/milestones/list.html.tmpl", $template->process("admin/milestones/list.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -105,7 +103,7 @@ unless ($action) { ...@@ -105,7 +103,7 @@ unless ($action) {
if ($action eq 'add') { if ($action eq 'add') {
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
$template->process("admin/milestones/create.html.tmpl", $template->process("admin/milestones/create.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -149,8 +147,10 @@ if ($action eq 'new') { ...@@ -149,8 +147,10 @@ if ($action eq 'new') {
# Make versioncache flush # Make versioncache flush
unlink "$datadir/versioncache"; unlink "$datadir/versioncache";
$vars->{'name'} = $milestone_name; $milestone = new Bugzilla::Milestone($product->id,
$vars->{'product'} = $product->name; $milestone_name);
$vars->{'milestone'} = $milestone;
$vars->{'product'} = $product;
$template->process("admin/milestones/created.html.tmpl", $template->process("admin/milestones/created.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -171,16 +171,14 @@ if ($action eq 'del') { ...@@ -171,16 +171,14 @@ if ($action eq 'del') {
my $milestone = Bugzilla::Milestone::check_milestone($product, my $milestone = Bugzilla::Milestone::check_milestone($product,
$milestone_name); $milestone_name);
$vars->{'name'} = $milestone->name; $vars->{'milestone'} = $milestone;
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
# The default milestone cannot be deleted. # The default milestone cannot be deleted.
if ($product->default_milestone eq $milestone->name) { if ($product->default_milestone eq $milestone->name) {
ThrowUserError("milestone_is_default", $vars); ThrowUserError("milestone_is_default", $vars);
} }
$vars->{'bug_count'} = $milestone->bug_count;
$template->process("admin/milestones/confirm-delete.html.tmpl", $vars) $template->process("admin/milestones/confirm-delete.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
exit; exit;
...@@ -197,23 +195,21 @@ if ($action eq 'delete') { ...@@ -197,23 +195,21 @@ if ($action eq 'delete') {
my $milestone = my $milestone =
Bugzilla::Milestone::check_milestone($product, Bugzilla::Milestone::check_milestone($product,
$milestone_name); $milestone_name);
$vars->{'name'} = $milestone->name; $vars->{'milestone'} = $milestone;
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
# The default milestone cannot be deleted. # The default milestone cannot be deleted.
if ($milestone->name eq $product->default_milestone) { if ($milestone->name eq $product->default_milestone) {
ThrowUserError("milestone_is_default", $vars); ThrowUserError("milestone_is_default", $vars);
} }
# We don't want to delete bugs when deleting a milestone. if ($milestone->bug_count) {
# Bugs concerned are reassigned to the default milestone. # We don't want to delete bugs when deleting a milestone.
my $bug_ids = # Bugs concerned are reassigned to the default milestone.
$dbh->selectcol_arrayref("SELECT bug_id FROM bugs my $bug_ids =
WHERE product_id = ? AND target_milestone = ?", $dbh->selectcol_arrayref("SELECT bug_id FROM bugs
undef, ($product->id, $milestone->name)); WHERE product_id = ? AND target_milestone = ?",
undef, ($product->id, $milestone->name));
my $nb_bugs = scalar(@$bug_ids);
if ($nb_bugs) {
my $timestamp = $dbh->selectrow_array("SELECT NOW()"); my $timestamp = $dbh->selectrow_array("SELECT NOW()");
foreach my $bug_id (@$bug_ids) { foreach my $bug_id (@$bug_ids) {
$dbh->do("UPDATE bugs SET target_milestone = ?, $dbh->do("UPDATE bugs SET target_milestone = ?,
...@@ -228,8 +224,6 @@ if ($action eq 'delete') { ...@@ -228,8 +224,6 @@ if ($action eq 'delete') {
} }
} }
$vars->{'bug_count'} = $nb_bugs;
$dbh->do("DELETE FROM milestones WHERE product_id = ? AND value = ?", $dbh->do("DELETE FROM milestones WHERE product_id = ? AND value = ?",
undef, ($product->id, $milestone->name)); undef, ($product->id, $milestone->name));
...@@ -254,9 +248,8 @@ if ($action eq 'edit') { ...@@ -254,9 +248,8 @@ if ($action eq 'edit') {
Bugzilla::Milestone::check_milestone($product, Bugzilla::Milestone::check_milestone($product,
$milestone_name); $milestone_name);
$vars->{'sortkey'} = $milestone->sortkey; $vars->{'milestone'} = $milestone;
$vars->{'name'} = $milestone->name; $vars->{'product'} = $product;
$vars->{'product'} = $product->name;
$template->process("admin/milestones/edit.html.tmpl", $template->process("admin/milestones/edit.html.tmpl",
$vars) $vars)
...@@ -301,7 +294,6 @@ if ($action eq 'update') { ...@@ -301,7 +294,6 @@ if ($action eq 'update') {
unlink "$datadir/versioncache"; unlink "$datadir/versioncache";
$vars->{'updated_sortkey'} = 1; $vars->{'updated_sortkey'} = 1;
$vars->{'sortkey'} = $sortkey;
} }
if ($milestone_name ne $milestone_old->name) { if ($milestone_name ne $milestone_old->name) {
...@@ -352,8 +344,11 @@ if ($action eq 'update') { ...@@ -352,8 +344,11 @@ if ($action eq 'update') {
$dbh->bz_unlock_tables(); $dbh->bz_unlock_tables();
$vars->{'name'} = $milestone_name; my $milestone =
$vars->{'product'} = $product->name; Bugzilla::Milestone::check_milestone($product,
$milestone_name);
$vars->{'milestone'} = $milestone;
$vars->{'product'} = $product;
$template->process("admin/milestones/updated.html.tmpl", $template->process("admin/milestones/updated.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
......
...@@ -91,8 +91,7 @@ $user->can_see_product($product->name) ...@@ -91,8 +91,7 @@ $user->can_see_product($product->name)
unless ($action) { unless ($action) {
$vars->{'showbugcounts'} = $showbugcounts; $vars->{'showbugcounts'} = $showbugcounts;
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
$vars->{'versions'} = $product->versions;
$template->process("admin/versions/list.html.tmpl", $template->process("admin/versions/list.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -111,7 +110,7 @@ unless ($action) { ...@@ -111,7 +110,7 @@ unless ($action) {
if ($action eq 'add') { if ($action eq 'add') {
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
$template->process("admin/versions/create.html.tmpl", $template->process("admin/versions/create.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -148,8 +147,9 @@ if ($action eq 'new') { ...@@ -148,8 +147,9 @@ if ($action eq 'new') {
# Make versioncache flush # Make versioncache flush
unlink "$datadir/versioncache"; unlink "$datadir/versioncache";
$vars->{'name'} = $version_name; $version = new Bugzilla::Version($product->id, $version_name);
$vars->{'product'} = $product->name; $vars->{'version'} = $version;
$vars->{'product'} = $product;
$template->process("admin/versions/created.html.tmpl", $template->process("admin/versions/created.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -170,11 +170,9 @@ if ($action eq 'del') { ...@@ -170,11 +170,9 @@ if ($action eq 'del') {
my $version = Bugzilla::Version::check_version($product, my $version = Bugzilla::Version::check_version($product,
$version_name); $version_name);
my $bugs = $version->bug_count;
$vars->{'bug_count'} = $bugs; $vars->{'version'} = $version;
$vars->{'name'} = $version->name; $vars->{'product'} = $product;
$vars->{'product'} = $product->name;
$template->process("admin/versions/confirm-delete.html.tmpl", $template->process("admin/versions/confirm-delete.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -205,8 +203,8 @@ if ($action eq 'delete') { ...@@ -205,8 +203,8 @@ if ($action eq 'delete') {
unlink "$datadir/versioncache"; unlink "$datadir/versioncache";
$vars->{'name'} = $version->name; $vars->{'version'} = $version;
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
$template->process("admin/versions/deleted.html.tmpl", $vars) $template->process("admin/versions/deleted.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -226,8 +224,8 @@ if ($action eq 'edit') { ...@@ -226,8 +224,8 @@ if ($action eq 'edit') {
my $version = Bugzilla::Version::check_version($product, my $version = Bugzilla::Version::check_version($product,
$version_name); $version_name);
$vars->{'name'} = $version->name; $vars->{'version'} = $version;
$vars->{'product'} = $product->name; $vars->{'product'} = $product;
$template->process("admin/versions/edit.html.tmpl", $template->process("admin/versions/edit.html.tmpl",
$vars) $vars)
...@@ -290,8 +288,11 @@ if ($action eq 'update') { ...@@ -290,8 +288,11 @@ if ($action eq 'update') {
$dbh->bz_unlock_tables(); $dbh->bz_unlock_tables();
$vars->{'name'} = $version_name; my $version =
$vars->{'product'} = $product->name; Bugzilla::Version::check_version($product,
$version_name);
$vars->{'version'} = $version;
$vars->{'product'} = $product;
$template->process("admin/versions/updated.html.tmpl", $template->process("admin/versions/updated.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
[%# INTERFACE: [%# INTERFACE:
# comp: object; Bugzilla::Component object representing the component the # comp: object; Bugzilla::Component object representing the component the
# user wants to delete. # user wants to delete.
# prod: object; Bugzilla::Product object representing the product to # product: object; Bugzilla::Product object representing the product to
# which the component belongs. # which the component belongs.
#%] #%]
[% title = BLOCK %]Delete Component of Product '[% prod.name FILTER html %]' [% title = BLOCK %]Delete Component of Product '[% product.name FILTER html %]'
[% END %] [% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
...@@ -60,13 +60,13 @@ ...@@ -60,13 +60,13 @@
</tr> </tr>
<tr> <tr>
<td valign="top">Component of Product:</td> <td valign="top">Component of Product:</td>
<td valign="top">[% prod.name FILTER html %]</td> <td valign="top">[% product.name FILTER html %]</td>
[% IF prod.description %] [% IF product.description %]
</tr> </tr>
<tr> <tr>
<td valign="top">Product Description:</td> <td valign="top">Product Description:</td>
<td valign="top">[% prod.description FILTER html %]</td> <td valign="top">[% product.description FILTER html %]</td>
[% END %] [% END %]
[% IF Param('usetargetmilestone') %] [% IF Param('usetargetmilestone') %]
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
<tr> <tr>
<td valign="top">Product Milestone URL:</td> <td valign="top">Product Milestone URL:</td>
<td valign="top"> <td valign="top">
<a href="[% prod.milestone_url FILTER uri %]"> <a href="[% product.milestone_url FILTER uri %]">
[% prod.milestone_url FILTER html %] [% product.milestone_url FILTER html %]
</a> </a>
</td> </td>
[% END %] [% END %]
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</tr> </tr>
<tr> <tr>
<TD VALIGN="top">Closed for [% terms.bugs %]:</TD> <TD VALIGN="top">Closed for [% terms.bugs %]:</TD>
<TD VALIGN="top">[% IF prod.disallow_new %]Yes[% ELSE %]No[% END %]</td> <TD VALIGN="top">[% IF product.disallow_new %]Yes[% ELSE %]No[% END %]</td>
</tr> </tr>
<tr> <tr>
<td valign="top">[% terms.Bugs %]:</td> <td valign="top">[% terms.Bugs %]:</td>
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
[% IF comp.bug_count %] [% IF comp.bug_count %]
<a title="List of [% terms.bugs %] for component '[% comp.name FILTER html %]'" <a title="List of [% terms.bugs %] for component '[% comp.name FILTER html %]'"
href="buglist.cgi?component=[% comp.name FILTER url_quote %]&amp;product= href="buglist.cgi?component=[% comp.name FILTER url_quote %]&amp;product=
[%- prod.name FILTER url_quote %]">[% comp.bug_count %]</a> [%- product.name FILTER url_quote %]">[% comp.bug_count %]</a>
[% ELSE %] [% ELSE %]
None None
[% END %] [% END %]
...@@ -148,15 +148,12 @@ ...@@ -148,15 +148,12 @@
<form method="post" action="editcomponents.cgi"> <form method="post" action="editcomponents.cgi">
<input type="submit" value="Yes, delete"> <input type="submit" value="Yes, delete">
<input type="hidden" name="action" value="delete"> <input type="hidden" name="action" value="delete">
<input type="hidden" name="product" value="[% prod.name FILTER html %]"> <input type="hidden" name="product" value="[% product.name FILTER html %]">
<input type="hidden" name="component" value="[% comp.name FILTER html %]"> <input type="hidden" name="component" value="[% comp.name FILTER html %]">
</form> </form>
[% END %] [% END %]
[% PROCESS admin/components/footer.html.tmpl [% PROCESS admin/components/footer.html.tmpl %]
name = comp.name
product = prod.name
%]
[% PROCESS global/footer.html.tmpl %] [% PROCESS global/footer.html.tmpl %]
...@@ -20,12 +20,13 @@ ...@@ -20,12 +20,13 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# product: string; name of product # product: object; Bugzilla::Product object representing the product to
# which the component belongs.
#%] #%]
[% title = BLOCK %]Add component to Product '[% product FILTER html %]'[% END %] [% title = BLOCK %]Add component to Product '[% product.name FILTER html %]'[% END %]
[% h2 = BLOCK %]This page allows you to add a new component to product [% h2 = BLOCK %]This page allows you to add a new component to product
'[% product FILTER html %]'.[% END %] '[% product.name FILTER html %]'.[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
h2 = h2 h2 = h2
...@@ -81,7 +82,7 @@ ...@@ -81,7 +82,7 @@
<input type="hidden" name="action" value="new"> <input type="hidden" name="action" value="new">
<input type="hidden" name='open_name' value='All Open'> <input type="hidden" name='open_name' value='All Open'>
<input type="hidden" name='nonopen_name' value='All Closed'> <input type="hidden" name='nonopen_name' value='All Closed'>
<input type="hidden" name='product' value="[% product FILTER html %]"> <input type="hidden" name='product' value="[% product.name FILTER html %]">
</form> </form>
......
...@@ -20,20 +20,21 @@ ...@@ -20,20 +20,21 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the newly created component # comp: object; Bugzilla::Component object representing the component the
# # user created.
# product: string; the name of the product the component belongs to # product: object; Bugzilla::Product object representing the product to
# which the component belongs.
#%] #%]
[% title = BLOCK %]Adding new Component of Product [% title = BLOCK %]Adding new Component of Product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
<p>The component '<a href="editcomponents.cgi?action=edit&amp;product= <p>The component '<a href="editcomponents.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]&amp;component=[% name FILTER url_quote %]"> [%- product.name FILTER url_quote %]&amp;component=[% comp.name FILTER url_quote %]">
[%- name FILTER html %]</a>' has been created.</p> [%- comp.name FILTER html %]</a>' has been created.</p>
[% PROCESS admin/components/footer.html.tmpl %] [% PROCESS admin/components/footer.html.tmpl %]
......
...@@ -20,27 +20,25 @@ ...@@ -20,27 +20,25 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the deleted component. # comp: object; Bugzilla::Component object representing the component the
# # user deleted.
# product: string; the name of the product the component belonged to # product: object; Bugzilla::Product object representing the product to
# # which the component belongs.
# deleted_bug_count: number; the number of bugs which were deleted
# (if bug deletion is allowed)
#%] #%]
[% title = BLOCK %]Deleted Component '[% name FILTER html %]' from Product [% title = BLOCK %]Deleted Component '[% comp.name FILTER html %]' from Product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
<p> <p>
[% IF deleted_bug_count %] [% IF comp.bug_count %]
[% deleted_bug_count %] [% comp.bug_count FILTER none %]
[%- IF deleted_bug_count > 1 %] [%- IF comp.bug_count > 1 %]
[% terms.bugs %] [%+ terms.bugs %]
[% ELSE %] [% ELSE %]
[% terms.bug %] [%+ terms.bug %]
[% END %] [% END %]
deleted. deleted.
</p><p> </p><p>
...@@ -52,7 +50,7 @@ ...@@ -52,7 +50,7 @@
<p>Flag inclusions and exclusions deleted.</p> <p>Flag inclusions and exclusions deleted.</p>
<p>Component '[% name FILTER html %]' deleted.</p> <p>Component '[% comp.name FILTER html %]' deleted.</p>
[% PROCESS admin/components/footer.html.tmpl [% PROCESS admin/components/footer.html.tmpl
no_edit_component_link = 1 no_edit_component_link = 1
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
[%# INTERFACE: [%# INTERFACE:
# comp: object; Bugzilla::Component object representing the component the # comp: object; Bugzilla::Component object representing the component the
# user wants to edit. # user wants to edit.
# prod: object; Bugzilla::Product object representing the product to # product: object; Bugzilla::Product object representing the product to
# which the component belongs. # which the component belongs.
#%] #%]
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<a title="Bugs in component '[% comp.name FILTER html %]'" <a title="Bugs in component '[% comp.name FILTER html %]'"
href="buglist.cgi?component= href="buglist.cgi?component=
[%- comp.name FILTER url_quote %]&amp;product= [%- comp.name FILTER url_quote %]&amp;product=
[%- prod.name FILTER url_quote %]">[% comp.bug_count %]</a> [%- product.name FILTER url_quote %]">[% comp.bug_count %]</a>
[% ELSE %] [% ELSE %]
None None
[% END %] [% END %]
...@@ -99,18 +99,16 @@ ...@@ -99,18 +99,16 @@
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" name="componentold" value="[% comp.name FILTER html %]"> <input type="hidden" name="componentold" value="[% comp.name FILTER html %]">
<input type="hidden" name="product" value="[% prod.name FILTER html %]"> <input type="hidden" name="product" value="[% product.name FILTER html %]">
<input type="submit" value="Update"> or <a <input type="submit" value="Update"> or <a
href="editcomponents.cgi?action=del&amp;product= href="editcomponents.cgi?action=del&amp;product=
[%- prod.name FILTER url_quote %]&amp;component= [%- product.name FILTER url_quote %]&amp;component=
[%- comp.name FILTER url_quote %]">Delete</a> this component. [%- comp.name FILTER url_quote %]">Delete</a> this component.
</form> </form>
[% PROCESS admin/components/footer.html.tmpl [% PROCESS admin/components/footer.html.tmpl
no_edit_component_link = 1 no_edit_component_link = 1
name = comp.name
product = prod.name
%] %]
[% PROCESS global/footer.html.tmpl %] [% PROCESS global/footer.html.tmpl %]
...@@ -20,10 +20,9 @@ ...@@ -20,10 +20,9 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the component # comp: object; Bugzilla::Component object representing the component
# # product: object; Bugzilla::Product object representing the product to
# product: string; the name of the product which the component # which the component belongs.
# belongs/belonged to
#%] #%]
<p> <p>
...@@ -31,26 +30,26 @@ ...@@ -31,26 +30,26 @@
<hr> <hr>
Edit Edit
[% IF name && !no_edit_component_link %] [% IF comp && !no_edit_component_link %]
component <a component <a
title="Edit Component '[% name FILTER html %]'" title="Edit Component '[% comp.name FILTER html %]'"
href="editcomponents.cgi?action=edit&amp;product= href="editcomponents.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]&amp;component=[% name FILTER url_quote %]"> [%- product.name FILTER url_quote %]&amp;component=[% comp.name FILTER url_quote %]">
'[% name FILTER html %]'</a> '[% comp.name FILTER html %]'</a>
or edit or edit
[% END %] [% END %]
[% IF !no_edit_other_components_link %] [% IF !no_edit_other_components_link %]
other components of product <a other components of product <a
title="Choose a component from product '[% product FILTER html %]' to edit" title="Choose a component from product '[% product.name FILTER html %]' to edit"
href="editcomponents.cgi?product= href="editcomponents.cgi?product=
[%- product FILTER url_quote %]">'[% product FILTER html %]'</a>, [%- product.name FILTER url_quote %]">'[% product.name FILTER html %]'</a>,
or edit or edit
[% END %] [% END %]
product <a product <a
title="Edit Product '[% product FILTER html %]'" title="Edit Product '[% product.name FILTER html %]'"
href="editproducts.cgi?action=edit&amp;product= href="editproducts.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]">'[% product FILTER html %]'</a>. [%- product.name FILTER url_quote %]">'[% product.name FILTER html %]'</a>.
</p> </p>
...@@ -21,25 +21,25 @@ ...@@ -21,25 +21,25 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# components: array of component objects
# showbugcounts: if defined, then bug counts should be included in the table # showbugcounts: if defined, then bug counts should be included in the table
# product: string; the name of the product we are editing components for # product: object; Bugzilla::Product object representing the product to
# which the component belongs.
#%] #%]
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% title = BLOCK %]Select component of product [% title = BLOCK %]Select component of product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
[% edit_contentlink = BLOCK %]editcomponents.cgi?action=edit&amp;product= [% edit_contentlink = BLOCK %]editcomponents.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]&amp;component=%%name%%[% END %] [%- product.name FILTER url_quote %]&amp;component=%%name%%[% END %]
[% delete_contentlink = BLOCK %]editcomponents.cgi?action=del&amp;product= [% delete_contentlink = BLOCK %]editcomponents.cgi?action=del&amp;product=
[%- product FILTER url_quote %]&amp;component=%%name%%[% END %] [%- product.name FILTER url_quote %]&amp;component=%%name%%[% END %]
[% bug_count_contentlink = BLOCK %]buglist.cgi?component=%%name%%&amp;product= [% bug_count_contentlink = BLOCK %]buglist.cgi?component=%%name%%&amp;product=
[%- product FILTER url_quote %][% END %] [%- product.name FILTER url_quote %][% END %]
[% columns = [ [% columns = [
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
[% overrides.initialowner = [] %] [% overrides.initialowner = [] %]
[% overrides.initialqacontact = [] %] [% overrides.initialqacontact = [] %]
[% FOREACH component = components %] [% FOREACH component = product.components %]
[% overrides.initialowner.push({ [% overrides.initialowner.push({
match_value => component.name match_value => component.name
match_field => 'name' match_field => 'name'
...@@ -109,16 +109,16 @@ ...@@ -109,16 +109,16 @@
[% PROCESS admin/table.html.tmpl [% PROCESS admin/table.html.tmpl
columns = columns columns = columns
data = components data = product.components
overrides = overrides overrides = overrides
%] %]
<p><a href="editcomponents.cgi?action=add&amp;product=[% product FILTER url_quote %]">Add</a> <p><a href="editcomponents.cgi?action=add&amp;product=[% product.name FILTER url_quote %]">Add</a>
a new component to product '[% product FILTER html %]'</p> a new component to product '[% product.name FILTER html %]'</p>
[% IF ! showbugcounts %] [% IF ! showbugcounts %]
<p><a href="editcomponents.cgi?product=[% product FILTER url_quote %]&amp;showbugcounts=1"> <p><a href="editcomponents.cgi?product=[% product.name FILTER url_quote %]&amp;showbugcounts=1">
Redisplay table with [% terms.bug %] counts (slower)</a></p> Redisplay table with [% terms.bug %] counts (slower)</a></p>
[% END %] [% END %]
......
...@@ -23,22 +23,23 @@ ...@@ -23,22 +23,23 @@
# #
# 'updated_XXX' variables are booleans, and are defined if the # 'updated_XXX' variables are booleans, and are defined if the
# 'XXX' field was updated during the edit just being handled. # 'XXX' field was updated during the edit just being handled.
# Variables called just 'XXX' are strings, and are the _new_ contents
# of the fields.
# #
# name & updated_name: the name of the component # updated_name: the name of the component updated
# #
# description & updated_description: the component description # updated_description: the component description updated
# #
# initialowner & updated_initialowner: the default assignee # updated_initialowner: the default assignee updated
# #
# initialqacontact & updated_initialqacontact: the default qa contact # updated_initialqacontact: the default qa contact updated
# #
# product: string; the name of the product the component belongs to # comp: object; Bugzilla::Component object representing the component
# user updated.
# product: object; Bugzilla::Product object representing the product to
# which the component belongs.
#%] #%]
[% title = BLOCK %]Updating Component '[% name FILTER html %]' of Product [% title = BLOCK %]Updating Component '[% comp.name FILTER html %]' of Product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
...@@ -48,19 +49,19 @@ ...@@ -48,19 +49,19 @@
<table> <table>
<tr> <tr>
<td>Updated description to:</td> <td>Updated description to:</td>
<td>'[% description FILTER html %]'</td> <td>'[% comp.description FILTER html %]'</td>
</tr> </tr>
</table> </table>
[% END %] [% END %]
[% IF updated_initialowner %] [% IF updated_initialowner %]
<p>Updated Default Assignee to: '[% initialowner FILTER html %]'.</p> <p>Updated Default Assignee to: '[% comp.initialowner FILTER html %]'.</p>
[% END %] [% END %]
[% IF updated_initialqacontact %] [% IF updated_initialqacontact %]
<p> <p>
[% IF initialqacontact %] [% IF initialqacontact %]
Updated Default QA Contact to '[% initialqacontact FILTER html %]'. Updated Default QA Contact to '[% comp.initialqacontact FILTER html %]'.
[% ELSE %] [% ELSE %]
Removed Default QA Contact. Removed Default QA Contact.
[% END %] [% END %]
...@@ -68,12 +69,12 @@ ...@@ -68,12 +69,12 @@
[% END %] [% END %]
[% IF updated_name %] [% IF updated_name %]
<p>Updated Component name to: '[% name FILTER html %]'.</p> <p>Updated Component name to: '[% comp.name FILTER html %]'.</p>
[% END %] [% END %]
[% UNLESS updated_description || updated_initialowner || [% UNLESS updated_description || updated_initialowner ||
updated_initialqacontact || updated_name %] updated_initialqacontact || updated_name %]
<p>Nothing changed for component '[% name FILTER html %]'. <p>Nothing changed for component '[% comp.name FILTER html %]'.
[% END %] [% END %]
......
...@@ -21,15 +21,13 @@ ...@@ -21,15 +21,13 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; The name of the milestone # product: object; Bugzilla::Product object representing the product to
# # which the milestone belongs.
# bug_count: number; The number of bugs targetted at the milestone # milestone: object; Bugzilla::Milestone object representing the
# # milestone the user wants to delete.
# product: string; The name of the product
#
#%] #%]
[% title = BLOCK %]Delete Milestone of Product '[% product FILTER html %]' [% title = BLOCK %]Delete Milestone of Product '[% product.name FILTER html %]'
[% END %] [% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
...@@ -43,20 +41,21 @@ ...@@ -43,20 +41,21 @@
</tr> </tr>
<tr> <tr>
<td valign="top">Milestone:</td> <td valign="top">Milestone:</td>
<td valign="top">[% name FILTER html %]</td> <td valign="top">[% milestone.name FILTER html %]</td>
</tr> </tr>
<tr> <tr>
<td valign="top">Milestone of Product:</td> <td valign="top">Milestone of Product:</td>
<td valign="top">[% product FILTER html %]</td> <td valign="top">[% product.name FILTER html %]</td>
</tr> </tr>
<tr> <tr>
<td valign="top">[% terms.Bugs %]:</td> <td valign="top">[% terms.Bugs %]:</td>
<td valign="top"> <td valign="top">
[% IF bug_count %] [% IF milestone.bug_count %]
<a title="List of [% terms.bugs %] targetted at milestone ' <a title="List of [% terms.bugs %] targetted at milestone '
[% name FILTER html %]'" [% milestone.name FILTER html %]'"
href="buglist.cgi?target_milestone=[% name FILTER url_quote %]&amp;product= href="buglist.cgi?target_milestone=[% milestone.name FILTER url_quote %]&amp;product=
[%- product FILTER url_quote %]">[% bug_count %]</a> [%- product.name FILTER url_quote %]">
[% milestone.bug_count FILTER none %]</a>
[% ELSE %] [% ELSE %]
None None
[% END %] [% END %]
...@@ -66,13 +65,13 @@ ...@@ -66,13 +65,13 @@
<h2>Confirmation</h2> <h2>Confirmation</h2>
[% IF bug_count %] [% IF milestone.bug_count %]
<table border="0" cellpadding="20" width="70%" bgcolor="red"> <table border="0" cellpadding="20" width="70%" bgcolor="red">
<tr><td> <tr><td>
There There
[% IF bug_count > 1 %] [% IF milestone.bug_count > 1 %]
are [% bug_count %] [%+ terms.bugs %] are [% milestone.bug_count FILTER none %] [%+ terms.bugs %]
[% ELSE %] [% ELSE %]
is 1 [% terms.bug %] is 1 [% terms.bug %]
[% END %] [% END %]
...@@ -89,8 +88,8 @@ ...@@ -89,8 +88,8 @@
<form method="post" action="editmilestones.cgi"> <form method="post" action="editmilestones.cgi">
<input type="submit" value="Yes, delete"> <input type="submit" value="Yes, delete">
<input type="hidden" name="action" value="delete"> <input type="hidden" name="action" value="delete">
<input type="hidden" name="product" value="[% product FILTER html %]"> <input type="hidden" name="product" value="[% product.name FILTER html %]">
<input type="hidden" name="milestone" value="[% name FILTER html %]"> <input type="hidden" name="milestone" value="[% milestone.name FILTER html %]">
</form> </form>
[% PROCESS admin/milestones/footer.html.tmpl %] [% PROCESS admin/milestones/footer.html.tmpl %]
......
...@@ -20,12 +20,13 @@ ...@@ -20,12 +20,13 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# product: string; name of the product the milestone is being created for # product: object; Bugzilla::Product object representing the product to
# which the milestone belongs.
#%] #%]
[% title = BLOCK %]Add Milestone to Product '[% product FILTER html %]'[% END %] [% title = BLOCK %]Add Milestone to Product '[% product.name FILTER html %]'[% END %]
[% h2 = BLOCK %]This page allows you to add a new milestone to product [% h2 = BLOCK %]This page allows you to add a new milestone to product
'[% product FILTER html %]'.[% END %] '[% product.name FILTER html %]'.[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
h2 = h2 h2 = h2
...@@ -47,7 +48,7 @@ ...@@ -47,7 +48,7 @@
</table> </table>
<input type="submit" value="Add"> <input type="submit" value="Add">
<input type="hidden" name="action" value="new"> <input type="hidden" name="action" value="new">
<input type="hidden" name='product' value="[% product FILTER html %]"> <input type="hidden" name='product' value="[% product.name FILTER html %]">
</form> </form>
......
...@@ -20,22 +20,24 @@ ...@@ -20,22 +20,24 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the newly created milestone # milestone: object; Bugzilla::Milestone object representing the
# milestone the user created.
# #
# product: string; the name of the product the milestone belongs to # product: object; Bugzilla::Product object representing the product to
# which the milestone belongs.
#%] #%]
[% title = BLOCK %]Adding new Milestone of Product [% title = BLOCK %]Adding new Milestone of Product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
<p>The milestone '<a title="Edit milestone '[% name FILTER html %]' of <p>The milestone '<a title="Edit milestone '[% milestone.name FILTER html %]' of
product '[% product FILTER html %]'" product '[% product.name FILTER html %]'"
href="editmilestones.cgi?action=edit&amp;product= href="editmilestones.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]&amp;milestone=[% name FILTER url_quote %]"> [%- product.name FILTER url_quote %]&amp;milestone=[% milestone.name FILTER url_quote %]">
[%- name FILTER html %]</a>' has been created.</p> [%- milestone.name FILTER html %]</a>' has been created.</p>
<p> <p>
......
...@@ -21,25 +21,23 @@ ...@@ -21,25 +21,23 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the deleted milestone. # product: object; Bugzilla::Product object representing the product to
# # which the milestone belongs.
# product: string; the name of the product the milestone belonged to # milestone: object; Bugzilla::Milestone object representing the
# # milestone the user deleted.
# bug_count: number; the number of bugs which were reassigned to
# the default milestone.
#%] #%]
[% title = BLOCK %]Deleted Milestone '[% name FILTER html %]' of Product [% title = BLOCK %]Deleted Milestone '[% milestone.name FILTER html %]' of Product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
<p> <p>
[% IF bug_count %] [% IF milestone.bug_count %]
[% bug_count %] [% milestone.bug_count FILTER none %]
[% IF bug_count > 1 %] [% IF milestone.bug_count > 1 %]
[%+ terms.bugs %] [%+ terms.bugs %]
[% ELSE %] [% ELSE %]
[%+ terms.bug %] [%+ terms.bug %]
...@@ -51,7 +49,7 @@ ...@@ -51,7 +49,7 @@
[% END %] [% END %]
</p> </p>
<p>Milestone '[% name FILTER html %]' deleted.</p> <p>Milestone '[% milestone.name FILTER html %]' deleted.</p>
<p> <p>
......
...@@ -20,17 +20,16 @@ ...@@ -20,17 +20,16 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; The name of the milestone # product: object; Bugzilla::Product object representing the product to
# # which the milestone belongs.
# sortkey: number; milestone sortkey # milestone: object; Bugzilla::Milestone object representing the
# # milestone the user wants to edit.
# product: string; The product the milestone belongs to
#%] #%]
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% title = BLOCK %]Edit Milestone '[% name FILTER html %]' of product ' [% title = BLOCK %]Edit Milestone '[% milestone.name FILTER html %]' of product '
[%- product FILTER html %]'[% END %] [%- product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
onload = "document.forms['f'].milestone.select()" onload = "document.forms['f'].milestone.select()"
...@@ -42,19 +41,19 @@ ...@@ -42,19 +41,19 @@
<tr> <tr>
<th valign="top"><label for="milestone">Milestone:</label></th> <th valign="top"><label for="milestone">Milestone:</label></th>
<td><input id="milestone" size="20" maxlength="20" name="milestone" value=" <td><input id="milestone" size="20" maxlength="20" name="milestone" value="
[%- name FILTER html %]"></td> [%- milestone.name FILTER html %]"></td>
</tr> </tr>
<tr> <tr>
<th align="right"><label for="sortkey">Sortkey:</label></th> <th align="right"><label for="sortkey">Sortkey:</label></th>
<td><input id="sortkey" size="20" maxlength="20" name="sortkey" value=" <td><input id="sortkey" size="20" maxlength="20" name="sortkey" value="
[%- sortkey FILTER html %]"></td> [%- milestone.sortkey FILTER html %]"></td>
</tr> </tr>
</table> </table>
<input type="hidden" name="milestoneold" value="[% name FILTER html %]"> <input type="hidden" name="milestoneold" value="[% milestone.name FILTER html %]">
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" name="product" value="[% product FILTER html %]"> <input type="hidden" name="product" value="[% product.name FILTER html %]">
<input type="submit" value="Update"> <input type="submit" value="Update">
</form> </form>
......
...@@ -20,10 +20,11 @@ ...@@ -20,10 +20,11 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the milestone # product: object; Bugzilla::Product object representing the product to
# which the milestone belongs.
# #
# product: string; the name of the product which the milestone # milestone: object; Bugzilla::Milestone object representing the
# belongs/belonged to # milestone.
# #
# no_XXX_link: boolean; if defined, then don't show the corresponding # no_XXX_link: boolean; if defined, then don't show the corresponding
# link. Supported parameters are: # link. Supported parameters are:
...@@ -38,29 +39,30 @@ ...@@ -38,29 +39,30 @@
<hr> <hr>
[% UNLESS no_add_milestone_link %] [% UNLESS no_add_milestone_link %]
<a title="Add a milestone to product '[% product FILTER html %]'" <a title="Add a milestone to product '[% product.name FILTER html %]'"
href="editmilestones.cgi?action=add&amp;product= href="editmilestones.cgi?action=add&amp;product=
[%- product FILTER url_quote %]">Add</a> a milestone. [%- product.name FILTER url_quote %]">Add</a> a milestone.
[% END %] [% END %]
[% IF name && !no_edit_milestone_link %] [% IF milestone.name && !no_edit_milestone_link %]
Edit milestone <a Edit milestone <a
title="Edit Milestone '[% name FILTER html %]' of product ' title="Edit Milestone '[% milestone.name FILTER html %]' of product '
[%- product FILTER html %]'" [%- product.name FILTER html %]'"
href="editmilestones.cgi?action=edit&amp;product= href="editmilestones.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]&amp;milestone=[% name FILTER url_quote %]"> [%- product.name FILTER url_quote %]&amp;milestone=
'[% name FILTER html %]'</a>. [%- milestone.name FILTER url_quote %]">
'[% milestone.name FILTER html %]'</a>.
[% END %] [% END %]
[% UNLESS no_edit_other_milestones_link %] [% UNLESS no_edit_other_milestones_link %]
Edit other milestones of product <a Edit other milestones of product <a
href="editmilestones.cgi?product= href="editmilestones.cgi?product=
[%- product FILTER url_quote %]">'[% product FILTER html %]'</a>. [%- product.name FILTER url_quote %]">'[% product.name FILTER html %]'</a>.
[% END %] [% END %]
Edit product <a Edit product <a
href="editproducts.cgi?action=edit&amp;product= href="editproducts.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]">'[% product FILTER html %]'</a>. [%- product.name FILTER url_quote %]">'[% product.name FILTER html %]'</a>.
</p> </p>
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# milestones: array of milestone objects # product: object; Bugzilla::Product object representing the product to
# which the milestones belongs.
# showbugcounts: if defined, then bug counts should be included in the table # showbugcounts: if defined, then bug counts should be included in the table
# product: string; the name of the product we are editing milestones for
#%] #%]
[% USE Bugzilla %] [% USE Bugzilla %]
...@@ -32,17 +32,17 @@ ...@@ -32,17 +32,17 @@
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% title = BLOCK %]Select milestone of product [% title = BLOCK %]Select milestone of product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
[% edit_contentlink = BLOCK %]editmilestones.cgi?action=edit&amp;product= [% edit_contentlink = BLOCK %]editmilestones.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]&amp;milestone=%%name%%[% END %] [%- product.name FILTER url_quote %]&amp;milestone=%%name%%[% END %]
[% delete_contentlink = BLOCK %]editmilestones.cgi?action=del&amp;product= [% delete_contentlink = BLOCK %]editmilestones.cgi?action=del&amp;product=
[%- product FILTER url_quote %]&amp;milestone=%%name%%[% END %] [%- product.name FILTER url_quote %]&amp;milestone=%%name%%[% END %]
[% bug_count_contentlink = BLOCK %]buglist.cgi?target_milestone=%%name%%&amp;product= [% bug_count_contentlink = BLOCK %]buglist.cgi?target_milestone=%%name%%&amp;product=
[%- product FILTER url_quote %][% END %] [%- product.name FILTER url_quote %][% END %]
[% columns = [ [% columns = [
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
[%# We want to override the usual 'Delete' link for the default [%# We want to override the usual 'Delete' link for the default
milestone %] milestone %]
[% overrides.action = [ { [% overrides.action = [ {
match_value => "$default_milestone" match_value => product.default_milestone
match_field => 'name' match_field => 'name'
override_content => 1 override_content => 1
content => "(Default milestone)" content => "(Default milestone)"
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
[% PROCESS admin/table.html.tmpl [% PROCESS admin/table.html.tmpl
columns = columns columns = columns
data = milestones data = product.milestones
overrides = overrides overrides = overrides
%] %]
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
[% IF ! showbugcounts %] [% IF ! showbugcounts %]
<p><a href="editmilestones.cgi?product=[% product FILTER url_quote %]&amp;showbugcounts=1"> <p><a href="editmilestones.cgi?product=[% product.name FILTER url_quote %]&amp;showbugcounts=1">
Redisplay table with [% terms.bug %] counts (slower)</a></p> Redisplay table with [% terms.bug %] counts (slower)</a></p>
[% END %] [% END %]
......
...@@ -20,35 +20,29 @@ ...@@ -20,35 +20,29 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# product: object; Bugzilla::Product object representing the product to
# which the milestone belongs.
# #
# 'updated_XXX' variables are booleans, and are defined if the # 'updated_XXX' variables are booleans, and are defined if the
# 'XXX' field was updated during the edit just being handled. # 'XXX' field was updated during the edit just being handled.
# Variables called just 'XXX' are strings, and are the _new_ contents
# of the fields.
#
# name & updated_name: the name of the milestone
#
# sortkey & updated_sortkey: the milestone sortkey
#
# product: string; the name of the product the milestone belongs to
#%] #%]
[% title = BLOCK %]Updating Milestone '[% name FILTER html %]' of Product [% title = BLOCK %]Updating Milestone '[% milestone.name FILTER html %]' of Product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
[% IF updated_name %] [% IF updated_name %]
<p>Updated Milestone name to: '[% name FILTER html %]'.</p> <p>Updated Milestone name to: '[% milestone.name FILTER html %]'.</p>
[% END %] [% END %]
[% IF updated_sortkey %] [% IF updated_sortkey %]
<p>Updated Milestone sortkey to: '[% sortkey FILTER html %]'.</p> <p>Updated Milestone sortkey to: '[% milestone.sortkey FILTER html %]'.</p>
[% END %] [% END %]
[% UNLESS updated_sortkey || updated_name %] [% UNLESS updated_sortkey || updated_name %]
<p>Nothing changed for milestone '[% name FILTER html %]'. <p>Nothing changed for milestone '[% milestone.name FILTER html %]'.
[% END %] [% END %]
<p> <p>
......
...@@ -21,15 +21,13 @@ ...@@ -21,15 +21,13 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; The name of the version # product: object; Bugzilla::Product object representing the product to
# # which the version belongs.
# bug_count: number; The number of bugs targetted at the version # version: object; Bugzilla::Version object representing the
# # version the user wants to delete.
# product: string; The name of the product
#
#%] #%]
[% title = BLOCK %]Delete Version of Product '[% product FILTER html %]' [% title = BLOCK %]Delete Version of Product '[% product.name FILTER html %]'
[% END %] [% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
...@@ -43,20 +41,21 @@ ...@@ -43,20 +41,21 @@
</tr> </tr>
<tr> <tr>
<td valign="top">Version:</td> <td valign="top">Version:</td>
<td valign="top">[% name FILTER html %]</td> <td valign="top">[% version.name FILTER html %]</td>
</tr> </tr>
<tr> <tr>
<td valign="top">Version of Product:</td> <td valign="top">Version of Product:</td>
<td valign="top">[% product FILTER html %]</td> <td valign="top">[% product.name FILTER html %]</td>
</tr> </tr>
<tr> <tr>
<td valign="top">[% terms.Bugs %]:</td> <td valign="top">[% terms.Bugs %]:</td>
<td valign="top"> <td valign="top">
[% IF bug_count %] [% IF version.bug_count %]
<a title="List of [% terms.bugs %] targetted at version ' <a title="List of [% terms.bugs %] targetted at version '
[% name FILTER html %]'" [%- version.name FILTER html %]'"
href="buglist.cgi?version=[% name FILTER url_quote %]&amp;product= href="buglist.cgi?version=[% version.name FILTER url_quote %]&amp;product=
[%- product FILTER url_quote %]">[% bug_count %]</a> [%- product.name FILTER url_quote %]">
[%- version.bug_count FILTER none %]</a>
[% ELSE %] [% ELSE %]
None None
[% END %] [% END %]
...@@ -66,18 +65,18 @@ ...@@ -66,18 +65,18 @@
<h2>Confirmation</h2> <h2>Confirmation</h2>
[% IF bug_count %] [% IF version.bug_count %]
Sorry, there Sorry, there
[% IF bug_count > 1 %] [% IF version.bug_count > 1 %]
are [% bug_count %] [%+ terms.bugs %] are [% version.bug_count FILTER none %] [%+ terms.bugs %]
[% ELSE %] [% ELSE %]
is [% bug_count %] [%+ terms.bug %] is [% version.bug_count FILTER none %] [%+ terms.bug %]
[% END %] [% END %]
outstanding for this version. You must move outstanding for this version. You must move
[% IF bug_count > 1 %] [% IF version.bug_count > 1 %]
those [% terms.bugs %] those [% terms.bugs %]
[% ELSE %] [% ELSE %]
that [% terms.bug %] that [% terms.bug %]
...@@ -91,8 +90,8 @@ ...@@ -91,8 +90,8 @@
<form method="post" action="editversions.cgi"> <form method="post" action="editversions.cgi">
<input type="submit" value="Yes, delete"> <input type="submit" value="Yes, delete">
<input type="hidden" name="action" value="delete"> <input type="hidden" name="action" value="delete">
<input type="hidden" name="product" value="[% product FILTER html %]"> <input type="hidden" name="product" value="[% product.name FILTER html %]">
<input type="hidden" name="version" value="[% name FILTER html %]"> <input type="hidden" name="version" value="[% version.name FILTER html %]">
</form> </form>
[% END %] [% END %]
......
...@@ -20,12 +20,13 @@ ...@@ -20,12 +20,13 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# product: string; name of the product the version is being created for # product: object; Bugzilla::Product object representing the product to
# which the version is being created for
#%] #%]
[% title = BLOCK %]Add Version to Product '[% product FILTER html %]'[% END %] [% title = BLOCK %]Add Version to Product '[% product.name FILTER html %]'[% END %]
[% h2 = BLOCK %]This page allows you to add a new version to product [% h2 = BLOCK %]This page allows you to add a new version to product
'[% product FILTER html %]'.[% END %] '[% product.name FILTER html %]'.[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
h2 = h2 h2 = h2
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
</table> </table>
<input type="submit" value="Add"> <input type="submit" value="Add">
<input type="hidden" name="action" value="new"> <input type="hidden" name="action" value="new">
<input type="hidden" name='product' value="[% product FILTER html %]"> <input type="hidden" name='product' value="[% product.name FILTER html %]">
</form> </form>
......
...@@ -20,22 +20,23 @@ ...@@ -20,22 +20,23 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the newly created version # product: object; Bugzilla::Product object representing the product to
# # which the version belongs.
# product: string; the name of the product the version belongs to # version: object; Bugzilla::Version object representing the
# newly created version
#%] #%]
[% title = BLOCK %]Adding new Version of Product [% title = BLOCK %]Adding new Version of Product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
<p>The version '<a title="Edit version '[% name FILTER html %]' of product ' <p>The version '<a title="Edit version '[% version.name FILTER html %]' of product '
[%- product FILTER html %]'" [%- product.name FILTER html %]'"
href="editversions.cgi?action=edit&amp;product= href="editversions.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]&amp;version=[% name FILTER url_quote %]"> [%- product.name FILTER url_quote %]&amp;version=[% version.name FILTER url_quote %]">
[%- name FILTER html %]</a>' has been created.</p> [%- version.name FILTER html %]</a>' has been created.</p>
<p> <p>
......
...@@ -20,19 +20,19 @@ ...@@ -20,19 +20,19 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the deleted version. # product: object; Bugzilla::Product object representing the product to
# # which the version belongs.
# product: string; the name of the product the version belonged to # version: object; Bugzilla::Version object representing the
# # version the user deleted.
#%] #%]
[% title = BLOCK %]Deleted Version '[% name FILTER html %]' of Product [% title = BLOCK %]Deleted Version '[% version.name FILTER html %]' of Product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
<p>Version '[% name FILTER html %]' deleted.</p> <p>Version '[% version.name FILTER html %]' deleted.</p>
<p> <p>
......
...@@ -20,15 +20,16 @@ ...@@ -20,15 +20,16 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; The name of the version # product: object; Bugzilla::Product object representing the product to
# # which the version belongs.
# product: string; The product the version belongs to # version: object; Bugzilla::Version object representing the
# version the user wants to edit.
#%] #%]
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% title = BLOCK %]Edit Version '[% name FILTER html %]' of product ' [% title = BLOCK %]Edit Version '[% version.name FILTER html %]' of product '
[%- product FILTER html %]'[% END %] [%- product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
...@@ -39,14 +40,14 @@ ...@@ -39,14 +40,14 @@
<tr> <tr>
<th valign="top"><label for="version">Version:</label></th> <th valign="top"><label for="version">Version:</label></th>
<td><input id="version" size="64" maxlength="64" name="version" value=" <td><input id="version" size="64" maxlength="64" name="version" value="
[%- name FILTER html %]"></td> [%- version.name FILTER html %]"></td>
</tr> </tr>
</table> </table>
<input type="hidden" name="versionold" value="[% name FILTER html %]"> <input type="hidden" name="versionold" value="[% version.name FILTER html %]">
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" name="product" value="[% product FILTER html %]"> <input type="hidden" name="product" value="[% product.name FILTER html %]">
<input type="submit" value="Update"> <input type="submit" value="Update">
</form> </form>
......
...@@ -20,10 +20,9 @@ ...@@ -20,10 +20,9 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the version # product: object; Bugzilla::Product object representing the product to
# # which the version belongs.
# product: string; the name of the product which the version # version: object; Bugzilla::Version object representing the version
# belongs/belonged to
# #
# no_XXX_link: boolean; if defined, then don't show the corresponding # no_XXX_link: boolean; if defined, then don't show the corresponding
# link. Supported parameters are: # link. Supported parameters are:
...@@ -38,29 +37,30 @@ ...@@ -38,29 +37,30 @@
<hr> <hr>
[% UNLESS no_add_version_link %] [% UNLESS no_add_version_link %]
<a title="Add a version to product '[% product FILTER html %]'" <a title="Add a version to product '[% product.name FILTER html %]'"
href="editversions.cgi?action=add&amp;product= href="editversions.cgi?action=add&amp;product=
[%- product FILTER url_quote %]">Add</a> a version. [%- product.name FILTER url_quote %]">Add</a> a version.
[% END %] [% END %]
[% IF name && !no_edit_version_link %] [% IF version.name && !no_edit_version_link %]
Edit version <a Edit version <a
title="Edit Version '[% name FILTER html %]' of product ' title="Edit Version '[% version.name FILTER html %]' of product '
[%- product FILTER html %]'" [%- product.name FILTER html %]'"
href="editversions.cgi?action=edit&amp;product= href="editversions.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]&amp;version=[% name FILTER url_quote %]"> [%- product.name FILTER url_quote %]&amp;version=
'[% name FILTER html %]'</a>. [%- version.name FILTER url_quote %]">
'[% version.name FILTER html %]'</a>.
[% END %] [% END %]
[% UNLESS no_edit_other_versions_link %] [% UNLESS no_edit_other_versions_link %]
Edit other versions of product <a Edit other versions of product <a
href="editversions.cgi?product= href="editversions.cgi?product=
[%- product FILTER url_quote %]">'[% product FILTER html %]'</a>. [%- product.name FILTER url_quote %]">'[% product.name FILTER html %]'</a>.
[% END %] [% END %]
Edit product <a Edit product <a
href="editproducts.cgi?action=edit&amp;product= href="editproducts.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]">'[% product FILTER html %]'</a>. [%- product.name FILTER url_quote %]">'[% product.name FILTER html %]'</a>.
</p> </p>
...@@ -21,25 +21,24 @@ ...@@ -21,25 +21,24 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# versions: array of version objects # product: object; Bugzilla::Product object representing the product to
# showbugcounts: if defined, then bug counts should be included in the table # which the versions belongs.
# product: string; the name of the product we are editing versions for
#%] #%]
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% title = BLOCK %]Select version of product [% title = BLOCK %]Select version of product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
[% edit_contentlink = BLOCK %]editversions.cgi?action=edit&amp;product= [% edit_contentlink = BLOCK %]editversions.cgi?action=edit&amp;product=
[%- product FILTER url_quote %]&amp;version=%%name%%[% END %] [%- product.name FILTER url_quote %]&amp;version=%%name%%[% END %]
[% delete_contentlink = BLOCK %]editversions.cgi?action=del&amp;product= [% delete_contentlink = BLOCK %]editversions.cgi?action=del&amp;product=
[%- product FILTER url_quote %]&amp;version=%%name%%[% END %] [%- product.name FILTER url_quote %]&amp;version=%%name%%[% END %]
[% bug_count_contentlink = BLOCK %]buglist.cgi?version=%%name%%&amp;product= [% bug_count_contentlink = BLOCK %]buglist.cgi?version=%%name%%&amp;product=
[%- product FILTER url_quote %][% END %] [%- product.name FILTER url_quote %][% END %]
[% columns = [ [% columns = [
...@@ -72,14 +71,14 @@ ...@@ -72,14 +71,14 @@
[% PROCESS admin/table.html.tmpl [% PROCESS admin/table.html.tmpl
columns = columns columns = columns
data = versions data = product.versions
%] %]
<p> <p>
[% IF ! showbugcounts %] [% IF ! showbugcounts %]
<p><a href="editversions.cgi?product=[% product FILTER url_quote %]&amp;showbugcounts=1"> <p><a href="editversions.cgi?product=[% product.name FILTER url_quote %]&amp;showbugcounts=1">
Redisplay table with [% terms.bug %] counts (slower)</a></p> Redisplay table with [% terms.bug %] counts (slower)</a></p>
[% END %] [% END %]
......
...@@ -20,26 +20,26 @@ ...@@ -20,26 +20,26 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# product: object; Bugzilla::Product object representing the product to
# which the version belongs.
# version: object; Bugzilla::Version object representing the
# version the user updated.
# #
# updated_name: boolean; defined if the 'name' field was updated # updated_name: boolean; defined if the 'name' field was updated
#
# name: string; the new name of the version
#
# product: string; the name of the product the version belongs to
#%] #%]
[% title = BLOCK %]Updating Version '[% name FILTER html %]' of Product [% title = BLOCK %]Updating Version '[% version.name FILTER html %]' of Product
'[% product FILTER html %]'[% END %] '[% product.name FILTER html %]'[% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
%] %]
[% IF updated_name %] [% IF updated_name %]
<p>Updated Version name to: '[% name FILTER html %]'.</p> <p>Updated Version name to: '[% version.name FILTER html %]'.</p>
[% END %] [% END %]
[% UNLESS updated_name %] [% UNLESS updated_name %]
<p>Nothing changed for version '[% name FILTER html %]'. <p>Nothing changed for version '[% version.name FILTER html %]'.
[% END %] [% END %]
<p> <p>
......
...@@ -557,10 +557,6 @@ ...@@ -557,10 +557,6 @@
'comp.bug_count' 'comp.bug_count'
], ],
'admin/components/deleted.html.tmpl' => [
'deleted_bug_count'
],
'admin/users/confirm-delete.html.tmpl' => [ 'admin/users/confirm-delete.html.tmpl' => [
'andstring', 'andstring',
'responsibilityterms.$responsibility', 'responsibilityterms.$responsibility',
...@@ -591,18 +587,6 @@ ...@@ -591,18 +587,6 @@
'comp.bug_count' 'comp.bug_count'
], ],
'admin/milestones/confirm-delete.html.tmpl' => [
'bug_count'
],
'admin/milestones/deleted.html.tmpl' => [
'bug_count'
],
'admin/versions/confirm-delete.html.tmpl' => [
'bug_count'
],
'admin/settings/edit.html.tmpl' => [ 'admin/settings/edit.html.tmpl' => [
'name', 'name',
'checkbox_name' 'checkbox_name'
......
...@@ -778,8 +778,9 @@ ...@@ -778,8 +778,9 @@
[% title = "Default milestone not deletable" %] [% title = "Default milestone not deletable" %]
[% admindocslinks = {'products.html' => 'Administering products', [% admindocslinks = {'products.html' => 'Administering products',
'milestones.html' => 'About Milestones'} %] 'milestones.html' => 'About Milestones'} %]
Sorry, but [% name FILTER html %] is the default milestone for Sorry, but [% milestone.name FILTER html %] is the default milestone
product '[% product FILTER html %]', and so it can not be deleted. for product '[% product.name FILTER html %]', and so it can not be
deleted.
[% ELSIF error == "milestone_name_too_long" %] [% ELSIF error == "milestone_name_too_long" %]
[% title = "Milestone Name Is Too Long" %] [% title = "Milestone Name Is Too Long" %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment