[Rt-commit] rt branch, admin_ui, updated. e8c754176a2672ee8b5c0cc33c7479e63622061a

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Dec 28 14:35:34 EST 2009


The branch, admin_ui has been updated
       via  e8c754176a2672ee8b5c0cc33c7479e63622061a (commit)
       via  b75cc865e3000edecc77f35686c102965fcd6eac (commit)
      from  a93f022d32d69debc13c32dcfac5a42bebfc7ea5 (commit)

Summary of changes:
 lib/RT/Action/ConfigMyRT.pm               |   50 ++++++------
 lib/RT/Action/EditGroupMembers.pm         |   40 +++++-----
 lib/RT/Action/EditGroupRights.pm          |    4 +-
 lib/RT/Action/EditQueueGnuPG.pm           |   16 ++--
 lib/RT/Action/EditRights.pm               |   42 +++++-----
 lib/RT/Action/EditUserMemberships.pm      |   38 +++++-----
 lib/RT/Action/EditUserRights.pm           |    2 +-
 lib/RT/Action/EditWatchers.pm             |   40 +++++-----
 lib/RT/Action/SelectCustomFields.pm       |   42 +++++-----
 lib/RT/Action/SelectObjectCustomFields.pm |   30 ++++----
 lib/RT/Action/SelectPrivateKey.pm         |   39 +++++-----
 lib/RT/Dispatcher.pm                      |   30 ++++++++
 lib/RT/View/Admin/CustomFields.pm         |   18 +----
 lib/RT/View/Admin/Global.pm               |   25 +++----
 lib/RT/View/Admin/Groups.pm               |   29 ++------
 lib/RT/View/Admin/Queues.pm               |   98 +++++++++++++++++-------
 lib/RT/View/Admin/Users.pm                |  117 +++++++++++++++++++----------
 lib/RT/View/Helpers.pm                    |   57 +--------------
 18 files changed, 371 insertions(+), 346 deletions(-)

- Log -----------------------------------------------------------------
commit b75cc865e3000edecc77f35686c102965fcd6eac
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Dec 29 00:26:45 2009 +0800

    make sure the ":"s are outside the localised strings.
    put helpers that are specific to showing a admin stuff in their own packages

diff --git a/lib/RT/View/Admin/Queues.pm b/lib/RT/View/Admin/Queues.pm
index aab1b5a..0dccf30 100644
--- a/lib/RT/View/Admin/Queues.pm
+++ b/lib/RT/View/Admin/Queues.pm
@@ -50,7 +50,6 @@ use strict;
 
 package RT::View::Admin::Queues;
 use Jifty::View::Declare -base;
-use RT::View::Helpers qw/show_key_info/;
 use base 'RT::View::CRUD';
 
 require RT::View::Admin::Queues::Templates;
@@ -223,16 +222,71 @@ template 'gnupg' => page { title => _('Queue GnuPG') } content {
     };
 
     if ( $queue->correspond_address ) {
-        show_key_info( $queue->correspond_address, 'private' );
+        show( 'key_info', $queue->correspond_address, 'private' );
     }
 
     if ( $queue->comment_address ) {
-        show_key_info( $queue->comment_address, 'private' );
+        show( 'key_info', $queue->comment_address, 'private' );
     }
 
 
 };
 
+private template 'key_info' => sub {
+    my $self  = shift;
+    my $email = shift;
+    my $type  = shift;
+    my %res   = RT::Crypt::GnuPG::get_key_info( $email, $type );
+
+    if ( $res{'exit_code'} || !keys %{ $res{'info'} } ) {
+        outs( _('No keys for this address') );
+    }
+    else {
+        h3 { _( 'GnuPG public key for %1', $email ) };
+        table {
+            row {
+                th { _('Trust') . ':' };
+                cell {
+                    _( $res{'info'}{'trust'} );
+                };
+            };
+            row {
+                th { _('Created') . ':' };
+                cell {
+                    $res{'info'}{'created'}
+                      ? $res{'info'}{'created'}->date
+                      : _('never');
+                };
+            };
+
+            row {
+                th { _('Expire') . ':' };
+                cell {
+                    $res{'info'}{'expire'}
+                      ? $res{'info'}{'expire'}->date
+                      : _('never');
+                };
+            };
+
+            for my $uinfo ( @{ $res{'info'}{'user'} } ) {
+                row {
+                    th { _('User (Created - expire)') . ':' };
+                    cell {
+                        $uinfo->{'string'} . '('
+                          . (
+                            $uinfo->{'created'} ? $uinfo->{'created'}->date
+                            : _('never') . ' - '
+                          )
+                          . (
+                            $uinfo->{'expire'} ? $uinfo->{'expire'}->date
+                            : _('never')
+                          ) . ')';
+                    };
+                };
+            }
+        };
+    }
+};
 
 1;
 
diff --git a/lib/RT/View/Admin/Users.pm b/lib/RT/View/Admin/Users.pm
index ed0c698..1440312 100644
--- a/lib/RT/View/Admin/Users.pm
+++ b/lib/RT/View/Admin/Users.pm
@@ -50,7 +50,6 @@ use strict;
 
 package RT::View::Admin::Users;
 use Jifty::View::Declare -base;
-use RT::View::Helpers qw/show_key_info/;
 use base 'RT::View::CRUD';
 
 use constant page_title      => 'User Management';
@@ -141,7 +140,7 @@ template 'gnupg' => page { title => _('User GnuPG') } content {
         return;
     }
 
