From 5a69c0bcd929b79ba6cc675058b50fc0d162141e Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 28 Oct 2005 16:56:53 +0000 Subject: Bug 308340: General Preferences tab is empty except for submit button when no user prefences are enabled - Patch by Frédéric Buclin r=GavinS a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- userprefs.cgi | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'userprefs.cgi') 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 { -- cgit v1.2.3-24-g4f1b