[Rt-commit] r14118 - in rt/branches/3.999-DANGEROUS: . lib/RT/Interface share/html/Admin/Global/CustomFields share/html/Dashboards share/html/Dashboards/Elements share/html/Elements share/html/Ticket/Elements share/html/Ticket/Graphs/Elements

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Jul 15 09:26:58 EDT 2008


Author: sunnavy
Date: Tue Jul 15 09:26:57 2008
New Revision: 14118

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm
   rt/branches/3.999-DANGEROUS/share/html/Admin/Global/CustomFields/Queues.html
   rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/DashboardsForObject
   rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/SelectPrivacy
   rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/ShowDashboards
   rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/Tabs
   rt/branches/3.999-DANGEROUS/share/html/Dashboards/Modify.html
   rt/branches/3.999-DANGEROUS/share/html/Dashboards/Queries.html
   rt/branches/3.999-DANGEROUS/share/html/Dashboards/Render.html
   rt/branches/3.999-DANGEROUS/share/html/Dashboards/Subscription.html
   rt/branches/3.999-DANGEROUS/share/html/Dashboards/index.html
   rt/branches/3.999-DANGEROUS/share/html/Elements/Dashboards
   rt/branches/3.999-DANGEROUS/share/html/Elements/HeaderJavascript
   rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/Bookmark
   rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/Elements/EditGraphProperties
   rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/Elements/ShowGraph
   rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/dhandler

Log:
 r14493 at sunnavys-mb:  sunnavy | 2008-07-15 20:18:34 +0800
 $session{'CurrentUser'} => Jifty->web->current_user


Modified: rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm	Tue Jul 15 09:26:57 2008
@@ -227,7 +227,7 @@
     # $HTML::Mason::Commands::r->headers_out->{'Last-Modified'} = $date->rfc2616;
 }
 