-    show_key_info( $user->email, 'public' );
+    show( 'key_info', $user->email, 'public' );
 
     my $moniker = 'select_private_key';
     my $action = new_action(
@@ -224,6 +223,61 @@ template 'my_rt' => page { title => _('MyRT for User') } content {
 
 };
 
+private template 'key_info' => sub {
+    my $self  = shift;
+    my $email = shift;
+    my $type  = shift;
+    my %res   = RT::Crypt::GnuPG::get_key_info( $email, $type );
+
+    if ( $res{'exit_code'} || !keys %{ $res{'info'} } ) {
+        outs( _('No keys for this address') );
+    }
+    else {
+        h3 { _( 'GnuPG public key for %1', $email ) };
+        table {
+            row {
+                th { _('Trust') . ':' };
+                cell {
+                    _( $res{'info'}{'trust'} );
+                };
+            };
+            row {
+                th { _('Created') . ':' };
+                cell {
+                    $res{'info'}{'created'}
+                      ? $res{'info'}{'created'}->date
+                      : _('never');
+                };
+            };
+
+            row {
+                th { _('Expire') . ':' };
+                cell {
+                    $res{'info'}{'expire'}
+                      ? $res{'info'}{'expire'}->date
+                      : _('never');
+                };
+            };
+
+            for my $uinfo ( @{ $res{'info'}{'user'} } ) {
+                row {
+                    th { _('User (Created - expire)') . ':' };
+                    cell {
+                        $uinfo->{'string'} . '('
+                          . (
+                            $uinfo->{'created'} ? $uinfo->{'created'}->date
+                            : _('never') . ' - '
+                          )
+                          . (
+                            $uinfo->{'expire'} ? $uinfo->{'expire'}->date
+                            : _('never')
+                          ) . ')';
+                    };
+                };
+            }
+        };
+    }
+};
 
 1;
 
diff --git a/lib/RT/View/Helpers.pm b/lib/RT/View/Helpers.pm
index da3c23d..6ff8347 100644
--- a/lib/RT/View/Helpers.pm
+++ b/lib/RT/View/Helpers.pm
@@ -53,8 +53,7 @@ use Jifty::View::Declare -base;
 
 use base qw/Exporter/;
 our @EXPORT    = ();
-our @EXPORT_OK = qw(render_user render_user_concise render_user_verbose
-        show_key_info );
+our @EXPORT_OK = qw(render_user render_user_concise render_user_verbose);
 
 sub render_user {
     my $user = shift;
@@ -117,60 +116,6 @@ sub render_user_verbose {
     return $address->format;
 }
 
-sub show_key_info {
-    my $email = shift;
-    my $type = shift || 'public';
-    my %res = RT::Crypt::GnuPG::get_key_info( $email, $type );
-
-    if ( $res{'exit_code'} || !keys %{ $res{'info'} } ) {
-        outs( _('No keys for this address') );
-    }
-    else {
-        h3 { _('GnuPG public key for %1', $email) };
-        table {
-            row {
-                th { _( 'Trust' . ':' ) };
-                cell {
-                    _( $res{'info'}{'trust'} );
-                };
-            };
-            row {
-                th { _( 'Created' . ':' ) };
-                cell {
-                    $res{'info'}{'created'}
-                      ? $res{'info'}{'created'}->date
-                      : _('never');
-                };
-            };
-
-            row {
-                th { _('Expire') . ':' };
-                cell {
-                    $res{'info'}{'expire'}
-                      ? $res{'info'}{'expire'}->date
-                      : _('never');
-                };
-            };
-
-            for my $uinfo ( @{ $res{'info'}{'user'} } ) {
-                row {
-                    th { _('User (Created - expire)') . ':' };
-                    cell {
-                        $uinfo->{'string'}
-                          . '(' . (
-                            $uinfo->{'created'} ? $uinfo->{'created'}->date
-                            : _('never') . ' - ' 
-                          )
-                          . (
-                            $uinfo->{'expire'} ? $uinfo->{'expire'}->date
-                            : _('never')
-                          ) . ')';
-                    };
-                };
-            }
-        };
-    }
-}
 
 1;
 

commit e8c754176a2672ee8b5c0cc33c7479e63622061a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Dec 29 03:32:31 2009 +0800

    refactor admin actions, changes are:
    
    name changes: object => record, object_id => record_id, object_type => record_class
    moniker tweaks
    the most important change is that we don't need to render an extra id
    field or alike, which is so wrong and does not use jifty's strength at all.

diff --git a/lib/RT/Action/ConfigMyRT.pm b/lib/RT/Action/ConfigMyRT.pm
index 12ec315..4ef8af5 100644
--- a/lib/RT/Action/ConfigMyRT.pm
+++ b/lib/RT/Action/ConfigMyRT.pm
@@ -6,24 +6,24 @@ use base qw/RT::Action Jifty::Action/;
 use RT::View::Helpers qw/render_user/;
 use Scalar::Defer;
 
-__PACKAGE__->mk_accessors('object');
+__PACKAGE__->mk_accessors('record');
 
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
 
     my $args = {};
-    $args->{object_id} = {
+    $args->{record_id} = {
         render_as     => 'hidden',
-        default_value => $self->object->id,
+        default_value => $self->record->id,
     };
-    $args->{object_type} = {
+    $args->{record_class} = {
         render_as     => 'hidden',
-        default_value => ref $self->object,
+        default_value => ref $self->record,
     };
 
-    if ( ref $self->object ne 'RT::System' ) {
+    if ( ref $self->record ne 'RT::System' ) {
         $args->{'reset'} = {
             render_as     => 'InlineButton',
             default_value => 1,
@@ -47,29 +47,29 @@ sub arguments {
 
 sub take_action {
     my $self = shift;
-    my $object_type = $self->argument_value('object_type');
-    return unless $object_type;
-    if ( $object_type eq 'RT::System' ) {
-        $self->object( RT->system );
+    my $record_class = $self->argument_value('record_class');
+    return unless $record_class;
+    if ( $record_class eq 'RT::System' ) {
+        $self->record( RT->system );
     }
-    elsif ( $RT::Model::ACE::OBJECT_TYPES{$object_type} ) {
-        my $object = $object_type->new;
-        my $object_id = $self->argument_value('object_id');
-        $object->load($object_id);
+    elsif ( $RT::Model::ACE::OBJECT_TYPES{$record_class} ) {
+        my $object = $record_class->new;
+        my $record_id = $self->argument_value('record_id');
+        $object->load($record_id);
         unless ( $object->id ) {
-            Jifty->log->error("couldn't load $object_type #$object_id");
+            Jifty->log->error("couldn't load $record_class #$record_id");
             return;
         }
 
-        $self->object($object);
+        $self->record($object);
     }
     else {
-        Jifty->log->error("object type '$object_type' is incorrect");
+        Jifty->log->error("record class '$record_class' is incorrect");
         return;
     }
 
-    if ( $self->argument_value('reset') && $object_type ne 'RT::System' ) {
-        $self->object->set_preferences('HomepageSettings', {});
+    if ( $self->argument_value('reset') && $record_class ne 'RT::System' ) {
+        $self->record->set_preferences('HomepageSettings', {});
     }
     else {
 
@@ -92,13 +92,13 @@ sub take_action {
             $content->{$arg} = \@panes;
         }
 
-        if ( ref $self->object eq 'RT::System' ) {
+        if ( ref $self->record eq 'RT::System' ) {
             my ($settings) =
-              $self->object->attributes->named('HomepageSettings');
+              $self->record->attributes->named('HomepageSettings');
             $settings->set_content($content);
         }
         else {
-            $self->object->set_preferences( 'HomepageSettings' => $content );
+            $self->record->set_preferences( 'HomepageSettings' => $content );
         }
     }
     $self->report_success;
@@ -136,8 +136,8 @@ sub default_value {
     my ( $settings ) = RT->system->attributes->named('HomepageSettings');
     my $content  = $settings ? $settings->content : {};
 
-    if ( ref $self->object ne 'RT::System' ) {
-        $content = $self->object->preferences( 'HomepageSettings', $content );
+    if ( ref $self->record ne 'RT::System' ) {
+        $content = $self->record->preferences( 'HomepageSettings', $content );
     }
 
     return $content unless $type;
diff --git a/lib/RT/Action/EditGroupMembers.pm b/lib/RT/Action/EditGroupMembers.pm
index 59ac25c..346f6ca 100644
--- a/lib/RT/Action/EditGroupMembers.pm
+++ b/lib/RT/Action/EditGroupMembers.pm
@@ -6,20 +6,20 @@ package RT::Action::EditGroupMembers;
 use base qw/RT::Action Jifty::Action/;
 use Scalar::Defer;
 
-__PACKAGE__->mk_accessors('object');
+__PACKAGE__->mk_accessors('record');
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
 
     my $args = {};
-    $args->{object_id} = {
+    $args->{record_id} = {
         render_as     => 'hidden',
-        default_value => $self->object->id,
+        default_value => $self->record->id,
     };
-    $args->{object_type} = {
+    $args->{record_class} = {
         render_as     => 'hidden',
-        default_value => ref $self->object,
+        default_value => ref $self->record,
     };
 
     $args->{users} = {
@@ -42,21 +42,21 @@ sub arguments {
 sub take_action {
     my $self = shift;
 
-    my $object_type = $self->argument_value('object_type');
-    return unless $object_type;
-    if ( $RT::Model::ACE::OBJECT_TYPES{$object_type} ) {
-        my $object    = $object_type->new;
-        my $object_id = $self->argument_value('object_id');
-        $object->load($object_id);
+    my $record_class = $self->argument_value('record_class');
+    return unless $record_class;
+    if ( $RT::Model::ACE::OBJECT_TYPES{$record_class} ) {
+        my $object    = $record_class->new;
+        my $record_id = $self->argument_value('record_id');
+        $object->load($record_id);
         unless ( $object->id ) {
-            Jifty->log->error("couldn't load $object_type #$object_id");
+            Jifty->log->error("couldn't load $record_class #$record_id");
             return;
         }
 
-        $self->object($object);
+        $self->record($object);
     }
     else {
-        Jifty->log->error("object type '$object_type' is incorrect");
+        Jifty->log->error("record class '$record_class' is incorrect");
         return;
     }
 
@@ -79,14 +79,14 @@ sub take_action {
             next if $members{$member};
 
             my ( $val, $msg ) =
-              $self->object->delete_member( $member );
+              $self->record->delete_member( $member );
             Jifty->log->error($msg) unless $val;
         }
 
         for my $member ( keys %members ) {
             next if $current_members{$member};
             my ( $val, $msg ) =
-              $self->object->add_member( $member );
+              $self->record->add_member( $member );
             Jifty->log->error($msg) unless $val;
         }
     }
@@ -133,7 +133,7 @@ sub available_values {
         # self-recursive group membership considered harmful!
         $collection->limit(
             column   => 'id',
-            value    => $self->object->id,
+            value    => $self->record->id,
             operator => '!='
         );
         $collection->limit(
@@ -151,14 +151,14 @@ sub default_value {
     my $type = shift || 'user';
     my @values;
     if ( $type eq 'user' ) {
-        my $users = $self->object->user_members( recursively => 0 );
+        my $users = $self->record->user_members( recursively => 0 );
         $users->order_by( column => 'name', order => 'ASC'  );
         while ( my $user = $users->next ) {
             push @values, $user->id;
         }
     }
     else {
-        my $group_members = $self->object->members;
+        my $group_members = $self->record->members;
         $group_members->limit_to_groups();
         while ( my $member = $group_members->next ) {
             push @values, $member->member_id;
diff --git a/lib/RT/Action/EditGroupRights.pm b/lib/RT/Action/EditGroupRights.pm
index 44a5e68..d3d26b2 100644
--- a/lib/RT/Action/EditGroupRights.pm
+++ b/lib/RT/Action/EditGroupRights.pm
@@ -8,7 +8,7 @@ use Scalar::Defer;
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
     my $args = $self->SUPER::arguments( @_ );
 
     my @groups;
@@ -32,7 +32,7 @@ sub arguments {
     {
         my $groups =
           RT::Model::GroupCollection->new;
-        $groups->limit_to_roles( object => $self->object );
+        $groups->limit_to_roles( object => $self->record );
         while ( my $group = $groups->next ) {
             push @groups, $group;
         }
diff --git a/lib/RT/Action/EditQueueGnuPG.pm b/lib/RT/Action/EditQueueGnuPG.pm
index 8d6cd50..797b223 100644
--- a/lib/RT/Action/EditQueueGnuPG.pm
+++ b/lib/RT/Action/EditQueueGnuPG.pm
@@ -5,22 +5,22 @@ package RT::Action::EditQueueGnuPG;
 use base qw/RT::Action Jifty::Action/;
 use Scalar::Defer;
 
-__PACKAGE__->mk_accessors('queue');
+__PACKAGE__->mk_accessors('record');
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->queue;
+    return {} unless $self->record;
 
     my $args = {};
-    $args->{queue_id} = {
+    $args->{record_id} = {
         render_as     => 'hidden',
-        default_value => $self->queue->id,
+        default_value => $self->record->id,
     };
 
     for my $type (qw/sign encrypt/) {
         $args->{$type} = {
             render_as        => 'Checkbox',
-            default_value    => defer { $self->queue->$type },
+            default_value    => defer { $self->record->$type },
         };
     }
     return $args;
@@ -34,19 +34,19 @@ sub take_action {
     my $self = shift;
 
     my $queue = RT::Model::Queue->new;
-    my $id    = $self->argument_value('queue_id');
+    my $id    = $self->argument_value('record_id');
     $queue->load($id);
     unless ( $queue->id ) {
         Jifty->log->error("couldn't load queue #$id");
         return;
     }
 
-    $self->queue($queue);
+    $self->record($queue);
 
     for my $type (qw/sign encrypt/) {
         my $method = "set_$type";
         my ( $status, $msg ) =
-          $self->queue->$method( $self->argument_value($type) );
+          $self->record->$method( $self->argument_value($type) );
         Jifty->log->error( $msg ) unless $status;
     }
     $self->report_success;
diff --git a/lib/RT/Action/EditRights.pm b/lib/RT/Action/EditRights.pm
index 62c65d3..29f066d 100644
--- a/lib/RT/Action/EditRights.pm
+++ b/lib/RT/Action/EditRights.pm
@@ -6,21 +6,21 @@ package RT::Action::EditRights;
 use base qw/RT::Action Jifty::Action/;
 use Scalar::Defer;
 
-__PACKAGE__->mk_accessors('object');
+__PACKAGE__->mk_accessors('record');
 
 # don't use this directly, use EditUserRights or EditGroupRights instead
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
 
     my $args = {};
-    $args->{object_id} = {
+    $args->{record_id} = {
         render_as     => 'hidden',
-        default_value => $self->object->id,
+        default_value => $self->record->id,
     };
-    $args->{object_type} = {
+    $args->{record_class} = {
         render_as     => 'hidden',
-        default_value => ref $self->object,
+        default_value => ref $self->record,
     };
     return $args;
 }
@@ -32,24 +32,24 @@ sub arguments {
 sub take_action {
     my $self = shift;
 
-    my $object_type = $self->argument_value('object_type');
-    return unless $object_type;
-    if ( $object_type eq 'RT::System' ) {
-        $self->object( RT->system );
+    my $record_class = $self->argument_value('record_class');
+    return unless $record_class;
+    if ( $record_class eq 'RT::System' ) {
+        $self->record( RT->system );
     }
-    elsif ( $RT::Model::ACE::OBJECT_TYPES{$object_type} ) {
-        my $object = $object_type->new;
-        my $object_id = $self->argument_value('object_id');
-        $object->load($object_id);
+    elsif ( $RT::Model::ACE::OBJECT_TYPES{$record_class} ) {
+        my $object = $record_class->new;
+        my $record_id = $self->argument_value('record_id');
+        $object->load($record_id);
         unless ( $object->id ) {
-            Jifty->log->error("couldn't load $object_type #$object_id");
+            Jifty->log->error("couldn't load $record_class #$record_id");
             return;
         }
 
-        $self->object($object);
+        $self->record($object);
     }
     else {
-        Jifty->log->error("object type '$object_type' is incorrect");
+        Jifty->log->error("record class '$record_class' is incorrect");
         return;
     }
 
@@ -80,14 +80,14 @@ sub take_action {
         for my $right ( keys %current_rights ) {
             next if $rights{$right};
             my ( $val, $msg ) =
-              $principal->revoke_right( object => $self->object, right => $right );
+              $principal->revoke_right( object => $self->record, right => $right );
             Jifty->log->error($msg) unless $val;
         }
 
         for my $right ( keys %rights ) {
             next if $current_rights{$right};
             my ( $val, $msg ) =
-              $principal->grant_right( object => $self->object, right => $right );
+              $principal->grant_right( object => $self->record, right => $right );
             Jifty->log->error($msg) unless $val;
         }
     }
@@ -109,7 +109,7 @@ sub report_success {
 
 sub available_values {
     my $self   = shift;
-    my $object = $self->object;
+    my $object = $self->record;
     my $rights = $object->available_rights;
     return [ sort keys %$rights ];
 }
@@ -118,7 +118,7 @@ sub default_value {
     my $self  = shift;
     my $principal_id = shift;
 
-    my $object = $self->object;
+    my $object = $self->record;
     my $acl_obj = RT::Model::ACECollection->new;
     my $ACE = RT::Model::ACE->new;
     $acl_obj->limit_to_object($object);
diff --git a/lib/RT/Action/EditUserMemberships.pm b/lib/RT/Action/EditUserMemberships.pm
index 5cf0a36..024c68d 100644
--- a/lib/RT/Action/EditUserMemberships.pm
+++ b/lib/RT/Action/EditUserMemberships.pm
@@ -6,20 +6,20 @@ package RT::Action::EditUserMemberships;
 use base qw/RT::Action Jifty::Action/;
 use Scalar::Defer;
 
-__PACKAGE__->mk_accessors('object');
+__PACKAGE__->mk_accessors('record');
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
 
     my $args = {};
-    $args->{object_id} = {
+    $args->{record_id} = {
         render_as     => 'hidden',
-        default_value => $self->object->id,
+        default_value => $self->record->id,
     };
-    $args->{object_type} = {
+    $args->{record_class} = {
         render_as     => 'hidden',
-        default_value => ref $self->object,
+        default_value => ref $self->record,
     };
 
     $args->{groups} = {
@@ -37,21 +37,21 @@ sub arguments {
 sub take_action {
     my $self = shift;
 
-    my $object_type = $self->argument_value('object_type');
-    return unless $object_type;
-    if ( $RT::Model::ACE::OBJECT_TYPES{$object_type} ) {
-        my $object    = $object_type->new;
-        my $object_id = $self->argument_value('object_id');
-        $object->load($object_id);
+    my $record_class = $self->argument_value('record_class');
+    return unless $record_class;
+    if ( $RT::Model::ACE::OBJECT_TYPES{$record_class} ) {
+        my $object    = $record_class->new;
+        my $record_id = $self->argument_value('record_id');
+        $object->load($record_id);
         unless ( $object->id ) {
-            Jifty->log->error("couldn't load $object_type #$object_id");
+            Jifty->log->error("couldn't load $record_class #$record_id");
             return;
         }
 
-        $self->object($object);
+        $self->record($object);
     }
     else {
-        Jifty->log->error("object type '$object_type' is incorrect");
+        Jifty->log->error("record class '$record_class' is incorrect");
         return;
     }
 
@@ -81,14 +81,14 @@ sub take_action {
         next if $groups{$group};
 
         my ( $val, $msg ) =
-          $group_objects{$group}->delete_member( $self->object->id );
+          $group_objects{$group}->delete_member( $self->record->id );
         Jifty->log->error($msg) unless $val;
     }
 
     for my $group ( keys %groups ) {
         next if $current_groups{$group};
         my ( $val, $msg ) =
-          $group_objects{$group}->add_member( $self->object->id );
+          $group_objects{$group}->add_member( $self->record->id );
         Jifty->log->error($msg) unless $val;
     }
 
@@ -109,7 +109,7 @@ sub report_success {
 
 sub available_values {
     my $self   = shift;
-    my $object = $self->object;
+    my $object = $self->record;
     my $groups = RT::Model::GroupCollection->new;
     $groups->limit_to_user_defined_groups;
     return [ map { { display => $_->name, value => $_->id } }
@@ -120,7 +120,7 @@ sub default_value {
     my $self      = shift;
     my $is_member = RT::Model::GroupCollection->new;
     $is_member->limit_to_user_defined_groups;
-    $is_member->with_member( principal => $self->object->id );
+    $is_member->with_member( principal => $self->record->id );
     return [ map { $_->id } @{ $is_member->items_array_ref } ];
 }
 
diff --git a/lib/RT/Action/EditUserRights.pm b/lib/RT/Action/EditUserRights.pm
index c22459a..47b235b 100644
--- a/lib/RT/Action/EditUserRights.pm
+++ b/lib/RT/Action/EditUserRights.pm
@@ -9,7 +9,7 @@ use Scalar::Defer;
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
     my $args = $self->SUPER::arguments( @_ );
 
     my $privileged = RT::Model::Group->new;
diff --git a/lib/RT/Action/EditWatchers.pm b/lib/RT/Action/EditWatchers.pm
index 0d78c3a..a65355d 100644
--- a/lib/RT/Action/EditWatchers.pm
+++ b/lib/RT/Action/EditWatchers.pm
@@ -6,19 +6,19 @@ use base qw/RT::Action Jifty::Action/;
 use RT::View::Helpers qw/render_user/;
 use Scalar::Defer;
 
-__PACKAGE__->mk_accessors('object');
+__PACKAGE__->mk_accessors('record');
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
     my $args = {};
-    $args->{object_id} = {
+    $args->{record_id} = {
         render_as     => 'hidden',
-        default_value => $self->object->id,
+        default_value => $self->record->id,
     };
-    $args->{object_type} = {
+    $args->{record_class} = {
         render_as     => 'hidden',
-        default_value => ref $self->object,
+        default_value => ref $self->record,
     };
 
     for my $type (qw/cc admin_cc/) {
@@ -46,24 +46,24 @@ sub arguments {
 sub take_action {
     my $self = shift;
 
-    my $object_type = $self->argument_value('object_type');
-    return unless $object_type;
-    if ( $object_type eq 'RT::System' ) {
-        $self->object( RT->system );
+    my $record_class = $self->argument_value('record_class');
+    return unless $record_class;
+    if ( $record_class eq 'RT::System' ) {
+        $self->record( RT->system );
     }
-    elsif ( $RT::Model::ACE::OBJECT_TYPES{$object_type} ) {
-        my $object = $object_type->new;
-        my $object_id = $self->argument_value('object_id');
-        $object->load($object_id);
+    elsif ( $RT::Model::ACE::OBJECT_TYPES{$record_class} ) {
+        my $object = $record_class->new;
+        my $record_id = $self->argument_value('record_id');
+        $object->load($record_id);
         unless ( $object->id ) {
-            Jifty->log->error("couldn't load $object_type #$object_id");
+            Jifty->log->error("couldn't load $record_class #$record_id");
             return;
         }
 
-        $self->object($object);
+        $self->record($object);
     }
     else {
-        Jifty->log->error("object type '$object_type' is incorrect");
+        Jifty->log->error("record class '$record_class' is incorrect");
         return;
     }
 
@@ -92,7 +92,7 @@ sub take_action {
 
         for my $id ( keys %current ) {
             next if $ids{$id};
-            my ( $val, $msg ) = $self->object->delete_watcher(
+            my ( $val, $msg ) = $self->record->delete_watcher(
                 type      => $type,
                 principal => $id,
             );
@@ -101,7 +101,7 @@ sub take_action {
 
         for my $id ( keys %ids ) {
             next if $current{$id};
-            my ( $val, $msg ) = $self->object->add_watcher(
+            my ( $val, $msg ) = $self->record->add_watcher(
                 type      => $type,
                 principal => $id,
             );
@@ -160,7 +160,7 @@ sub default_value {
     my $self     = shift;
     my $type     = shift;
     my $sub_type = shift;
-    my $group    = $self->object->role_group($type);
+    my $group    = $self->record->role_group($type);
     return [] unless $group->id;
     my $current =
         $sub_type eq 'users'
diff --git a/lib/RT/Action/SelectCustomFields.pm b/lib/RT/Action/SelectCustomFields.pm
index 0cb0582..dee3525 100644
--- a/lib/RT/Action/SelectCustomFields.pm
+++ b/lib/RT/Action/SelectCustomFields.pm
@@ -5,19 +5,19 @@ package RT::Action::SelectCustomFields;
 use base qw/RT::Action Jifty::Action/;
 use Scalar::Defer;
 
-__PACKAGE__->mk_accessors('object', 'lookup_type');
+__PACKAGE__->mk_accessors('record', 'lookup_type');
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
     my $args = {};
-    $args->{object_id} = {
+    $args->{record_id} = {
         render_as     => 'hidden',
-        default_value => $self->object->id,
+        default_value => $self->record->id,
     };
-    $args->{object_type} = {
+    $args->{record_class} = {
         render_as     => 'hidden',
-        default_value => ref $self->object,
+        default_value => ref $self->record,
     };
     $args->{lookup_type} = {
         render_as     => 'hidden',
@@ -25,7 +25,7 @@ sub arguments {
     };
 
     my $global_cfs;
-    if ( $self->object->id ) {
+    if ( $self->record->id ) {
         $global_cfs = RT::Model::ObjectCustomFieldCollection->new;
         $global_cfs->find_all_rows;
         $global_cfs->limit_to_object_id(0);
@@ -34,7 +34,7 @@ sub arguments {
 
     my $object_cfs = RT::Model::ObjectCustomFieldCollection->new;
     $object_cfs->find_all_rows;
-    $object_cfs->limit_to_object_id( $self->object->id );
+    $object_cfs->limit_to_object_id( $self->record->id );
     $object_cfs->limit_to_lookup_type($self->lookup_type);
 
     my $cfs = RT::Model::CustomFieldCollection->new;
@@ -84,26 +84,26 @@ sub arguments {
 sub take_action {
     my $self = shift;
 
-    my $object_type = $self->argument_value('object_type');
-    return unless $object_type;
+    my $record_class = $self->argument_value('record_class');
+    return unless $record_class;
     my $lookup_type = $self->argument_value('lookup_type');
     return unless $lookup_type;
     $self->lookup_type($lookup_type);
 
-    if ( $RT::Model::ACE::OBJECT_TYPES{$object_type} ) {
-        my $object    = $object_type->new;
-        my $object_id = $self->argument_value('object_id');
-        if ($object_id) {
-            $object->load($object_id);
+    if ( $RT::Model::ACE::OBJECT_TYPES{$record_class} ) {
+        my $object    = $record_class->new;
+        my $record_id = $self->argument_value('record_id');
+        if ($record_id) {
+            $object->load($record_id);
             unless ( $object->id ) {
-                Jifty->log->error("couldn't load $object_type #$object_id");
+                Jifty->log->error("couldn't load $record_class #$record_id");
                 return;
             }
         }
-        $self->object($object);
+        $self->record($object);
     }
     else {
-        Jifty->log->error("object type '$object_type' is incorrect");
+        Jifty->log->error("record class '$record_class' is incorrect");
         return;
     }
 
@@ -133,7 +133,7 @@ sub take_action {
         my $cf = RT::Model::CustomField->new;
         my ( $val, $msg ) = $cf->load($id);
         if ($val) {
-            ( $val, $msg ) = $cf->remove_from_object( $self->object );
+            ( $val, $msg ) = $cf->remove_from_object( $self->record );
             Jifty->log->error($msg) unless $val;
         }
         else {
@@ -147,7 +147,7 @@ sub take_action {
         my $cf = RT::Model::CustomField->new;
         my ( $val, $msg ) = $cf->load($id);
         if ($val) {
-            ( $val, $msg ) = $cf->add_to_object( $self->object );
+            ( $val, $msg ) = $cf->add_to_object( $self->record );
             Jifty->log->error($msg) unless $val;
         }
         else {
@@ -168,7 +168,7 @@ sub default_value {
 
     my $object_cfs = RT::Model::ObjectCustomFieldCollection->new;
     $object_cfs->find_all_rows;
-    $object_cfs->limit_to_object_id( $self->object->id );
+    $object_cfs->limit_to_object_id( $self->record->id );
     $object_cfs->limit_to_lookup_type( $self->lookup_type );
 
     my @current;
diff --git a/lib/RT/Action/SelectObjectCustomFields.pm b/lib/RT/Action/SelectObjectCustomFields.pm
index 52a2d3e..f5391cb 100644
--- a/lib/RT/Action/SelectObjectCustomFields.pm
+++ b/lib/RT/Action/SelectObjectCustomFields.pm
@@ -5,18 +5,18 @@ package RT::Action::SelectObjectCustomFields;
 use base qw/RT::Action Jifty::Action/;
 use Scalar::Defer;
 
-__PACKAGE__->mk_accessors('object');
+__PACKAGE__->mk_accessors('record');
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
     my $args = {};
-    $args->{object_id} = {
+    $args->{record_id} = {
         render_as     => 'hidden',
-        default_value => $self->object->id,
+        default_value => $self->record->id,
     };
 
-    my ( $object_name ) = $self->object->lookup_type =~ /RT::Model::(\w+)-/;
+    my ( $object_name ) = $self->record->lookup_type =~ /RT::Model::(\w+)-/;
     $args->{objects} = {
         render_as        => 'Checkboxes',
         default_value    => defer { $self->default_value },
@@ -35,15 +35,15 @@ sub take_action {
     my $self = shift;
 
     my $object    = RT::Model::CustomField->new;
-    my $object_id = $self->argument_value('object_id');
-    if ($object_id) {
-        $object->load($object_id);
+    my $record_id = $self->argument_value('record_id');
+    if ($record_id) {
+        $object->load($record_id);
         unless ( $object->id ) {
-            Jifty->log->error("couldn't load cf #$object_id");
+            Jifty->log->error("couldn't load cf #$record_id");
             return;
         }
     }
-    $self->object($object);
+    $self->record($object);
 
     my @ids;
     my $value = $self->argument_value('objects');
@@ -65,12 +65,12 @@ sub take_action {
         my $id = $object->id;
         if ( $ids{$id} ) {
             next if $current{$id};
-            my ($val, $msg) = $self->object->add_to_object($object);
+            my ($val, $msg) = $self->record->add_to_object($object);
             Jifty->log->error($msg) unless $val;
         }
         else {
             next unless $current{$id};
-            my ($val, $msg) = $self->object->remove_from_object($object);
+            my ($val, $msg) = $self->record->remove_from_object($object);
             Jifty->log->error($msg) unless $val;
         }
     }
@@ -81,7 +81,7 @@ sub take_action {
 
 sub available_objects {
     my $self = shift;
-    if ( $self->object->lookup_type =~ /^(.*?)-/ ) {
+    if ( $self->record->lookup_type =~ /^(.*?)-/ ) {
         my $class = $1;
         my $collection_class;
         if ( UNIVERSAL::can( $class . 'Collection', 'new' ) ) {
@@ -111,7 +111,7 @@ sub available_objects {
         Jifty->log->error(
             _(
                 "object of type %1 cannot take custom fields",
-                $self->object->lookup_type
+                $self->record->lookup_type
             )
         );
         return;
@@ -135,7 +135,7 @@ sub default_value {
     my $object_cfs;
     $object_cfs = RT::Model::ObjectCustomFieldCollection->new;
     $object_cfs->find_all_rows;
-    $object_cfs->limit_to_custom_field($self->object->id);
+    $object_cfs->limit_to_custom_field($self->record->id);
     return [ map { $_->object_id } @{ $object_cfs->items_array_ref } ];
 }
 
diff --git a/lib/RT/Action/SelectPrivateKey.pm b/lib/RT/Action/SelectPrivateKey.pm
index ef9d9c8..40dc6d8 100644
--- a/lib/RT/Action/SelectPrivateKey.pm
+++ b/lib/RT/Action/SelectPrivateKey.pm
@@ -6,20 +6,20 @@ package RT::Action::SelectPrivateKey;
 use base qw/RT::Action Jifty::Action/;
 use Scalar::Defer;
 
-__PACKAGE__->mk_accessors('object');
+__PACKAGE__->mk_accessors('record');
 
 sub arguments {
     my $self = shift;
-    return {} unless $self->object;
+    return {} unless $self->record;
 
     my $args = {};
-    $args->{object_id} = {
+    $args->{record_id} = {
         render_as     => 'hidden',
-        default_value => $self->object->id,
+        default_value => $self->record->id,
     };
-    $args->{object_type} = {
+    $args->{record_class} = {
         render_as     => 'hidden',
-        default_value => ref $self->object,
+        default_value => ref $self->record,
     };
 
     $args->{private_key} = {
@@ -37,27 +37,28 @@ sub arguments {
 sub take_action {
     my $self = shift;
 
-    my $object_type = $self->argument_value('object_type');
-    return unless $object_type;
-    if ( $RT::Model::ACE::OBJECT_TYPES{$object_type} ) {
-        my $object    = $object_type->new;
-        my $object_id = $self->argument_value('object_id');
-        $object->load($object_id);
+    my $record_class = $self->argument_value('record_class');
+    return unless $record_class;
+
+    if ( $RT::Model::ACE::OBJECT_TYPES{$record_class} ) {
+        my $object    = $record_class->new;
+        my $record_id = $self->argument_value('record_id');
+        $object->load($record_id);
         unless ( $object->id ) {
-            Jifty->log->error("couldn't load $object_type #$object_id");
+            Jifty->log->error("couldn't load $record_class #$record_id");
             return;
         }
 
-        $self->object($object);
+        $self->record($object);
     }
     else {
-        Jifty->log->error("object type '$object_type' is incorrect");
+        Jifty->log->error("record class '$record_class' is incorrect");
         return;
     }
 
-    my $email = $self->object->email;
+    my $email = $self->record->email;
     my ( $status, $msg ) =
-      $self->object->set_private_key( $self->argument_value('private_key') );
+      $self->record->set_private_key( $self->argument_value('private_key') );
     if ( $status ) {
         $self->report_success;
     }
@@ -81,7 +82,7 @@ sub report_success {
 
 sub available_values {
     my $self   = shift;
-    my $email = $self->object->email;
+    my $email = $self->record->email;
     my %keys_meta = RT::Crypt::GnuPG::get_keys_for_signing( $email, 'force' );
 
     return [
@@ -93,7 +94,7 @@ sub available_values {
 
 sub default_value {
     my $self      = shift;
-    return $self->object->private_key,
+    return $self->record->private_key,
 }
 
 1;
diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index 1ca8492..699d807 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -482,6 +482,36 @@ before '/admin/users' => run {
 
 };
 
+before 'admin/' => run {
+
+    my ( $id, $lookup_type );
+    my @monikers = qw/
+        global_select_cfs
+      user_edit_memberships user_select_cfs user_config_my_rt user_select_private_key
+
+      group_edit_user_rights group_edit_group_rights group_select_cfs group_edit_members
+
+      queue_edit_user_rights queue_edit_group_rights queue_edit_gnupg queue_select_cfs
+      queue_edit_watchers
+
+      cf_select_ocfs cf_edit_user_rights cf_edit_group_rights
+      /;
+
+    for my $action ( Jifty->web->request->actions ) {
+        if ( grep { $action->moniker eq $_ } @monikers ) {
+            if ( $action->argument('record_id') ) {
+                $id = $action->argument('record_id');
+            }
+            if ( $action->moniker =~ qr/select_cfs/ ) {
+                $lookup_type = $action->argument('lookup_type');
+            }
+        }
+    }
+
+    set id => $id if $id;
+    set lookup_type => $lookup_type if $lookup_type;
+};
+
 before 'admin/groups' => run {
 
     page_nav->child( _('Select') => url => "/admin/groups/" );
diff --git a/lib/RT/View/Admin/CustomFields.pm b/lib/RT/View/Admin/CustomFields.pm
index 8f34a67..67888ca 100644
--- a/lib/RT/View/Admin/CustomFields.pm
+++ b/lib/RT/View/Admin/CustomFields.pm
@@ -63,20 +63,15 @@ content {
     my $self = shift;
     my $cf = RT::Model::CustomField->new;
     $cf->load( get('id') );
-    my $moniker = 'select_object_custom_fields';
+    my $moniker = 'cf_select_ocfs';
     my $action = new_action(
         class   => 'SelectObjectCustomFields',
         moniker => $moniker,
     );
 
-    $action->object($cf);
+    $action->record($cf);
 
     with( name => $moniker ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
         render_action($action);
         form_submit( label => _('Save') );
     };
@@ -101,7 +96,7 @@ private template 'rights' => sub {
     my $type = shift || 'user';
 
     my $class   = 'Edit' . ucfirst($type) . 'Rights';
-    my $moniker = 'modify_' . $type . '_rights';
+    my $moniker = 'cf_edit_' . $type . '_rights';
 
     my $rights = new_action(
         class   => $class,
@@ -110,14 +105,9 @@ private template 'rights' => sub {
 
     my $cf = RT::Model::CustomField->new;
     $cf->load(get('id'));
-    $rights->object( $cf );
+    $rights->record( $cf );
 
     with( name => $moniker ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
         render_action($rights);
         form_submit( label => _('Save') );
     };
diff --git a/lib/RT/View/Admin/Global.pm b/lib/RT/View/Admin/Global.pm
index 6d6212e..257f4fb 100644
--- a/lib/RT/View/Admin/Global.pm
+++ b/lib/RT/View/Admin/Global.pm
@@ -126,9 +126,10 @@ template 'index.html' => page { title => _('Global Configuration') } content {
 template 'system' => page { title => _('Configure RT') } content {
     my $self    = shift;
     my $section = get('section');
+    my $moniker = 'global_config_system';
     my $config  = new_action(
         class   => 'ConfigSystem',
-        moniker => 'config_system',
+        moniker => $moniker,
     );
     $config->order(1);
     my $restart = new_action(
@@ -140,7 +141,7 @@ template 'system' => page { title => _('Configure RT') } content {
     my $meta = $config->meta;
 
     if ($section) {
-        with( name => 'config_system' ), form {
+        with( name => $moniker ), form {
             for my $field ( sort keys %{ $args->{$section} } ) {
                 div {
                     attr { class => 'hints' };
@@ -197,14 +198,14 @@ private template 'rights' => sub {
     my $type = shift || 'user';
 
     my $class   = 'Edit' . ucfirst($type) . 'Rights';
-    my $moniker = 'modify_' . $type . '_rights';
+    my $moniker = 'global_edit_' . $type . '_rights';
 
     my $rights = new_action(
         class   => $class,
         moniker => $moniker,
     );
 
-    $rights->object( RT->system );
+    $rights->record( RT->system );
 
     with( name => $moniker ), form {
         render_action($rights);
@@ -225,9 +226,10 @@ template 'group_rights' => page { title => _('Modify Global Group Rights') }
 template 'select_custom_fields' =>
   page { title => _('Select Global Custom Fields') } content {
     my $self   = shift;
+    my $moniker = 'global_select_cfs';
     my $action = new_action(
         class   => 'SelectCustomFields',
-        moniker => 'select_cfs',
+        moniker => $moniker,
     );
 
     # set it to RT::Model::Queue-RT::Model::Ticket-RT::Model::Transaction
@@ -236,17 +238,12 @@ template 'select_custom_fields' =>
     if ($lookup_type) {
         if ( $lookup_type =~ /(Queue|Group|User)/ ) {
             my $class = 'RT::Model::' . $1;
-            $action->object( $class->new );
+            $action->record( $class->new );
         }
 
         $action->lookup_type($lookup_type);
 
-        with( name => 'select_cfs' ), form {
-            input {
-                type is 'hidden';
-                name is 'lookup_type';
-                value is $lookup_type;
-            };
+        with( name => $moniker ), form {
             render_action($action);
             form_submit( label => _('Save') );
         };
@@ -297,13 +294,13 @@ template 'select_custom_fields' =>
 
 template 'my_rt' => page { title => _('Configure My RT') } content {
     my $self = shift;
-    my $moniker = 'config_my_rt';
+    my $moniker = 'global_config_my_rt';
     my $action = new_action(
         class   => 'ConfigMyRT',
         moniker => $moniker,
     );
 
-    $action->object( RT->system );
+    $action->record( RT->system );
 
     with( name => $moniker ), form {
         render_action($action);
diff --git a/lib/RT/View/Admin/Groups.pm b/lib/RT/View/Admin/Groups.pm
index 60952eb..68d0401 100644
--- a/lib/RT/View/Admin/Groups.pm
+++ b/lib/RT/View/Admin/Groups.pm
@@ -69,20 +69,15 @@ page { title => _('Select Custom Fields for Group') } content {
     my $self  = shift;
     my $group = RT::Model::Group->new;
     $group->load( get('id') );
+    my $moniker = 'group_select_cfs',
     my $action = new_action(
         class   => 'SelectCustomFields',
-        moniker => 'select_cfs',
     );
 
-    $action->object($group);
+    $action->record($group);
     $action->lookup_type( $group->custom_field_lookup_type );
 
-    with( name => 'select_cfs' ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
+    with( name => $moniker ), form {
         render_action($action);
         form_submit( label => _('Save') );
     };
@@ -92,20 +87,15 @@ template 'members' => page { title => _('Group Members') } content {
     my $self  = shift;
     my $group = RT::Model::Group->new;
     $group->load( get('id') );
-    my $moniker = 'modify_group_members';
+    my $moniker = 'group_edit_members';
     my $action = new_action(
         class   => 'EditGroupMembers',
         moniker => $moniker,
     );
 
-    $action->object($group);
+    $action->record($group);
 
     with( name => $moniker ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
         render_action($action);
         form_submit( label => _('Save') );
     };
@@ -167,7 +157,7 @@ private template 'rights' => sub {
     my $type = shift || 'user';
 
     my $class   = 'Edit' . ucfirst($type) . 'Rights';
-    my $moniker = 'modify_' . $type . '_rights';
+    my $moniker = 'group_edit_' . $type . '_rights';
 
     my $rights = new_action(
         class   => $class,
@@ -176,14 +166,9 @@ private template 'rights' => sub {
 
     my $group = RT::Model::Group->new;
     $group->load(get('id'));
-    $rights->object( $group );
+    $rights->record( $group );
 
     with( name => $moniker ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
         render_action($rights);
         form_submit( label => _('Save') );
     };
diff --git a/lib/RT/View/Admin/Queues.pm b/lib/RT/View/Admin/Queues.pm
index 0dccf30..658efd7 100644
--- a/lib/RT/View/Admin/Queues.pm
+++ b/lib/RT/View/Admin/Queues.pm
@@ -100,17 +100,16 @@ private template 'rights' => sub {
 
     my $queue = $self->queue;
     my $class   = 'Edit' . ucfirst($type) . 'Rights';
-    my $moniker = 'modify_' . $type . '_rights';
+    my $moniker = 'queue_edit_' . $type . '_rights';
 
     my $rights = new_action(
         class   => $class,
         moniker => $moniker,
     );
 
-    $rights->object($queue);
+    $rights->record($queue);
 
     with ( name => $moniker ), form {
-        input { type is 'hidden'; name is 'id'; value is $queue->id };
         render_action($rights);
         form_submit( label => _('Save') );
     };
@@ -129,15 +128,15 @@ template 'people' => page { title => _('Modify People') } content {
     my $queue = $self->queue;
     return unless $queue;
 
+    my $moniker = 'queue_edit_watchers';
     my $action = new_action(
         class   => 'EditWatchers',
-        moniker => 'modify_people',
+        moniker => $moniker,
     );
 
-    $action->object($queue);
+    $action->record($queue);
 
-    with ( name => 'modify_people' ), form {
-        input { type is 'hidden'; name is 'id'; value is $queue->id };
+    with ( name => $moniker ), form {
         render_action($action);
         form_submit( label => _('Save') );
     };
@@ -148,22 +147,16 @@ template 'select_custom_fields' => page { title => _('Select CustomFields') } co
     my $queue = $self->queue;
     return unless $queue;
 
+    my $moniker = 'queue_select_cfs';
     my $action = new_action(
         class   => 'SelectCustomFields',
-        moniker => 'select_cfs',
+        moniker => $moniker,
     );
 
-    $action->object($queue);
-    # set it to RT::Model::Queue-RT::Model::Ticket-RT::Model::Transaction
-    # to select transaction cfs
+    $action->record($queue);
+    $action->lookup_type(get('lookup_type'));
 
-    my $lookup_type = get('lookup_type')
-      || 'RT::Model::Queue-RT::Model::Ticket';
-    $action->lookup_type($lookup_type);
-
-    with( name => 'select_cfs' ), form {
-        input { type is 'hidden'; name is 'id'; value is $queue->id };
-        input { type is 'hidden'; name is 'lookup_type'; value is $lookup_type };
+    with( name => $moniker ), form {
         render_action($action);
         form_submit( label => _('Save') );
     };
@@ -204,19 +197,14 @@ template 'gnupg' => page { title => _('Queue GnuPG') } content {
     my $queue = RT::Model::Queue->new;
     $queue->load(get('id'));
 
-    my $moniker = 'modify_queue_gnupg';
+    my $moniker = 'queue_edit_gnupg';
     my $action = new_action(
         class   => 'EditQueueGnuPG',
         moniker => $moniker,
     );
-    $action->queue($queue);
+    $action->record($queue);
 
     with( name => $moniker ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
         render_action($action);
         form_submit( label => _('Save') );
     };
diff --git a/lib/RT/View/Admin/Users.pm b/lib/RT/View/Admin/Users.pm
index 1440312..6a580d2 100644
--- a/lib/RT/View/Admin/Users.pm
+++ b/lib/RT/View/Admin/Users.pm
@@ -82,20 +82,16 @@ template 'select_custom_fields' => page { title => _('Select Custom Fields for U
     my $self = shift;
     my $user = RT::Model::User->new;
     $user->load( get('id') );
+    my $moniker = 'user_select_cfs';
     my $action = new_action(
         class   => 'SelectCustomFields',
-        moniker => 'select_cfs',
+        moniker => $moniker,
     );
 
-    $action->object($user);
+    $action->record($user);
     $action->lookup_type($user->custom_field_lookup_type);
 
-    with( name => 'select_cfs' ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
+    with( name => $moniker ), form {
         render_action($action);
         form_submit( label => _('Save') );
     };
@@ -105,20 +101,15 @@ template 'memberships' => page { title => _('User Memberships') } content {
     my $self = shift;
     my $user = RT::Model::User->new;
     $user->load( get('id') );
-    my $moniker = 'modify_user_memberships';
+    my $moniker = 'user_edit_memberships';
     my $action = new_action(
         class   => 'EditUserMemberships',
         moniker => $moniker,
     );
 
-    $action->object($user);
+    $action->record($user);
 
     with( name => $moniker ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
         render_action($action);
         form_submit( label => _('Save') );
     };
@@ -127,13 +118,21 @@ template 'memberships' => page { title => _('User Memberships') } content {
 template 'gnupg' => page { title => _('User GnuPG') } content {
     my $self = shift;
 
+
     # TODO move the following line to Dispatcher
     return unless RT->config->get('gnupg')->{'enable'};
 
-    require RT::Crypt::GnuPG;
-
     my $user = RT::Model::User->new;
-    $user->load(get('id'));
+    $user->load( get('id') );
+
+    my $moniker = 'user_select_private_key';
+    my $action = new_action(
+        class   => 'SelectPrivateKey',
+        moniker => $moniker,
+    );
+    $action->record( $user );
+
+    require RT::Crypt::GnuPG;
 
     unless ( $user->email ) {
         h2 { _("User has empty email address") };
@@ -142,20 +141,7 @@ template 'gnupg' => page { title => _('User GnuPG') } content {
 
     show( 'key_info', $user->email, 'public' );
 
-    my $moniker = 'select_private_key';
-    my $action = new_action(
-        class   => 'SelectPrivateKey',
-        moniker => $moniker,
-    );
-
-    $action->object($user);
-
     with( name => $moniker ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
         render_action($action);
         form_submit( label => _('Save') );
     };
@@ -169,7 +155,7 @@ template 'history' => page { title => _('User History') } content {
     my $txns = $user->transactions;
     $txns->order_by(
         {
-            column => 'Created',
+            column => 'created',
             order  => 'ASC',
         },
         {
@@ -201,7 +187,7 @@ template 'history' => page { title => _('User History') } content {
 
 template 'my_rt' => page { title => _('MyRT for User') } content {
     my $self = shift;
-    my $moniker = 'config_my_rt';
+    my $moniker = 'user_config_my_rt';
     my $action = new_action(
         class   => 'ConfigMyRT',
         moniker => $moniker,
@@ -209,14 +195,9 @@ template 'my_rt' => page { title => _('MyRT for User') } content {
 
     my $user = RT::Model::User->new;
     $user->load(get('id'));
-    $action->object( $user );
+    $action->record( $user );
 
     with( name => $moniker ), form {
-        input {
-            type is 'hidden';
-            name is 'id';
-            value is get('id');
-        };
         render_action($action);
         form_submit( label => _('Save') );
     };

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


More information about the Rt-commit mailing list