[Rt-commit] r11907 - rt/branches/3.8-TESTING/lib/RT
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Sun Apr 27 11:39:15 EDT 2008
Author: sunnavy
Date: Sun Apr 27 11:39:15 2008
New Revision: 11907
Modified:
rt/branches/3.8-TESTING/lib/RT/Installer.pm
Log:
added timezone widget option
Modified: rt/branches/3.8-TESTING/lib/RT/Installer.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Installer.pm (original)
+++ rt/branches/3.8-TESTING/lib/RT/Installer.pm Sun Apr 27 11:39:15 2008
@@ -134,6 +134,27 @@
);
+my $HAS_DATETIME_TZ = eval { require DateTime::TimeZonse };
+
+if ($HAS_DATETIME_TZ) {
+ $Meta{TimeZone} = {
+ Widget => '/Widgets/Form/Select',
+ WidgetArguments => {
+ Description => 'TimeZone',
+ Values => [ '', DateTime::TimeZone->all_names ],
+ ValuesLabel => {
+ '' => 'System Default', #loc
+ },
+ },
+ };
+}
+else {
+ $Meta{TimeZone} = {
+ Widget => '/Widgets/Form/String',
+ WidgetArguments => { Description => 'TimeZone', },
+ };
+}
+
sub Meta {
my $class = shift;
my $type = shift;
@@ -147,8 +168,8 @@
$type = $class if !ref $class && $class && $class ne 'RT::Installer';
return undef unless $type;
- return
- $RT::Installer && exists $RT::Installer->{InstallConfig}{$type}
+ return $RT::Installer
+ && exists $RT::Installer->{InstallConfig}{$type}
? $RT::Installer->{InstallConfig}{$type}
: scalar RT->Config->Get($type);
}
@@ -158,7 +179,7 @@
my @types = @_;
push @types, $class if !ref $class && $class && $class ne 'RT::Installer';
- return { map { $_ => CurrentValue($_ ) } @types };
+ return { map { $_ => CurrentValue($_) } @types };
}
=head1 NAME
More information about the Rt-commit
mailing list