[Rt-commit] r18914 - in rt/3.999/branches/config-in-db: sbin share/html/Dashboards t/api

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Mar 23 02:35:26 EDT 2009


Author: sunnavy
Date: Mon Mar 23 02:35:26 2009
New Revision: 18914

Modified:
   rt/3.999/branches/config-in-db/lib/RT/Bootstrap.pm
   rt/3.999/branches/config-in-db/lib/RT/DateTime.pm
   rt/3.999/branches/config-in-db/sbin/rt-email-dashboards
   rt/3.999/branches/config-in-db/share/html/Dashboards/Subscription.html
   rt/3.999/branches/config-in-db/t/api/date.t

Log:
timezone => time_zone

Modified: rt/3.999/branches/config-in-db/lib/RT/Bootstrap.pm
==============================================================================
--- rt/3.999/branches/config-in-db/lib/RT/Bootstrap.pm	(original)
+++ rt/3.999/branches/config-in-db/lib/RT/Bootstrap.pm	Mon Mar 23 02:35:26 2009
@@ -181,7 +181,7 @@
         'store_loops'                            => undef,
         'strict_link_acl'                        => 1,
         'suppress_inline_text_files'             => undef,
-        'timezone'                               => 'America/New_York',
+        'time_zone'                              => 'America/New_York',
         'truncate_long_attachments'              => undef,
         'trust_html_attachments'                 => undef,
         'use_friendly_from_line'                 => 1,

Modified: rt/3.999/branches/config-in-db/lib/RT/DateTime.pm
==============================================================================
--- rt/3.999/branches/config-in-db/lib/RT/DateTime.pm	(original)
+++ rt/3.999/branches/config-in-db/lib/RT/DateTime.pm	Mon Mar 23 02:35:26 2009
@@ -29,7 +29,7 @@
     # if the "user" time zone is requested and the user has none, use the
     # "server" time zone
     if (!$tz || lc($tz) eq 'server' || lc($tz) eq 'system') {
-        $tz = RT->config->get('TimeZone');
+        $tz = RT->config->get('time_zone');
     }
 
     return $tz || $default;
@@ -135,7 +135,7 @@
 sub config_format {
     my $self = _canonicalize_self(@_);
 
-    return $self->strftime(RT->config->get('DateTimeFormat'));
+    return $self->strftime(RT->config->get('date_time_format'));
 }
 
 sub date {

Modified: rt/3.999/branches/config-in-db/sbin/rt-email-dashboards
==============================================================================
--- rt/3.999/branches/config-in-db/sbin/rt-email-dashboards	(original)
+++ rt/3.999/branches/config-in-db/sbin/rt-email-dashboards	Mon Mar 23 02:35:26 2009
@@ -121,7 +121,7 @@
         next;
     }
 
-    my ($hour, $dow, $dom) = hour_dow_dom_in($user->timezone || RT->config->get('timezone'));
+    my ($hour, $dow, $dom) = hour_dow_dom_in($user->time_zone || RT->config->get('time_zone'));
     $hour .= ':00';
     debug "Checking %1's subscriptions: hour %2, dow %3, dom %4",
           $user->name, $hour, $dow, $dom;

Modified: rt/3.999/branches/config-in-db/share/html/Dashboards/Subscription.html
==============================================================================
--- rt/3.999/branches/config-in-db/share/html/Dashboards/Subscription.html	(original)
+++ rt/3.999/branches/config-in-db/share/html/Dashboards/Subscription.html	Mon Mar 23 02:35:26 2009
@@ -146,7 +146,7 @@
     <option value="<% $formatted %>" <%$selected%>><% $formatted %></option>
 % }
 </select>
-(in <%$time_zone%>)
+(in <%$timezone%>)
 </td></tr>
 <tr><td class="label">
 <&|/l&>Rows</&>:
@@ -185,7 +185,7 @@
 my ($title, @results);
 my ($val, $msg);
 my $Loaded = 0;
-my $timezone = Jifty->web->current_user->user_object->timezone || RT->config->get('timezone');
+my $timezone = Jifty->web->current_user->user_object->time_zone || RT->config->get('time_zone');
 
 use RT::Dashboard;
 my $dashboard_obj = RT::Dashboard->new( current_user => Jifty->web->current_user );

