Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
b06a56e9
Commit
b06a56e9
authored
Aug 02, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 346932: Move settings creation/maintenance into Bugzilla::Install
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=myk
parent
01c3f172
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
38 deletions
+116
-38
Install.pm
Bugzilla/Install.pm
+103
-0
Setting.pm
Bugzilla/User/Setting.pm
+11
-8
checksetup.pl
checksetup.pl
+2
-30
No files found.
Bugzilla/Install.pm
0 → 100644
View file @
b06a56e9
# -*- 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 <mkanat@bugzilla.org>
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<checksetup.pl> 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<SETTINGS>
Contains information about Settings, used by L</update_settings()>.
=back
=head1 SUBROUTINES
=over
=item C<update_settings()>
Description: Adds and updates Settings for users.
Params: none
Returns: nothing.
=back
Bugzilla/User/Setting.pm
View file @
b06a56e9
...
@@ -130,9 +130,10 @@ sub add_setting {
...
@@ -130,9 +130,10 @@ sub add_setting {
my
$sth
=
$dbh
->
prepare
(
q{INSERT INTO setting_value (name, value, sortindex)
my
$sth
=
$dbh
->
prepare
(
q{INSERT INTO setting_value (name, value, sortindex)
VALUES (?, ?, ?)}
);
VALUES (?, ?, ?)}
);
my
@values_list
=
keys
%
{
$values
};
my
$sortindex
=
5
;
foreach
my
$key
(
@values_list
){
foreach
my
$key
(
@$values
){
$sth
->
execute
(
$name
,
$key
,
$values
->
{
$key
});
$sth
->
execute
(
$name
,
$key
,
$sortindex
);
$sortindex
+=
5
;
}
}
}
}
...
@@ -307,17 +308,19 @@ $settings->{$setting_name} = new Bugzilla::User::Setting(
...
@@ -307,17 +308,19 @@ $settings->{$setting_name} = new Bugzilla::User::Setting(
=over 4
=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
Description: Checks for the existence of a setting, and adds it
to the database if it does not yet exist.
to the database if it does not yet exist.
Params: C<$name> - string - the name of the new setting
Params: C<$name> - string - the name of the new setting
C<$values> -
hash - contains the new values (key) and
C<$values> -
arrayref - contains the new choices
sortindexes for the new setting
for the new Setting.
C<$default_value> - string - the site default
C<$default_value> - string - the site default
Returns: a pointer to a hash of settings
Returns: a pointer to a hash of settings
#
#
=item C<get_all_settings($user_id)>
=item C<get_all_settings($user_id)>
Description: Provides the user's choices for each setting in the
Description: Provides the user's choices for each setting in the
...
...
checksetup.pl
View file @
b06a56e9
...
@@ -329,6 +329,7 @@ import Bugzilla::Install::Filesystem qw(update_filesystem create_htaccess
...
@@ -329,6 +329,7 @@ import Bugzilla::Install::Filesystem qw(update_filesystem create_htaccess
require
Bugzilla::
DB
;
require
Bugzilla::
DB
;
require
Bugzilla::
Template
;
require
Bugzilla::
Template
;
require
Bugzilla::
Install
;
###########################################################################
###########################################################################
# Check and update --LOCAL-- configuration
# Check and update --LOCAL-- configuration
...
@@ -3264,36 +3265,7 @@ if (!GroupDoesExist('bz_sudoers')) {
...
@@ -3264,36 +3265,7 @@ if (!GroupDoesExist('bz_sudoers')) {
# Create --SETTINGS-- users can adjust
# Create --SETTINGS-- users can adjust
###########################################################################
###########################################################################
# 2005-03-03 travis@sedsystems.ca -- Bug 41972
Bugzilla::Install::
update_settings
();
add_setting
(
"display_quips"
,
{
"on"
=>
1
,
"off"
=>
2
},
"on"
);
# 2005-03-10 travis@sedsystems.ca -- Bug 199048
add_setting
(
"comment_sort_order"
,
{
"oldest_to_newest"
=>
1
,
"newest_to_oldest"
=>
2
,
"newest_to_oldest_desc_first"
=>
3
},
"oldest_to_newest"
);
# 2005-05-12 bugzilla@glob.com.au -- Bug 63536
add_setting
(
"post_bug_submit_action"
,
{
"next_bug"
=>
1
,
"same_bug"
=>
2
,
"nothing"
=>
3
,
},
"next_bug"
);
# 2005-06-29 wurblzap@gmail.com -- Bug 257767
add_setting
(
'csv_colsepchar'
,
{
','
=>
1
,
';'
=>
2
},
','
);
# 2005-10-26 wurblzap@gmail.com -- Bug 291459
add_setting
(
"zoom_textareas"
,
{
"on"
=>
1
,
"off"
=>
2
},
"on"
);
# 2005-10-21 LpSolit@gmail.com -- Bug 313020
add_setting
(
'per_bug_queries'
,
{
'on'
=>
1
,
'off'
=>
2
},
'on'
);
# 2006-05-01 olav@bkor.dhs.org -- Bug 7710
add_setting
(
'state_addselfcc'
,
{
'always'
=>
1
,
'never'
=>
2
,
'cc_unless_role'
=>
'3'
},
'cc_unless_role'
);
###########################################################################
###########################################################################
# Create Administrator --ADMIN--
# Create Administrator --ADMIN--
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment