summaryrefslogtreecommitdiffstats
path: root/userprefs.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-10-28 18:56:53 +0200
committerlpsolit%gmail.com <>2005-10-28 18:56:53 +0200
commit5a69c0bcd929b79ba6cc675058b50fc0d162141e (patch)
tree05bd423d81561e15b517542c9c3f56946420e271 /userprefs.cgi
parent05ec759cbdf76b56c55616314a5a19870c728164 (diff)
downloadbugzilla-5a69c0bcd929b79ba6cc675058b50fc0d162141e.tar.gz
bugzilla-5a69c0bcd929b79ba6cc675058b50fc0d162141e.tar.xz
Bug 308340: General Preferences tab is empty except for submit button when no user prefences are enabled - Patch by Frédéric Buclin <LpSolit@gmail.com> r=GavinS a=justdave
Diffstat (limited to 'userprefs.cgi')
-rwxr-xr-xuserprefs.cgi15
1 files changed, 13 insertions, 2 deletions
diff --git a/userprefs.cgi b/userprefs.cgi
index 796f2e0f9..ebbcefbab 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -146,10 +146,21 @@ sub SaveAccount {
sub DoSettings {
- $vars->{'settings'} = Bugzilla->user->settings;
+ my $settings = Bugzilla->user->settings;
+ $vars->{'settings'} = $settings;
- my @setting_list = keys %{Bugzilla->user->settings};
+ my @setting_list = keys %$settings;
$vars->{'setting_names'} = \@setting_list;
+
+ $vars->{'has_settings_enabled'} = 0;
+ # Is there at least one user setting enabled?
+ foreach my $setting_name (@setting_list) {
+ if ($settings->{"$setting_name"}->{'is_enabled'}) {
+ $vars->{'has_settings_enabled'} = 1;
+ last;
+ }
+ }
+ $vars->{'dont_show_button'} = !$vars->{'has_settings_enabled'};
}
sub SaveSettings {