Modified: rt/3.999/branches/config-in-db/t/api/date.t
==============================================================================
--- rt/3.999/branches/config-in-db/t/api/date.t	(original)
+++ rt/3.999/branches/config-in-db/t/api/date.t	Mon Mar 23 02:35:26 2009
@@ -24,7 +24,7 @@
     # set time zone in all places to UTC
     RT->system_user->user_object->__set(column => 'time_zone', value => 'UTC')
                                 if RT->system_user->user_object->time_zone;
-    RT->config->set( TimeZone => 'UTC' );
+    RT->config->set( time_zone => 'UTC' );
 }
 
 my $current_user;
@@ -56,7 +56,7 @@
     is($date->time_zone->name, 'Europe/Moscow', "we changed the timezone");
     is($date->set_time_zone('server')->time_zone->name, 'UTC', "wasn't changed");
 
-    RT->config->set( TimeZone => 'Africa/Ouagadougou' );
+    RT->config->set( time_zone => 'Africa/Ouagadougou' );
     is($date->set_time_zone('server')->time_zone->name,
        'Africa/Ouagadougou',
        "time_zone of the RT server was changed");
@@ -74,12 +74,12 @@
        "in user context returns time zone of the server if user's one is not defined");
     is($date->time_zone->name, 'Africa/Ouagadougou', "we changed the timezone");
 
-    RT->config->set( TimeZone => 'GMT' );
+    RT->config->set( time_zone => 'GMT' );
     is($date->set_time_zone('server')->time_zone->name,
        'UTC',
        "time zone is GMT which one is alias for UTC");
 
-    RT->config->set( TimeZone => '' );
+    RT->config->set( time_zone => '' );
     is($date->time_zone->name, 'UTC', "dropped all timzones to UTC");
     is($date->set_time_zone('user')->time_zone->name,
        'UTC',
@@ -88,7 +88,7 @@
        'UTC',
        "time zone of the server is not defined so UTC");
 
-    RT->config->set( TimeZone => 'UTC' );
+    RT->config->set( time_zone => 'UTC' );
 }
 
 {
@@ -199,12 +199,12 @@
 }
 
 { # set+datemanip format(time::ParseDate)
-    RT->config->set( TimeZone => 'Europe/Moscow' );
+    RT->config->set( time_zone => 'Europe/Moscow' );
     my $date = RT::DateTime->new_from_string('2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
     is($date->iso(time_zone => 'server'), '2005-11-28 23:10:00', "YYYY-DD-MM hh:mm:ss");
 
-    RT->config->set( TimeZone => 'UTC' );
+    RT->config->set( time_zone => 'UTC' );
     $date = RT::DateTime->new_from_string('2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
     is($date->iso(time_zone => 'server'), '2005-11-28 20:10:00', "YYYY-DD-MM hh:mm:ss");
@@ -216,7 +216,7 @@
 }
 
 {
-    RT->config->set( TimeZone => 'Europe/Moscow' );
+    RT->config->set( time_zone => 'Europe/Moscow' );
     my $date = RT::DateTime->new_from_string('2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
 
@@ -230,7 +230,7 @@
     $date = RT::DateTime->new_from_string('1 day ago');
     is($date->iso, '2005-11-27 13:10:00', "YYYY-DD-MM hh:mm:ss");
 
-    RT->config->set( TimeZone => 'UTC' );
+    RT->config->set( time_zone => 'UTC' );
     $date = RT::DateTime->new_from_string('2005-11-28 15:10:00');
     is($date->iso, '2005-11-28 15:10:00', "YYYY-DD-MM hh:mm:ss");
 
@@ -248,14 +248,14 @@
     my $date = RT::DateTime->from_epoch(epoch => 0);
     is($date, "unset", "epoch 0 returns 'unset'");
 
-    RT->config->set( DateTimeFormat => '%a %b %d %H:%M:%S %Y');
+    RT->config->set( date_time_format => '%a %b %d %H:%M:%S %Y');
     $date = RT::DateTime->from_epoch(epoch => 1);
     is($date, 'Thu Jan 01 00:00:01 1970', "correct string");
 
-    RT->config->set( DateTimeFormat => '%a, %d %b %Y %H:%M:%S %z' );
+    RT->config->set( date_time_format => '%a, %d %b %Y %H:%M:%S %z' );
     is($date, 'Thu, 01 Jan 1970 00:00:01 +0000', "correct string");
 
-    RT->config->set( DateTimeFormat => '%a, %d %b %Y %H:%M %z' );
+    RT->config->set( date_time_format => '%a, %d %b %Y %H:%M %z' );
     is($date, 'Thu, 01 Jan 1970 00:00 +0000', "correct string");
 }
 


More information about the Rt-commit mailing list