diff options
author | lpsolit%gmail.com <> | 2005-10-28 18:56:53 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-10-28 18:56:53 +0200 |
commit | 5a69c0bcd929b79ba6cc675058b50fc0d162141e (patch) | |
tree | 05bd423d81561e15b517542c9c3f56946420e271 /userprefs.cgi | |
parent | 05ec759cbdf76b56c55616314a5a19870c728164 (diff) | |
download | bugzilla-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-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 { |