From 665c23a7eb4a5486ff4cd7caea47d4cd0d388cd0 Mon Sep 17 00:00:00 2001
From: "myk%mozilla.org" <>
Date: Fri, 24 Sep 2004 08:01:30 +0000
Subject: [PATCH] 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
---
editflagtypes.cgi | 15 +++++++++------
.../en/default/admin/flag-type/edit.html.tmpl | 8 ++++----
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/editflagtypes.cgi b/editflagtypes.cgi
index d0d33951f4..a14f756805 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 4b4e64a165..1faaaf3b87 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 %]
[% END %]
-
-
+
+