summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-08-02 19:32:13 +0200
committermkanat%bugzilla.org <>2006-08-02 19:32:13 +0200
commitb06a56e99c623093a15921546f68f8bc8f7ba75e (patch)
tree76168a77593cc9b0a48edf4c4276585c7c047305 /Bugzilla/User
parent01c3f172a95760538553e944b34c71de0b0ada13 (diff)
downloadbugzilla-b06a56e99c623093a15921546f68f8bc8f7ba75e.tar.gz
bugzilla-b06a56e99c623093a15921546f68f8bc8f7ba75e.tar.xz
Bug 346932: Move settings creation/maintenance into Bugzilla::Install
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=myk
Diffstat (limited to 'Bugzilla/User')
-rw-r--r--Bugzilla/User/Setting.pm19
1 files changed, 11 insertions, 8 deletions
diff --git a/Bugzilla/User/Setting.pm b/Bugzilla/User/Setting.pm
index 450d20a7f..71aeb2ef4 100644
--- a/Bugzilla/User/Setting.pm
+++ b/Bugzilla/User/Setting.pm
@@ -130,9 +130,10 @@ sub add_setting {
my $sth = $dbh->prepare(q{INSERT INTO setting_value (name, value, sortindex)
VALUES (?, ?, ?)});
- my @values_list = keys %{$values};
- foreach my $key (@values_list){
- $sth->execute($name, $key, $values->{$key});
+ my $sortindex = 5;
+ foreach my $key (@$values){
+ $sth->execute($name, $key, $sortindex);
+ $sortindex += 5;
}
}
@@ -307,17 +308,19 @@ $settings->{$setting_name} = new Bugzilla::User::Setting(
=over 4
-=item C<add_setting($name, $values, $default_value)>
+=item C<add_setting($name, \@values, $default_value)>
Description: Checks for the existence of a setting, and adds it
to the database if it does not yet exist.
+
Params: C<$name> - string - the name of the new setting
- C<$values> - hash - contains the new values (key) and
- sortindexes for the new setting
+ C<$values> - arrayref - contains the new choices
+ for the new Setting.
C<$default_value> - string - the site default
+
Returns: a pointer to a hash of settings
-#
-#
+
+
=item C<get_all_settings($user_id)>
Description: Provides the user's choices for each setting in the