From b06a56e99c623093a15921546f68f8bc8f7ba75e Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 2 Aug 2006 17:32:13 +0000 Subject: Bug 346932: Move settings creation/maintenance into Bugzilla::Install Patch By Max Kanat-Alexander (module owner) a=myk --- Bugzilla/Install.pm | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 Bugzilla/Install.pm (limited to 'Bugzilla/Install.pm') diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm new file mode 100644 index 000000000..4e94fa4a4 --- /dev/null +++ b/Bugzilla/Install.pm @@ -0,0 +1,103 @@ +# -*- Mode: perl; indent-tabs-mode: nil -*- +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is the Bugzilla Bug Tracking System. +# +# Contributor(s): Max Kanat-Alexander + +package Bugzilla::Install; + +# Functions in this this package can assume that the database +# has been set up, params are available, localconfig is +# available, and any module can be used. +# +# If you want to write an installation function that can't +# make those assumptions, then it should go into one of the +# packages under the Bugzilla::Install namespace. + +use strict; + +use Bugzilla::User::Setting; + +use constant SETTINGS => { + # 2005-03-03 travis@sedsystems.ca -- Bug 41972 + display_quips => { options => ["on", "off"], default => "on" }, + # 2005-03-10 travis@sedsystems.ca -- Bug 199048 + comment_sort_order => { options => ["oldest_to_newest", "newest_to_oldest", + "newest_to_oldest_desc_first"], + default => "oldest_to_newest" }, + # 2005-05-12 bugzilla@glob.com.au -- Bug 63536 + post_bug_submit_action => { options => ["next_bug", "same_bug", "nothing"], + default => "next_bug" }, + # 2005-06-29 wurblzap@gmail.com -- Bug 257767 + csv_colsepchar => { options => [',',';'], default => ',' }, + # 2005-10-26 wurblzap@gmail.com -- Bug 291459 + zoom_textareas => { options => ["on", "off"], default => "on" }, + # 2005-10-21 LpSolit@gmail.com -- Bug 313020 + per_bug_queries => { options => ['on', 'off'], default => 'on' }, + # 2006-05-01 olav@bkor.dhs.org -- Bug 7710 + state_addselfcc => { options => ['always', 'never', 'cc_unless_role'], + default => 'cc_unless_role' }, + +}; + +sub update_settings { + my %settings = %{SETTINGS()}; + foreach my $setting (keys %settings) { + add_setting($setting, $settings{$setting}->{options}, + $settings{$setting}->{default}); + } +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Install - Functions and variables having to do with + installation. + +=head1 SYNOPSIS + + use Bugzilla::Install; + Bugzilla::Install::update_settings(); + +=head1 DESCRIPTION + +This module is used primarily by L during installation. +This module contains functions that deal with general installation +issues after the database is completely set up and configured. + +=head1 CONSTANTS + +=over + +=item C + +Contains information about Settings, used by L. + +=back + +=head1 SUBROUTINES + +=over + +=item C + +Description: Adds and updates Settings for users. + +Params: none + +Returns: nothing. + +=back -- cgit v1.2.3-24-g4f1b