[Rt-commit] rt branch, admin_ui, updated. 64ab88d316c16b3947586faf0db86792dc8108c1

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Dec 22 02:40:57 EST 2009


The branch, admin_ui has been updated
       via  64ab88d316c16b3947586faf0db86792dc8108c1 (commit)
      from  7d7a2fe995f6f69723dc6d3140fe011655d66dc6 (commit)

Summary of changes:
 lib/RT/View/Admin/Users.pm |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 64ab88d316c16b3947586faf0db86792dc8108c1
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Dec 22 15:40:44 2009 +0800

    fill /admin/users/history

diff --git a/lib/RT/View/Admin/Users.pm b/lib/RT/View/Admin/Users.pm
index e06d281..f948d0e 100644
--- a/lib/RT/View/Admin/Users.pm
+++ b/lib/RT/View/Admin/Users.pm
@@ -109,6 +109,44 @@ template 'gnupg' => page { title => _('User GnuPG') } content {
 
 template 'history' => page { title => _('User History') } content {
     my $self = shift;
+    my $id = get('id') or return;
+    my $user = RT::Model::User->new( current_user => Jifty->web->current_user );
+    my ( $status, $msg ) = $user->load($id);
+    if ( $status ) {
+        my $txns = $user->transactions;
+        $txns->order_by(
+            {
+                column => 'Created',
+                order  => 'ASC', 
+            },
+            {
+                column => 'id',
+                order  => 'ASC',
+            },
+        );
+        my $row_num = 1;
+        div {
+            attr { id => 'ticket-history' };
+            while ( my $txn = $txns->next ) {
+                div {
+                    attr { class => $row_num++ % 2 ? 'odd' : 'even' };
+                    div {
+                        attr { class => 'metadata' }
+                          span { attr { class => 'date' }; $txn->created };
+                        span {
+                            attr { class => 'description' };
+                            $txn->creator->name . ' - '
+                              . $txn->brief_description;
+                        };
+                    };
+                };
+            }
+        };
+        # removed txn attachments and txn cfs that were here in mason pages
+    }
+    else {
+        Jifty->log->error( "failed to load user with id $id: $msg" );
+    }
 
 };
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list