-sub StripContent {
+sub strip_content {
     my %args    = @_;
     my $content = $args{content};
     my $html    = ( ( $args{content_type} || '' ) eq "text/html" );
@@ -340,7 +340,7 @@
         $starts->set( format => 'unknown', value => $ARGS{'Starts'} );
     }
 
-    my $sigless = RT::Interface::Web::StripContent(
+    my $sigless = RT::Interface::Web::strip_content(
         content        => $ARGS{content},
         content_type    => $ARGS{content_type},
         strip_signature => 1,
@@ -553,7 +553,7 @@
     }
 
     # Strip the signature
-    $args{args_ref}->{update_content} = RT::Interface::Web::StripContent(
+    $args{args_ref}->{update_content} = RT::Interface::Web::strip_content(
         content        => $args{args_ref}->{update_content},
         content_type    => $args{args_ref}->{update_content_type},
         strip_signature => $args{skip_signature_only},

Modified: rt/branches/3.999-DANGEROUS/share/html/Admin/Global/CustomFields/Queues.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Admin/Global/CustomFields/Queues.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Admin/Global/CustomFields/Queues.html	Tue Jul 15 09:26:57 2008
@@ -54,5 +54,5 @@
     <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Model::Queue', Object=> $object &>
 <%INIT>
   my $title = loc( 'Edit Custom Fields for all queues');
-  my $object = RT::Model::Queue->new($session{'CurrentUser'});
+  my $object = RT::Model::Queue->new(Jifty->web->current_user);
 </%INIT>

Modified: rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/DashboardsForObject
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/DashboardsForObject	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/DashboardsForObject	Tue Jul 15 09:26:57 2008
@@ -57,7 +57,7 @@
 
 while (my $attr = $Object->Attributes->Next) {
     if ($attr->Name =~ /^Dashboard\b/) {
-        my $dashboard = RT::Dashboard->new($session{'CurrentUser'});
+        my $dashboard = RT::Dashboard->new(Jifty->web->current_user);
         my ($ok, $msg) = $dashboard->Load($privacy, $attr->id);
 
         if (!$ok) {

Modified: rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/SelectPrivacy
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/SelectPrivacy	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/SelectPrivacy	Tue Jul 15 09:26:57 2008
@@ -55,7 +55,7 @@
 % my $privacy = ref($object) . '-' . $object->id;
 % my $selected = $privacy eq ($Default || '') ? 'selected="selected"' : '';
 
-% if (ref($object) eq 'RT::Model::User' && $object->id == $session{'CurrentUser'}->Id) {
+% if (ref($object) eq 'RT::Model::User' && $object->id == Jifty->web->current_user->Id) {
 <option <%$selected|n%> value="<%$privacy%>"><&|/l&>My dashboards</&></option>
 % } else {
 <option <%$selected|n%> value="<%$privacy%>"><&|/l, $object->Name&>[_1]'s dashboards</&></option>

Modified: rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/ShowDashboards
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/ShowDashboards	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/ShowDashboards	Tue Jul 15 09:26:57 2008
@@ -61,7 +61,7 @@
 # map each subscription to a dashboard ID
 my %subscription_for;
 
-for my $attr ($session{'CurrentUser'}->user_object->attributes->named('Subscription')) {
+for my $attr (Jifty->web->current_user->user_object->attributes->named('Subscription')) {
     $subscription_for{$attr->SubValue('DashboardId')} = $attr;
 }
 </%INIT>

Modified: rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/Tabs
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/Tabs	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Dashboards/Elements/Tabs	Tue Jul 15 09:26:57 2008
@@ -99,7 +99,7 @@
 $tabs->{"A"} = { title => loc('Select dashboard'),
                  path  => "Dashboards/index.html" };
 
-my $dashboard = RT::Dashboard->new($session{'CurrentUser'});
+my $dashboard = RT::Dashboard->new(Jifty->web->current_user);
 my @objects = $dashboard->_PrivacyObjects(Create => 1);
 
 if (@objects) {

Modified: rt/branches/3.999-DANGEROUS/share/html/Dashboards/Modify.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Dashboards/Modify.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Dashboards/Modify.html	Tue Jul 15 09:26:57 2008
@@ -88,7 +88,7 @@
 
 use RT::Dashboard;
 
-my $Dashboard = RT::Dashboard->new($session{'CurrentUser'});
+my $Dashboard = RT::Dashboard->new(Jifty->web->current_user);
 my @privacies = $Dashboard->_PrivacyObjects(($Create ? 'Create' : 'Modify') => 1);
 
 Abort(loc("Permission denied")) if @privacies == 0;

Modified: rt/branches/3.999-DANGEROUS/share/html/Dashboards/Queries.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Dashboards/Queries.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Dashboards/Queries.html	Tue Jul 15 09:26:57 2008
@@ -82,7 +82,7 @@
 my @results;
 
 use RT::Dashboard;
-my $Dashboard = new RT::Dashboard($session{'CurrentUser'});
+my $Dashboard = new RT::Dashboard(Jifty->web->current_user);
 my ($ok, $msg) = $Dashboard->LoadById($id);
 $ok || Abort(loc("Couldn't load dashboard [_1]: [_2]", $id, $msg));
 my $title = loc("Modify the queries of dashboard [_1]", $Dashboard->Name);
@@ -99,11 +99,11 @@
     $desc_of{$name} = $desc;
 }
 
-my $sys = RT::System->new($session{'CurrentUser'});
+my $sys = RT::System->new(Jifty->web->current_user);
 my @objs = ($sys);
 
-push @objs, RT::SavedSearches->new( $session{CurrentUser} )->_PrivacyObjects
-    if $session{'CurrentUser'}->HasRight( Right  => 'LoadSavedSearch',
+push @objs, RT::SavedSearches->new( Jifty->web->current_user )->_PrivacyObjects
+    if Jifty->web->current_user->HasRight( Right  => 'LoadSavedSearch',
                                           Object => $RT::System );
 
 for my $object (@objs) {

Modified: rt/branches/3.999-DANGEROUS/share/html/Dashboards/Render.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Dashboards/Render.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Dashboards/Render.html	Tue Jul 15 09:26:57 2008
@@ -78,15 +78,15 @@
 my $current_subtab = 'Dashboards/Render.html?id=' . $id;
 
 use RT::Dashboard;
-my $DashboardObj = RT::Dashboard->new($session{'CurrentUser'});
+my $DashboardObj = RT::Dashboard->new(Jifty->web->current_user);
 my ($ok, $msg) = $DashboardObj->LoadById($id);
 Abort(loc("Couldn't load dashboard [_1]: [_2]", $id, $msg)) if !$ok;
 
-my $SubscriptionObj = RT::Model::Attribute->new($session{'CurrentUser'});
+my $SubscriptionObj = RT::Model::Attribute->new(Jifty->web->current_user);
 my $Loaded = 0;
 
 # try to load the subscription to this id
-for my $sub ($session{'CurrentUser'}->user_object->attributes->named('Subscription')) {
+for my $sub (Jifty->web->current_user->user_object->attributes->named('Subscription')) {
     next unless $sub->SubValue('DashboardId') == $id;
     $SubscriptionObj = $sub;
     $Loaded = 1;

Modified: rt/branches/3.999-DANGEROUS/share/html/Dashboards/Subscription.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Dashboards/Subscription.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Dashboards/Subscription.html	Tue Jul 15 09:26:57 2008
@@ -171,15 +171,15 @@
 my ($title, @results);
 my ($val, $msg);
 my $Loaded = 0;
-my $timezone = $session{'CurrentUser'}->user_object->timezone || RT->config->get('Timezone');
+my $timezone = Jifty->web->current_user->user_object->timezone || RT->config->get('Timezone');
 
 use RT::Dashboard;
-my $DashboardObj = RT::Dashboard->new($session{'CurrentUser'});
+my $DashboardObj = RT::Dashboard->new(Jifty->web->current_user);
 
-my $SubscriptionObj = RT::Model::Attribute->new($session{'CurrentUser'});
+my $SubscriptionObj = RT::Model::Attribute->new(Jifty->web->current_user);
 
 # first let's see if we already have a subscription to this DashboardId
-for my $sub ($session{'CurrentUser'}->user_object->attributes->named('Subscription')) {
+for my $sub (Jifty->web->current_user->user_object->attributes->named('Subscription')) {
     next unless $sub->SubValue('DashboardId') == $DashboardId;
     $SubscriptionObj = $sub;
     last;
@@ -240,13 +240,13 @@
             Name        => 'Subscription',
             description => 'Subscription to dashboard ' . $DashboardId,
             ContentType => 'storable',
-            Object      => $session{'CurrentUser'}->user_object,
+            Object      => Jifty->web->current_user->user_object,
             Content     => \%fields,
         );
         if ($val) {
             push @results, loc("Subscribed to dashboard [_1]", $DashboardObj->Name);
             push @results, loc("Warning: you have no email address set, so you will not receive this dashboard until you have it set")
-                unless $session{'CurrentUser'}->EmailAddress;
+                unless Jifty->web->current_user->EmailAddress;
         }
         else {
             push @results, loc('Subscription could not be created: [_1]', $msg);

Modified: rt/branches/3.999-DANGEROUS/share/html/Dashboards/index.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Dashboards/index.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Dashboards/index.html	Tue Jul 15 09:26:57 2008
@@ -73,7 +73,7 @@
 my $title = loc("Dashboards");
 use RT::Dashboard;
 
-my @objs = RT::Dashboard->new($session{CurrentUser})->_PrivacyObjects;
+my @objs = RT::Dashboard->new(Jifty->web->current_user)->_PrivacyObjects;
 my $dashboards = $m->comp("/Dashboards/Elements/DashboardsForObjects", Objects => \@objs);
 
 my @actions;

Modified: rt/branches/3.999-DANGEROUS/share/html/Elements/Dashboards
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Elements/Dashboards	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Elements/Dashboards	Tue Jul 15 09:26:57 2008
@@ -58,7 +58,7 @@
 <%INIT>
 use RT::Dashboard;
 
-my @objs = RT::Dashboard->new($session{CurrentUser})->_PrivacyObjects(ShowSystem => 1);
+my @objs = RT::Dashboard->new(Jifty->web->current_user)->_PrivacyObjects(ShowSystem => 1);
 my $dashboard_map = $m->comp("/Dashboards/Elements/DashboardsForObjects", Objects => \@objs);
 
 my @dashboards = (

Modified: rt/branches/3.999-DANGEROUS/share/html/Elements/HeaderJavascript
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Elements/HeaderJavascript	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Elements/HeaderJavascript	Tue Jul 15 09:26:57 2008
@@ -54,7 +54,7 @@
 <script type="text/javascript" src="<%RT->config->get('WebPath')%>/NoAuth/js/ahah.js"></script>
 <script type="text/javascript" src="<%RT->config->get('WebPath')%>/NoAuth/js/prototype/prototype.js"></script>
 <script type="text/javascript" src="<%RT->config->get('WebPath')%>/NoAuth/js/scriptaculous/scriptaculous.js?load=effects,controls"></script>
-% if ( RT->config->get('MessageBoxRichText',  $session{'CurrentUser'}) ) {
+% if ( RT->config->get('MessageBoxRichText',  Jifty->web->current_user) ) {
 <script type="text/javascript" src="<%RT->config->get('WebPath')%>/NoAuth/RichText/fckeditor.js"></script>
 % }
 <script type="text/javascript"><!--
@@ -63,7 +63,7 @@
     onLoadHook("focusElementById('<% $focus %>')");
 % }
 
-% if ( RT->config->get('MessageBoxRichText',  $session{'CurrentUser'})) {
+% if ( RT->config->get('MessageBoxRichText',  Jifty->web->current_user)) {
     function ReplaceAllTextareas() {
         if (!FCKeditor_IsCompatibleBrowser())
             return false;

Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/Bookmark
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/Bookmark	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/Bookmark	Tue Jul 15 09:26:57 2008
@@ -46,7 +46,7 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <%INIT>
-my $bookmarks = $session{'CurrentUser'}->user_object->first_attribute('Bookmarks');
+my $bookmarks = Jifty->web->current_user->user_object->first_attribute('Bookmarks');
 $bookmarks = $bookmarks->content if $bookmarks;
 $bookmarks ||= {};
 
@@ -56,7 +56,7 @@
     } else {
         $bookmarks->{ $id } = 1;
     }
-    $session{'CurrentUser'}->user_object->set_attribute(
+    Jifty->web->current_user->user_object->set_attribute(
         Name    => 'Bookmarks',
         Content => $bookmarks,
     );

Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/Elements/EditGraphProperties
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/Elements/EditGraphProperties	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/Elements/EditGraphProperties	Tue Jul 15 09:26:57 2008
@@ -76,7 +76,7 @@
 % }
 <br />
 
-% my @properties = RT::Graph::Tickets->TicketProperties( $session{'CurrentUser'} );
+% my @properties = RT::Graph::Tickets->TicketProperties( Jifty->web->current_user );
 
 Fill boxes with color using:
 <select name="FillUsing">

Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/Elements/ShowGraph
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/Elements/ShowGraph	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/Elements/ShowGraph	Tue Jul 15 09:26:57 2008
@@ -55,7 +55,7 @@
 <%INIT>
 use RT::Util 'safe_run_child';
 
-my $ticket = RT::Model::Ticket->new( $session{'CurrentUser'} );
+my $ticket = RT::Model::Ticket->new( Jifty->web->current_user );
 $ticket->Load( $id );
 unless ( $ticket->id ) {
     Jifty->log->error("Couldn't load ticket $id");

Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/dhandler
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/dhandler	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/Graphs/dhandler	Tue Jul 15 09:26:57 2008
@@ -55,7 +55,7 @@
     return $m->abort( 404 );
 }
 
-my $ticket = RT::Model::Ticket->new($session{'CurrentUser'} );
+my $ticket = RT::Model::Ticket->new(Jifty->web->current_user );
 $ticket->Load( $id );
 unless ( $ticket->id ) {
     Jifty->log->error("Couldn't load ticket #$id");


More information about the Rt-commit mailing list