[Rt-commit] rt branch, admin_ui, updated. 17a5d5747aab986e95e2ede08f1555260f553f96

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Dec 22 03:36:15 EST 2009


The branch, admin_ui has been updated
       via  17a5d5747aab986e95e2ede08f1555260f553f96 (commit)
      from  75ba12a26b33bf05cea16f351d2b1f06d5b67f23 (commit)

Summary of changes:
 lib/RT/View/Admin/Groups.pm |   24 ++++++++++++++++++++++--
 lib/RT/View/Admin/Users.pm  |   22 ++++++++++++++++++++--
 2 files changed, 42 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 17a5d5747aab986e95e2ede08f1555260f553f96
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Dec 22 16:36:06 2009 +0800

    /admin/users/select_custom_fields and /admin/groups/select_custom_fields views

diff --git a/lib/RT/View/Admin/Groups.pm b/lib/RT/View/Admin/Groups.pm
index 664d282..b982bbf 100644
--- a/lib/RT/View/Admin/Groups.pm
+++ b/lib/RT/View/Admin/Groups.pm
@@ -81,9 +81,29 @@ private template view_item_controls  => sub {
     }
 };
 
-template 'custom_fields' => page { title => _('Group Custom Fields') } content {
-    my $self = shift;
 
+template 'select_custom_fields' =>
+page { title => _('Select Custom Fields for Group') } content {
+    my $self  = shift;
+    my $group = RT::Model::Group->new;
+    $group->load( get('id') );
+    my $action = new_action(
+        class   => 'SelectCustomFields',
+        moniker => 'select_cfs',
+    );
+
+    $action->object($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');
+        };
+        render_action($action);
+        form_submit( label => _('Save') );
+    };
 };
 
 template 'members' => page { title => _('Group Members') } content {
diff --git a/lib/RT/View/Admin/Users.pm b/lib/RT/View/Admin/Users.pm
index 38db15b..15e0518 100644
--- a/lib/RT/View/Admin/Users.pm
+++ b/lib/RT/View/Admin/Users.pm
@@ -95,9 +95,27 @@ sub _current_collection {
 # XXX TODO 
 # the following pages don't valid $id, we should/can check that in Dispatcher
 
-template 'custom_fields' => page { title => _('User Custom Fields') } content {
+template 'select_custom_fields' => page { title => _('Select Custom Fields for User') } content {
     my $self = shift;
+    my $user = RT::Model::User->new;
+    $user->load( get('id') );
+    my $action = new_action(
+        class   => 'SelectCustomFields',
+        moniker => 'select_cfs',
+    );
 
+    $action->object($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');
+        };
+        render_action($action);
+        form_submit( label => _('Save') );
+    };
 };
 
 template 'memberships' => page { title => _('User Memberships') } content {

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


More information about the Rt-commit mailing list