X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FInstaller.pm;fp=rt%2Flib%2FRT%2FInstaller.pm;h=3976adec63ff5b5146bdad03450ed51be78829e4;hb=43a06151e47d2c59b833cbd8c26d97865ee850b6;hp=0cf4d01cce8428e7ae89487d732f32bdc1547679;hpb=6587f6ba7d047ddc1686c080090afe7d53365bd4;p=freeside.git 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 # # # (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;