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

Bug 299753: Replace old code in editproducts.cgi by routines from Product.pm -…

Bug 299753: Replace old code in editproducts.cgi by routines from Product.pm - Patch by André Batosti <batosti@async.com.br> r=LpSolit a=justdave
parent 97916f9a
...@@ -187,6 +187,20 @@ sub bug_count { ...@@ -187,6 +187,20 @@ sub bug_count {
return $self->{'bug_count'}; return $self->{'bug_count'};
} }
sub bug_ids {
my $self = shift;
my $dbh = Bugzilla->dbh;
if (!defined $self->{'bug_ids'}) {
$self->{'bug_ids'} =
$dbh->selectcol_arrayref(q{SELECT bug_id FROM bugs
WHERE product_id = ?},
undef, $self->id);
}
return $self->{'bug_ids'};
}
############################### ###############################
#### Accessors ###### #### Accessors ######
############################### ###############################
...@@ -253,6 +267,7 @@ Bugzilla::Product - Bugzilla product class. ...@@ -253,6 +267,7 @@ Bugzilla::Product - Bugzilla product class.
my @milestones = $product->milestones(); my @milestones = $product->milestones();
my @versions = $product->versions(); my @versions = $product->versions();
my $bugcount = $product->bug_count(); my $bugcount = $product->bug_count();
my $bug_ids = $product->bug_ids();
my $id = $product->id; my $id = $product->id;
my $name = $product->name; my $name = $product->name;
...@@ -330,6 +345,14 @@ Product.pm represents a product object. ...@@ -330,6 +345,14 @@ Product.pm represents a product object.
Returns: Integer with the number of bugs. Returns: Integer with the number of bugs.
=item C<bug_ids()>
Description: Returns the IDs of bugs that belong to the product.
Params: none.
Returns: An array of integer.
=back =back
=head1 SUBROUTINES =head1 SUBROUTINES
......
...@@ -15,32 +15,16 @@ ...@@ -15,32 +15,16 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# product_name: string; The name of the product # product: Bugzilla::Product object; The product
#
# prod_description: string; Product description, may be empty
# #
# (classification fields available if Param('useclassification') is enabled:) # (classification fields available if Param('useclassification') is enabled:)
# #
# classification: string; The name of the classification the product is in # classification: Bugzilla::Classification object; The classification
# # the product is in
# class_description: string; Classification description, may be empty
#
# bug_count: number; The number of bugs belonging to the product
#
# milestoneurl: string; milestone url, if milestones are in use,
# may be empty
#
# disallownew: boolean; Are new bugs allowed for the product flag
#
# components: list of hashes, members are: name, description
#
# versions: list of version values.
#
# milestones: list of milestone values.
# #
#%] #%]
[% title = BLOCK %]Delete Product '[% product_name FILTER html %]' [% title = BLOCK %]Delete Product '[% product.name FILTER html %]'
[% END %] [% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
...@@ -50,25 +34,12 @@ ...@@ -50,25 +34,12 @@
[% IF classification %] [% IF classification %]
[% classification_url_part = BLOCK %]&amp;classification= [% classification_url_part = BLOCK %]&amp;classification=
[%- classification FILTER url_quote %] [%- classification.name FILTER url_quote %]
[%- END %] [%- END %]
[% ELSE %] [% ELSE %]
[% classification_url_part = "" %] [% classification_url_part = "" %]
[% END %] [% END %]
[% UNLESS class_description %]
[% class_description = '<span style="color: red">missing</span>' %]
[% END %]
[% UNLESS prod_description %]
[% prod_description = '<span style="color: red">missing</span>' %]
[% END %]
[% IF disallownew %]
[% disallownew = "closed" %]
[% ELSE %]
[% disallownew = "open" %]
[% END %]
<table border="1" cellpadding="4" cellspacing="0"> <table border="1" cellpadding="4" cellspacing="0">
<tr bgcolor="#6666FF"> <tr bgcolor="#6666FF">
<th valign="top" align="left">Field</th> <th valign="top" align="left">Field</th>
...@@ -78,37 +49,49 @@ ...@@ -78,37 +49,49 @@
[% IF Param('useclassification') %] [% IF Param('useclassification') %]
<tr> <tr>
<td>Classification:</td> <td>Classification:</td>
<td>[% classification FILTER html %]</td> <td>[% classification.name FILTER html %]</td>
</tr> </tr>
<tr> <tr>
<td>Classification Description:</td> <td>Classification Description:</td>
[%# descriptions are intentionally not filtered to allow html content %] [%# descriptions are intentionally not filtered to allow html content %]
<td>[% class_description FILTER none %]</td> <td>
[% IF classification.description %]
[% classification.description FILTER none %]
[% ELSE %]
<span style="color: red">missing</span>
[% END %]
</td>
</tr> </tr>
[% END %] [% END %]
<tr> <tr>
<td valign="top">Product:</td> <td valign="top">Product:</td>
<td valign="top"> <td valign="top">
<a href="editproducts.cgi?product=[% product_name FILTER url_quote %] <a href="editproducts.cgi?product=[% product.name FILTER url_quote %]
[%- classification_url_part %]"> [%- classification_url_part %]">
[% product_name FILTER html %] [% product.name FILTER html %]
</a> </a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top">Description:</td> <td valign="top">Description:</td>
[%# descriptions are intentionally not filtered to allow html content %] [%# descriptions are intentionally not filtered to allow html content %]
<td valign="top">[% prod_description FILTER none %]</td> <td valign="top">
[% IF product.description %]
[% product.description FILTER none %]
[% ELSE %]
<span style="color: red">missing</span>
[% END %]
</td>
</tr> </tr>
[% IF Param('usetargetmilestone') %] [% IF Param('usetargetmilestone') %]
<tr> <tr>
<td>Milestone URL:</td> <td>Milestone URL:</td>
<td> <td>
[% IF milestoneurl %] [% IF product.milestone_url %]
<a href="[% milestoneurl FILTER uri %]"> <a href="[% product.milestone_url FILTER uri %]">
[%- milestoneurl FILTER html %] [%- product.milestone_url FILTER html %]
</a> </a>
[% ELSE %] [% ELSE %]
none none
...@@ -119,15 +102,21 @@ ...@@ -119,15 +102,21 @@
<tr> <tr>
<td>Closed for [% terms.bugs %]:</td> <td>Closed for [% terms.bugs %]:</td>
<td>[% disallownew FILTER html %]</td> <td>
[% IF product.disallownew %]
closed
[% ELSE %]
open
[% END %]
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
[% IF components.size > 0 %] [% IF product.components.size > 0 %]
<a href="editcomponents.cgi?product=[% product_name FILTER url_quote %] <a href="editcomponents.cgi?product=[% product.name FILTER url_quote %]
[%- classification_url_part %]" [%- classification_url_part %]"
title="Edit components for product '[% product_name FILTER html %]'"> title="Edit components for product '[% product.name FILTER html %]'">
Components: Components:
</a> </a>
[% ELSE %] [% ELSE %]
...@@ -135,9 +124,9 @@ ...@@ -135,9 +124,9 @@
[% END %] [% END %]
</td> </td>
<td> <td>
[% IF components.size > 0 %] [% IF product.components.size > 0 %]
<table> <table>
[% FOREACH c = components %] [% FOREACH c = product.components %]
<tr> <tr>
<th align="right">[% c.name FILTER html %]:</th> <th align="right">[% c.name FILTER html %]:</th>
[%# descriptions are intentionally not filtered to allow html content %] [%# descriptions are intentionally not filtered to allow html content %]
...@@ -159,8 +148,8 @@ ...@@ -159,8 +148,8 @@
<tr> <tr>
<td> <td>
[% IF versions.size > 0 %] [% IF product.versions.size > 0 %]
<a href="editversions.cgi?product=[%- product_name FILTER url_quote %] <a href="editversions.cgi?product=[%- product.name FILTER url_quote %]
[%- classification_url_part %]"> [%- classification_url_part %]">
Versions: Versions:
</a> </a>
...@@ -168,9 +157,9 @@ ...@@ -168,9 +157,9 @@
Versions: Versions:
[% END %] [% END %]
<td> <td>
[% IF versions.size > 0 %] [% IF product.versions.size > 0 %]
[% FOREACH v = versions %] [% FOREACH v = product.versions %]
[% v FILTER html %]<br> [% v.name FILTER html %]<br>
[% END %] [% END %]
[% ELSE %] [% ELSE %]
none none
...@@ -180,8 +169,8 @@ ...@@ -180,8 +169,8 @@
<tr> <tr>
<td valign="top"> <td valign="top">
[% IF milestones.size > 0 %] [% IF product.milestones.size > 0 %]
<a href="editmilestones.cgi?product=[%- product_name FILTER url_quote %] <a href="editmilestones.cgi?product=[%- product.name FILTER url_quote %]
[%- classification_url_part -%]"> [%- classification_url_part -%]">
Milestones: Milestones:
</a> </a>
...@@ -190,9 +179,9 @@ ...@@ -190,9 +179,9 @@
[% END %] [% END %]
</td> </td>
<td> <td>
[% IF milestones.size > 0 %] [% IF product.milestones.size > 0 %]
[% FOREACH m = milestones %] [% FOREACH m = product.milestones %]
[% m FILTER html %]<br> [% m.name FILTER html %]<br>
[% END %] [% END %]
[% ELSE %] [% ELSE %]
none none
...@@ -203,12 +192,12 @@ ...@@ -203,12 +192,12 @@
<tr> <tr>
<td>[% terms.Bugs %]:</td> <td>[% terms.Bugs %]:</td>
<td> <td>
[% IF bug_count %] [% IF product.bug_count %]
<a href="buglist.cgi?product=[%- product_name FILTER url_quote %] <a href="buglist.cgi?product=[%- product.name FILTER url_quote %]
[%- classification_url_part %]" [%- classification_url_part %]"
title="List of [% terms.bugs %] for product ' title="List of [% terms.bugs %] for product '
[%- product_name FILTER html %]'"> [%- product.name FILTER html %]'">
[% bug_count %] [% product.bug_count FILTER html %]
</a> </a>
[% ELSE %] [% ELSE %]
none none
...@@ -219,21 +208,21 @@ ...@@ -219,21 +208,21 @@
<h2>Confirmation</h2> <h2>Confirmation</h2>
[% IF bug_count %] [% IF product.bug_count %]
[% IF !Param("allowbugdeletion") %] [% IF !Param("allowbugdeletion") %]
Sorry, there Sorry, there
[% IF bug_count > 1 %] [% IF product.bug_count > 1 %]
are [% bug_count %] [%+ terms.bugs %] are [% product.bug_count FILTER html %] [%+ terms.bugs %]
[% ELSE %] [% ELSE %]
is 1 [% terms.bug %] is 1 [% terms.bug %]
[% END %] [% END %]
outstanding for this product. You must reassign outstanding for this product. You must reassign
[% IF bug_count > 1 %] [% IF product.bug_count > 1 %]
those [% terms.bugs %] those [% terms.bugs %]
[% ELSE %] [% ELSE %]
that [% terms.bug %] that [% terms.bug %]
...@@ -247,8 +236,8 @@ ...@@ -247,8 +236,8 @@
<tr> <tr>
<td> <td>
There There
[% IF bug_count > 1 %] [% IF product.bug_count > 1 %]
are [% bug_count %] [%+ terms.bugs %] are [% product.bug_count FILTER html %] [%+ terms.bugs %]
[% ELSE %] [% ELSE %]
is 1 [% terms.bug %] is 1 [% terms.bug %]
[% END %] [% END %]
...@@ -263,16 +252,16 @@ ...@@ -263,16 +252,16 @@
[% END %] [% END %]
[% IF bug_count == 0 || Param('allowbugdeletion') %] [% IF product.bug_count == 0 || Param('allowbugdeletion') %]
<p>Do you really want to delete this product?<p> <p>Do you really want to delete this product?<p>
<form method="post" action="editproducts.cgi"> <form method="post" action="editproducts.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_name FILTER html %]"> <input type="hidden" name="product" value="[% product.name FILTER html %]">
<input type="hidden" name="classification" <input type="hidden" name="classification"
value="[% classification FILTER html %]"> value="[% classification.name FILTER html %]">
</form> </form>
[% END %] [% END %]
......
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# classification: string; name of the classification in which the new # classification: Bugzilla::Classification object; If classifications
# product is created. # are enabled, then this is
# the currently selected classification
# #
#%] #%]
...@@ -56,9 +57,11 @@ ...@@ -56,9 +57,11 @@
<input type="hidden" name="open_name" value="All Open"> <input type="hidden" name="open_name" value="All Open">
<input type="hidden" name="action" value="new"> <input type="hidden" name="action" value="new">
<input type="hidden" name="classification" <input type="hidden" name="classification"
value="[% classification FILTER html %]"> value="[% classification.name FILTER html %]">
</form> </form>
[% PROCESS "admin/products/footer.html.tmpl" no_add_product_link = 1 %] [% PROCESS "admin/products/footer.html.tmpl"
no_add_product_link = 1
no_edit_product_link = 1 %]
[% PROCESS global/footer.html.tmpl %] [% PROCESS global/footer.html.tmpl %]
...@@ -14,18 +14,23 @@ ...@@ -14,18 +14,23 @@
# Contributor(s): Gabriel S. Oliveira <gabriel@async.com.br> # Contributor(s): Gabriel S. Oliveira <gabriel@async.com.br>
#%] #%]
[%# INTERFACE:
# product: Bugzilla::Product object; the Product created.
#
#%]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = 'New Product Created' title = 'New Product Created'
%] %]
<br> <br>
<div style='border: 1px red solid; padding: 1ex;'> <div style='border: 1px red solid; padding: 1ex;'>
<b>You will need to <b>You will need to
<a href="editcomponents.cgi?action=add&product=[% product FILTER url_quote %]"> <a href="editcomponents.cgi?action=add&product=[% product.name FILTER url_quote %]">
add at least one component add at least one component
</a> before you can enter [% terms.bugs %] against this product </a> before you can enter [% terms.bugs %] against this product
</b> </b>
</div> </div>
[% PROCESS "admin/products/footer.html.tmpl" name = product %] [% PROCESS "admin/products/footer.html.tmpl" %]
[% PROCESS global/footer.html.tmpl %] [% PROCESS global/footer.html.tmpl %]
...@@ -15,11 +15,16 @@ ...@@ -15,11 +15,16 @@
# #
#%] #%]
[%# INTERFACE:
# product: Bugzilla::Product object; The product
#
#%]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = 'Deleting product' title = 'Deleting product'
%] %]
[% IF nb_bugs %] [% IF product.bug_count %]
All references to deleted [% terms.bugs %] removed. All references to deleted [% terms.bugs %] removed.
[% END %] [% END %]
...@@ -35,7 +40,7 @@ ...@@ -35,7 +40,7 @@
</p> </p>
<p> <p>
Product [% product FILTER html %] deleted. Product [% product.name FILTER html %] deleted.
</p> </p>
[% PROCESS admin/products/footer.html.tmpl [% PROCESS admin/products/footer.html.tmpl
......
...@@ -17,14 +17,15 @@ ...@@ -17,14 +17,15 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# classification: string; name of classification product is in. # product: Bugzilla::Product object; The product
# product: array; an array of product objects. #
# classification: Bugzilla::Classifiation object; classification product is in.
#%] #%]
[% IF Param('useclassification') %] [% IF Param('useclassification') %]
<tr> <tr>
<th align="right"><b>Classification:</b></th> <th align="right"><b>Classification:</b></th>
<td><b>[% classification FILTER html %]</b></td> <td><b>[% classification.name FILTER html %]</b></td>
</tr> </tr>
[% END %] [% END %]
......
...@@ -17,13 +17,14 @@ ...@@ -17,13 +17,14 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# classification: string; name of classification product is in. # product: Bugzilla::Product object; The product
# product: an array of product objects. #
# components: an array of component object(s) related to the product. # (classification fields available if Param('useclassification') is enabled:)
# groups: an array of group objects related to the product. #
# versions: an array of version objects related to product. # classification: Bugzilla::Classification object; The classification
# milestones: an array of milestones objects related to product. # the product is in
# bug_count: integer; number of bugs in this product. #
# groups_controls: a hash of group controls related to the product.
#%] #%]
[% title = BLOCK %]Edit Product[% END %] [% title = BLOCK %]Edit Product[% END %]
...@@ -44,8 +45,8 @@ ...@@ -44,8 +45,8 @@
</a> </a>
</th> </th>
<td> <td>
[% IF components.size -%] [% IF product.components.size -%]
[% FOREACH component = components %] [% FOREACH component = product.components %]
<b>[% component.name FILTER html %]:</b>&nbsp; <b>[% component.name FILTER html %]:</b>&nbsp;
[% IF component.description %] [% IF component.description %]
[% component.description FILTER none %] [% component.description FILTER none %]
...@@ -65,9 +66,9 @@ ...@@ -65,9 +66,9 @@
versions:</a> versions:</a>
</th> </th>
<td> <td>
[%- IF versions.size -%] [%- IF product.versions.size -%]
[% FOREACH v = versions %] [% FOREACH v = product.versions %]
[% v FILTER html %] [% v.name FILTER html %]
<br> <br>
[% END %] [% END %]
[% ELSE %] [% ELSE %]
...@@ -82,9 +83,9 @@ versions:</a> ...@@ -82,9 +83,9 @@ versions:</a>
Edit milestones:</a> Edit milestones:</a>
</th> </th>
<td> <td>
[%- IF milestones.size -%] [%- IF product.milestones.size -%]
[%- FOREACH m = milestones -%] [%- FOREACH m = product.milestones -%]
[% m FILTER html %] [% m.name FILTER html %]
<br> <br>
[% END %] [% END %]
[% ELSE %] [% ELSE %]
...@@ -97,15 +98,15 @@ versions:</a> ...@@ -97,15 +98,15 @@ versions:</a>
<th align="right" valign="top"> <th align="right" valign="top">
<a href="editproducts.cgi?action=editgroupcontrols&product= <a href="editproducts.cgi?action=editgroupcontrols&product=
[%- product.name FILTER url_quote %]&classification= [%- product.name FILTER url_quote %]&classification=
[%- classification FILTER url_quote %]"> [%- classification.name FILTER url_quote %]">
Edit Group Access Controls: Edit Group Access Controls:
</a> </a>
</th> </th>
<td> <td>
[% IF groups.size %] [% IF group_controls.size %]
[% FOREACH g = groups %] [% FOREACH g = group_controls.values %]
<b>[% g.name FILTER html %]:</b>&nbsp; <b>[% g.group.name FILTER html %]:</b>&nbsp;
[% IF g.isactive %] [% IF g.group.isactive %]
[% g.membercontrol FILTER html %]/ [% g.membercontrol FILTER html %]/
[% g.othercontrol FILTER html %] [% g.othercontrol FILTER html %]
[% IF g.entry %], ENTRY[% END %] [% IF g.entry %], ENTRY[% END %]
...@@ -122,32 +123,21 @@ versions:</a> ...@@ -122,32 +123,21 @@ versions:</a>
</tr> </tr>
<tr> <tr>
<th align="right">[% terms.Bugs %]:</th> <th align="right">[% terms.Bugs %]:</th>
<td>[% bug_count FILTER html %]</td> <td><a href="buglist.cgi?product=[% product.name FILTER url_quote %]">
[% product.bug_count FILTER html %]</a></td>
</tr> </tr>
</table> </table>
<input type="hidden" name="productold" <input type="hidden" name="product_old_name"
value="[% product.name FILTER html %]"> value="[% product.name FILTER html %]">
<input type="hidden" name="descriptionold"
value="[% product.description FILTER html %]">
<input type="hidden" name="milestoneurlold"
value="[% product.milestoneurl FILTER html %]">
<input type="hidden" name="disallownewold"
value="[% product.disallownew FILTER html %]">
<input type="hidden" name="votesperuserold"
value="[% product.votesperuser FILTER html %]">
<input type="hidden" name="maxvotesperbugold"
value="[% product.maxvotesperbug FILTER html %]">
<input type="hidden" name="votestoconfirmold"
value="[% product.votestoconfirm FILTER html %]">
<input type="hidden" name="defaultmilestoneold"
value="[% product.defaultmilestone FILTER html %]">
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" name="classification" <input type="hidden" name="classification"
value="[% classification FILTER html %]"> value="[% classification.name FILTER html %]">
<input type="submit" name="submit" value="Update"> <input type="submit" name="submit" value="Update">
</form> </form>
[% PROCESS "admin/products/footer.html.tmpl" no_add_product_link = 1 %] [% PROCESS "admin/products/footer.html.tmpl"
no_add_product_link = 1
no_edit_product_link = 1 %]
[% PROCESS global/footer.html.tmpl %] [% PROCESS global/footer.html.tmpl %]
...@@ -15,10 +15,11 @@ ...@@ -15,10 +15,11 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# name: string; the name of the product # product: Bugzilla::Product Object; the product
# #
# classification: string; If classifications are enabled, then this is # classification: Bugzilla::Classification object ; If classifications
# the currently selected classification # are enabled, then this is the currently
# selected classification
# #
# 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:
...@@ -30,13 +31,13 @@ ...@@ -30,13 +31,13 @@
[% IF Param('useclassification') && classification %] [% IF Param('useclassification') && classification %]
[% classification_url_part = BLOCK %]&amp;classification= [% classification_url_part = BLOCK %]&amp;classification=
[%- classification FILTER url_quote %] [%- classification.name FILTER url_quote %]
[% END %] [% END %]
[% classification_url_part_start = BLOCK %]classification= [% classification_url_part_start = BLOCK %]classification=
[%- classification FILTER url_quote %] [%- classification.name FILTER url_quote %]
[% END %] [% END %]
[% classification_text = BLOCK %] [% classification_text = BLOCK %]
of classification '[% classification FILTER html %]' of classification '[% classification.name FILTER html %]'
[% END %] [% END %]
[% END %] [% END %]
...@@ -51,20 +52,22 @@ ...@@ -51,20 +52,22 @@
classification if they are enabled, but I'm just being paranoid %] classification if they are enabled, but I'm just being paranoid %]
[% IF Param('useclassification') && classification %] [% IF Param('useclassification') && classification %]
(<a title="Add a product to classification ' (<a title="Add a product to classification '
[%- classification FILTER html %]'" [%- classification.name FILTER html %]'"
href="editproducts.cgi?action=add href="editproducts.cgi?action=add
[%- classification_url_part %]">to [%- classification_url_part %]">to
classification '[% classification FILTER html %]'</a>) classification '[% classification.name FILTER html %]'
</a>)
[% END %]. [% END %].
[% END %] [% END %]
[% IF name && !no_edit_product_link %] [% IF product && !no_edit_product_link %]
Edit product <a Edit product <a
title="Edit Product '[% name FILTER html %]' title="Edit Product '[% product.name FILTER html %]'
[% classification_text %]" [%- classification_text %]"
href="editproducts.cgi?action=edit&amp;product= href="editproducts.cgi?action=edit&amp;product=
[%- name FILTER url_quote %][% classification_url_part %]"> [%- product.name FILTER url_quote %]
'[% name FILTER html %]'</a>. [%- classification_url_part %]">
'[% product.name FILTER html %]'</a>.
[% END %] [% END %]
...@@ -80,7 +83,7 @@ ...@@ -80,7 +83,7 @@
[% IF Param('useclassification') && classification %] [% IF Param('useclassification') && classification %]
Edit classification <a href="editclassifications.cgi?action=edit Edit classification <a href="editclassifications.cgi?action=edit
[%- classification_url_part %]">' [%- classification_url_part %]">'
[%- classification FILTER html %]'</a>. [%- classification.name FILTER html %]'</a>.
[% END %] [% END %]
......
...@@ -21,9 +21,11 @@ ...@@ -21,9 +21,11 @@
#%] #%]
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% title = BLOCK %]
Confirm Group Control Change for product '[%- product.name FILTER html %]'
[% END %]
[% PROCESS global/header.html.tmpl title="Confirm Group Control Change for product \'$product\'" %] [% PROCESS global/header.html.tmpl title = title %]
[% FOREACH group = mandatory_groups %] [% FOREACH group = mandatory_groups %]
<P> <P>
group '[% group.name FILTER html %]' impacts [% group.count %] group '[% group.name FILTER html %]' impacts [% group.count %]
......
...@@ -21,16 +21,18 @@ ...@@ -21,16 +21,18 @@
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% filt_product = product FILTER html %] [% title = BLOCK %]
[% filt_classification = classification FILTER html %] Edit Group Controls for [% product.name FILTER html %]
[% PROCESS global/header.html.tmpl [% END %]
title = "Edit Group Controls for '$filt_product'" [% PROCESS global/header.html.tmpl
title = title
%] %]
<form method="post" action="editproducts.cgi"> <form method="post" action="editproducts.cgi">
<input type="hidden" name="action" value="updategroupcontrols"> <input type="hidden" name="action" value="updategroupcontrols">
<input type="hidden" name="product" value="[% filt_product %]"> <input type="hidden" name="product" value="[% product.name FILTER html %]">
<input type="hidden" name="classification" value="[% filt_classification %]"> <input type="hidden" name="classification"
value="[% classification.name FILTER html %]">
<table id="form" cellspacing="0" cellpadding="4" border="1"> <table id="form" cellspacing="0" cellpadding="4" border="1">
<tr bgcolor="#6666ff"> <tr bgcolor="#6666ff">
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
[%# INTERFACE: [%# INTERFACE:
# removed_na: array of hashes; groups not applicable for the product. # removed_na: array of hashes; groups not applicable for the product.
# added_mandatory: array of hashes; groups mandatory for the product. # added_mandatory: array of hashes; groups mandatory for the product.
# classification: string; product classification name. # classification: Bugzilla::Classification object; product classification.
# product: string; name of the product. # product: Bugzilla::Product object; the product.
#%] #%]
[% title = BLOCK %] [% title = BLOCK %]
Update group access controls for [% product FILTER html %] Update group access controls for [% product.name FILTER html %]
[% END %] [% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
...@@ -48,6 +48,6 @@ ...@@ -48,6 +48,6 @@
Group control updates done<p> Group control updates done<p>
[% PROCESS admin/products/footer.html.tmpl name = product %] [% PROCESS admin/products/footer.html.tmpl %]
[% PROCESS global/footer.html.tmpl %] [% PROCESS global/footer.html.tmpl %]
...@@ -15,19 +15,10 @@ ...@@ -15,19 +15,10 @@
#%] #%]
[%# INTERFACE: [%# INTERFACE:
# products: array of hashes having the following properties: # products: array of Bugzilla::Product objects
# - name: string; The name of the product
# - description: string; The product description (html allowed)
# - status: boolean; Can new bugs be created for the product?
# - votesperuser: number; The number of votes a user is allowed
# in the product
# - maxvotersperbug: number; Maximum votes allowed per bug in this
# product
# - votestoconfirm: number; The number of votes that are needed to
# auto-confirm a bug in this product
# - bug_count: number; The number of bugs in this product
# #
# classification: string; If classifications are enabled, then this is # classification: Bugzilla::Classification object; If classifications
# are enabled, then this is
# the currently selected classification # the currently selected classification
#%] #%]
...@@ -35,10 +26,10 @@ ...@@ -35,10 +26,10 @@
[% IF classification %] [% IF classification %]
[% classification_url_part = BLOCK %]&amp;classification= [% classification_url_part = BLOCK %]&amp;classification=
[%- classification FILTER url_quote %] [%- classification.name FILTER url_quote %]
[%- END %] [%- END %]
[% classification_title = BLOCK %] [% classification_title = BLOCK %]
in classification '[% classification FILTER html %]' in classification '[% classification.name FILTER html %]'
[% END %] [% END %]
[% END %] [% END %]
...@@ -54,7 +45,7 @@ ...@@ -54,7 +45,7 @@
editproducts.cgi?action=del&amp;product=%%name%% editproducts.cgi?action=del&amp;product=%%name%%
[%- classification_url_part %] [%- classification_url_part %]
[% END %] [% END %]
[% bug_count_contentlink = BLOCK %]buglist.cgi?product=%%name%%&amp; [% bug_count_contentlink = BLOCK %]buglist.cgi?product=%%name%%
[%- classification_url_part %][% END %] [%- classification_url_part %][% END %]
...@@ -70,9 +61,8 @@ ...@@ -70,9 +61,8 @@
allow_html_content => 1 allow_html_content => 1
}, },
{ {
name => "status" name => "disallow_new"
heading => "Open For New $terms.Bugs" heading => "Open For New $terms.Bugs"
yesno_field => 1
}, },
{ {
name => "votesperuser" name => "votesperuser"
...@@ -95,15 +85,27 @@ ...@@ -95,15 +85,27 @@
align => 'right' align => 'right'
contentlink => bug_count_contentlink contentlink => bug_count_contentlink
}, },
{
heading => "Action"
content => "Delete"
contentlink => delete_contentlink
},
] ]
%] %]
[% columns.push({ [% overrides.disallow_new = [ {
heading => "Action" match_value => "1"
content => "Delete" match_field => 'disallow_new'
contentlink => delete_contentlink override_content => 1
}) content => "No"
%] },
{
match_value => 0
match_field => 'disallow_new'
override_content => 1
content => "Yes"
}]
%]
[% PROCESS admin/table.html.tmpl [% PROCESS admin/table.html.tmpl
columns = columns columns = columns
......
...@@ -21,33 +21,10 @@ ...@@ -21,33 +21,10 @@
[%# INTERFACE: [%# INTERFACE:
# #
# updated_XXX : boolean; is true when the 'XXX' field has been updated. # old_product : Bugzilla::Product Object; old product.
# old_XXX : ... string; old value of the field 'XXX'. # product : Bugzilla::Product Object; new product.
# new_XXX : ... string; new value of the field 'XXX'.
# #
# updated_product: boolean; the name of the product was updated # classification: Bugzilla::Classification Object; The product classification (may be empty or missing)
#
# updated_description: boolean; the product description was updated
#
# updated_milestoneurl: boolean; the product milestone URL was updated
#
# updated_votesperuser: boolean; the votes per user was updated
#
# updated_maxvotesperbug: boolean; the max votes per bug was updated
#
# updated_votestoconfirm: boolean; the votes to confirm a bug was updated
#
# updated_defaultmilestone: boolean; the default milestone was updated
#
# updated_bugsubmitstatus: boolean; the open/closed for new bugs status
# was updated (no 'old_XXX' value)
#
# classification: string; The product classification (may be empty or missing)
#
# changer: string; user id of the user making the changes, used for mailing
# bug changes if necessary
#
# name: string; the product name
# #
# checkvotes: boolean; is true if vote related fields have changed. If so, # checkvotes: boolean; is true if vote related fields have changed. If so,
# then the following parameters will be specified: # then the following parameters will be specified:
...@@ -62,105 +39,110 @@ ...@@ -62,105 +39,110 @@
# #
# confirmedbugs: list of bug ids, which were confirmed by votes # confirmedbugs: list of bug ids, which were confirmed by votes
# #
# changer: string; user id of the user making the changes, used for mailing
# bug changes if necessary
#
#%] #%]
[% IF classification %] [% IF classification %]
[% classification_url_part = BLOCK %]&amp;classification= [% classification_url_part = BLOCK %]&amp;classification=
[%- classification FILTER url_quote %] [%- classification.name FILTER url_quote %]
[% END %] [% END %]
[% classification_text = BLOCK %] [% classification_text = BLOCK %]
of classification '[% classification FILTER html %]' of classification '[% classification.name FILTER html %]'
[% END %] [% END %]
[% END %] [% END %]
[% title = BLOCK %]Updating Product '[% name FILTER html %]' [% title = BLOCK %]Updating Product '[% product.name FILTER html %]'
[% classification_text FILTER none %][% END %] [% classification_text FILTER none %][% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
style_urls = ['skins/standard/admin.css'] style_urls = ['skins/standard/admin.css']
%] %]
[% updated = 0 %]
[% IF updated_product %] [% IF product.name != old_product.name %]
<p> <p>
Updated product name from '[% old_product FILTER html %]' to Updated product name from '[% old_product.name FILTER html %]' to
<a href="editproducts.cgi?action=edit&amp;product= <a href="editproducts.cgi?action=edit&amp;product=
[%- new_product FILTER url_quote %] [%- product.name FILTER url_quote %]
[%- classification_url_part FILTER none %]">[% new_product FILTER html %]</a>. [%- classification_url_part FILTER none %]">[% product.name FILTER html %]</a>.
[% updated = 1 %]
[% END %] [% END %]
[% IF updated_description %] [% IF product.description != old_product.description %]
<p> <p>
Updated description to:</p> Updated description to:</p>
</p> </p>
<p style="margin: 1em 3em 1em 3em">[% new_description FILTER html %]</p> <p style="margin: 1em 3em 1em 3em">[% product.description FILTER html %]</p>
[% updated = 1 %]
[% END %] [% END %]
[% IF updated_bugsubmitstatus %] [% IF product.disallow_new != old_product.disallow_new %]
<p> <p>
Product is now Product is now
[% IF new_bugsubmitstatus %] [% IF product.disallow_new %]
closed to closed to
[% ELSE %] [% ELSE %]
open for open for
[% END %] [% END %]
new [% terms.bugs %]. new [% terms.bugs %].
[% updated = 1 %]
[% END %] [% END %]
[% IF updated_milestoneurl %] [% IF product.milestone_url != old_product.milestone_url %]
<p> <p>
Updated milestone URL Updated milestone URL
[% IF old_milestoneurl != '' %] [% IF old_product.milestone_url != '' %]
from<br> <a href="[%- old_milestoneurl FILTER html %]">' from<br> <a href="[%- old_product.milestone_url FILTER html %]">'
[%- old_milestoneurl FILTER html %]'</a> [%- old_product.milestone_url FILTER html %]'</a>
[% END %] [% END %]
to to
[% IF new_milestoneurl != '' %] [% IF product.milestone_url != '' %]
<br><a href="[%- new_milestoneurl FILTER html %]">' <br><a href="[%- product.milestone_url FILTER html %]">'
[%- new_milestoneurl FILTER html %]'</a>. [%- product.milestone_url FILTER html %]'</a>.
[% ELSE %] [% ELSE %]
be empty. be empty.
[% END %] [% END %]
</p> </p>
[% updated = 1 %]
[% END %] [% END %]
[% IF updated_defaultmilestone %] [% IF product.default_milestone != old_product.default_milestone %]
<p> <p>
Updated default milestone from '[% old_defaultmilestone FILTER html %]' to Updated default milestone from '[% old_product.default_milestone FILTER html %]' to
'[% new_defaultmilestone FILTER html %]'. '[% product.default_milestone FILTER html %]'.
</p> </p>
[% updated = 1 %]
[% END %] [% END %]
[% IF updated_votesperuser %] [% IF product.votes_per_user != old_product.votes_per_user %]
<p> <p>
Updated votes per user from Updated votes per user from
[%+ old_votesperuser FILTER html %] to [%+ old_product.votes_per_user FILTER html %] to
[%+ new_votesperuser FILTER html %]. [%+ product.votes_per_user FILTER html %].
[% updated = 1 %]
[% END %] [% END %]
[% IF updated_maxvotesperbug %] [% IF product.max_votes_per_bug != old_product.max_votes_per_bug %]
<p> <p>
Updated maximum votes per [% terms.bug %] from Updated maximum votes per [% terms.bug %] from
[%+ old_maxvotesperbug FILTER html %] to [%+ old_product.max_votes_per_bug FILTER html %] to
[%+ new_maxvotesperbug FILTER html %]. [%+ product.max_votes_per_bug FILTER html %].
[% updated = 1 %]
[% END %] [% END %]
[% IF updated_votestoconfirm %] [% IF product.votes_to_confirm != old_product.votes_to_confirm %]
<p> <p>
Updated number of votes needed to confirm a [% terms.bug %] from Updated number of votes needed to confirm a [% terms.bug %] from
[%+ old_votestoconfirm FILTER html %] to [%+ old_product.votes_to_confirm FILTER html %] to
[%+ new_votestoconfirm FILTER html %]. [%+ product.votes_to_confirm FILTER html %].
[% updated = 1 %]
[% END %] [% END %]
[% UNLESS updated_bugsubmitstatus || [% UNLESS updated %]
updated_description || <p>Nothing changed for product '[% product.name FILTER html %]'.
updated_milestoneurl ||
updated_votesperuser ||
updated_maxvotesperbug ||
updated_votestoconfirm ||
updated_defaultmilestone ||
updated_product %]
<p>Nothing changed for product '[% name FILTER html %]'.
[% END %] [% END %]
[%# Note that this display of changed votes and/or confirmed bugs is [%# Note that this display of changed votes and/or confirmed bugs is
......
...@@ -506,8 +506,6 @@ ...@@ -506,8 +506,6 @@
], ],
'admin/products/groupcontrol/edit.html.tmpl' => [ 'admin/products/groupcontrol/edit.html.tmpl' => [
'filt_classification',
'filt_product',
'group.bugcount', 'group.bugcount',
'group.id', 'group.id',
'const.CONTROLMAPNA', 'const.CONTROLMAPNA',
...@@ -522,7 +520,6 @@ ...@@ -522,7 +520,6 @@
'admin/products/confirm-delete.html.tmpl' => [ 'admin/products/confirm-delete.html.tmpl' => [
'classification_url_part', 'classification_url_part',
'bug_count',
], ],
'admin/products/footer.html.tmpl' => [ 'admin/products/footer.html.tmpl' => [
......
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