summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Installer.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rt/lib/RT/Installer.pm')
-rw-r--r--rt/lib/RT/Installer.pm60
1 files changed, 23 insertions, 37 deletions
diff --git a/rt/lib/RT/Installer.pm b/rt/lib/RT/Installer.pm
index 0cf4d01cc..3976adec6 100644
--- a/rt/lib/RT/Installer.pm
+++ b/rt/lib/RT/Installer.pm
@@ -2,7 +2,7 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -50,6 +50,8 @@ package RT::Installer;
use strict;
use warnings;
+use DateTime;
+
require UNIVERSAL::require;
my %Meta = (
DatabaseType => {
@@ -184,27 +186,7 @@ my %Meta = (
Description => 'Path to sendmail', #loc
},
},
- WebDomain => {
- Widget => '/Widgets/Form/String',
- WidgetArguments => {
- Description => 'Domain name', #loc
- Hints => "Don't include http://, just something like 'localhost', 'rt.example.com'", #loc
- },
- },
- WebPort => {
- Widget => '/Widgets/Form/Integer',
- WidgetArguments => {
- Description => 'Web port', #loc
- Hints => 'which port your web server will listen to, e.g. 8080', #loc
- },
- },
-
-);
-
-my $HAS_DATETIME_TZ = eval { require DateTime::TimeZone };
-
-if ($HAS_DATETIME_TZ) {
- $Meta{Timezone} = {
+ Timezone => {
Widget => '/Widgets/Form/Select',
WidgetArguments => {
Description => 'Timezone', #loc
@@ -212,30 +194,34 @@ if ($HAS_DATETIME_TZ) {
my $ret;
$ret->{Values} = ['', DateTime::TimeZone->all_names];
- my $has_datetime = eval { require DateTime };
- if ( $has_datetime ) {
- my $dt = DateTime->now;
- for my $tz ( DateTime::TimeZone->all_names ) {
- $dt->set_time_zone( $tz );
- $ret->{ValuesLabel}{$tz} =
- $tz . ' ' . $dt->strftime('%z');
- }
+ my $dt = DateTime->now;
+ for my $tz ( DateTime::TimeZone->all_names ) {
+ $dt->set_time_zone( $tz );
+ $ret->{ValuesLabel}{$tz} =
+ $tz . ' ' . $dt->strftime('%z');
}
$ret->{ValuesLabel}{''} = 'System Default'; #loc
return $ret;
},
},
- };
-}
-else {
- $Meta{Timezone} = {
+ },
+ WebDomain => {
Widget => '/Widgets/Form/String',
WidgetArguments => {
- Description => 'Timezone', #loc
+ Description => 'Domain name', #loc
+ Hints => "Don't include http://, just something like 'localhost', 'rt.example.com'", #loc
},
- };
-}
+ },
+ WebPort => {
+ Widget => '/Widgets/Form/Integer',
+ WidgetArguments => {
+ Description => 'Web port', #loc
+ Hints => 'which port your web server will listen to, e.g. 8080', #loc
+ },
+ },
+
+);
sub Meta {
my $class = shift;