diff options
author | lpsolit%gmail.com <> | 2005-10-28 16:56:53 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-10-28 16:56:53 +0000 |
commit | 5a69c0bcd929b79ba6cc675058b50fc0d162141e (patch) | |
tree | 05bd423d81561e15b517542c9c3f56946420e271 /userprefs.cgi | |
parent | Bug 266143: If Param("usevotes") is off, editing a product should mention it ... (diff) | |
download | bugzilla-5a69c0bcd929b79ba6cc675058b50fc0d162141e.tar.gz bugzilla-5a69c0bcd929b79ba6cc675058b50fc0d162141e.tar.bz2 bugzilla-5a69c0bcd929b79ba6cc675058b50fc0d162141e.zip |
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-x | userprefs.cgi | 15 |
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 { |