summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormyk%mozilla.org <>2004-09-24 10:01:30 +0200
committermyk%mozilla.org <>2004-09-24 10:01:30 +0200
commitda7ecb070a05a1b91b63a931bc0c4e9d288b616b (patch)
tree12680f43ce4fd418512159090a4dfefd35539928
parent864e9a127ad2c7b9e8d11e8cc557462e470651f0 (diff)
downloadbugzilla-da7ecb070a05a1b91b63a931bc0c4e9d288b616b.tar.gz
bugzilla-da7ecb070a05a1b91b63a931bc0c4e9d288b616b.tar.xz
Fix for bug 252739: moves inclusion/exclusion action names to button name instead of button value so that button values (which are also used as labels) will be localizable; patch by Marc Schumann; r=kiko,myk; a=justdave
-rwxr-xr-xeditflagtypes.cgi15
-rw-r--r--template/en/default/admin/flag-type/edit.html.tmpl8
2 files changed, 13 insertions, 10 deletions
diff --git a/editflagtypes.cgi b/editflagtypes.cgi
index d0d33951f..a14f75680 100755
--- a/editflagtypes.cgi
+++ b/editflagtypes.cgi
@@ -61,9 +61,11 @@ my $component_id;
# Determine whether to use the action specified by the user or the default.
my $action = $::FORM{'action'} || 'list';
+my @categoryActions;
-if ($::FORM{'categoryAction'}) {
- processCategoryChange();
+if (@categoryActions = grep(/^categoryAction-.+/, keys(%::FORM))) {
+ $categoryActions[0] =~ s/^categoryAction-//;
+ processCategoryChange($categoryActions[0]);
exit;
}
@@ -145,6 +147,7 @@ sub edit {
}
sub processCategoryChange {
+ my $categoryAction = shift;
validateIsActive();
validateIsRequestable();
validateIsRequesteeble();
@@ -152,22 +155,22 @@ sub processCategoryChange {
my @inclusions = $::MFORM{'inclusions'} ? @{$::MFORM{'inclusions'}} : ();
my @exclusions = $::MFORM{'exclusions'} ? @{$::MFORM{'exclusions'}} : ();
- if ($::FORM{'categoryAction'} eq "Include") {
+ if ($categoryAction eq 'include') {
validateProduct();
validateComponent();
my $category = ($::FORM{'product'} || "__Any__") . ":" . ($::FORM{'component'} || "__Any__");
push(@inclusions, $category) unless grep($_ eq $category, @inclusions);
}
- elsif ($::FORM{'categoryAction'} eq "Exclude") {
+ elsif ($categoryAction eq 'exclude') {
validateProduct();
validateComponent();
my $category = ($::FORM{'product'} || "__Any__") . ":" . ($::FORM{'component'} || "__Any__");
push(@exclusions, $category) unless grep($_ eq $category, @exclusions);
}
- elsif ($::FORM{'categoryAction'} eq "Remove Inclusion") {
+ elsif ($categoryAction eq 'removeInclusion') {
@inclusions = map(($_ eq $::FORM{'inclusion_to_remove'} ? () : $_), @inclusions);
}
- elsif ($::FORM{'categoryAction'} eq "Remove Exclusion") {
+ elsif ($categoryAction eq 'removeExclusion') {
@exclusions = map(($_ eq $::FORM{'exclusion_to_remove'} ? () : $_), @exclusions);
}
diff --git a/template/en/default/admin/flag-type/edit.html.tmpl b/template/en/default/admin/flag-type/edit.html.tmpl
index 4b4e64a16..1faaaf3b8 100644
--- a/template/en/default/admin/flag-type/edit.html.tmpl
+++ b/template/en/default/admin/flag-type/edit.html.tmpl
@@ -118,18 +118,18 @@
[% item FILTER html %]</option>
[% END %]
</select><br>
- <input type="submit" name="categoryAction" value="Include">
- <input type="submit" name="categoryAction" value="Exclude">
+ <input type="submit" name="categoryAction-include" value="Include">
+ <input type="submit" name="categoryAction-exclude" value="Exclude">
</td>
<td style="vertical-align: top;">
<b>Inclusions:</b><br>
[% PROCESS "global/select-menu.html.tmpl" name="inclusion_to_remove" multiple="1" size="4" options=type.inclusions %]<br>
- <input type="submit" name="categoryAction" value="Remove Inclusion">
+ <input type="submit" name="categoryAction-removeInclusion" value="Remove Inclusion">
</td>
<td style="vertical-align: top;">
<b>Exclusions:</b><br>
[% PROCESS "global/select-menu.html.tmpl" name="exclusion_to_remove" multiple="1" size="4" options=type.exclusions %]<br>
- <input type="submit" name="categoryAction" value="Remove Exclusion">
+ <input type="submit" name="categoryAction-removeExclusion" value="Remove Exclusion">
</td>
</tr>
</table>