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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Dec 10 23:21:59 EST 2009


The branch, admin_ui has been updated
       via  eeb5ed05d85aaac63c8892df9567d00980cc8b94 (commit)
      from  0000ce039e61188ba39742233412e666ccaa26e2 (commit)

Summary of changes:
 lib/RT/View/Admin/Global.pm |   83 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 79 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit eeb5ed05d85aaac63c8892df9567d00980cc8b94
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Dec 11 12:21:50 2009 +0800

    /admin/global/select_custom_fields page

diff --git a/lib/RT/View/Admin/Global.pm b/lib/RT/View/Admin/Global.pm
index 5594867..dfb38cd 100644
--- a/lib/RT/View/Admin/Global.pm
+++ b/lib/RT/View/Admin/Global.pm
@@ -143,13 +143,88 @@ private template 'rights' => sub {
     };
 };
 
-template 'user_rights' => page { title => _('Modify User Rights') } content {
+template 'user_rights' => page { title => _('Modify Global User Rights') }
+  content {
     show( 'rights', 'user' );
-};
+  };
 
-template 'group_rights' => page { title => _('Modify Group Rights') } content {
+template 'group_rights' => page { title => _('Modify Global Group Rights') }
+  content {
     show( 'rights', 'group' );
-};
+  };
+
+template 'select_custom_fields' =>
+  page { title => _('Select Global Custom Fields') } content {
+    my $self   = shift;
+    my $action = new_action(
+        class   => 'SelectCustomFields',
+        moniker => 'select_cfs',
+    );
+
+    # set it to RT::Model::Queue-RT::Model::Ticket-RT::Model::Transaction
+    # to select transaction cfs
+    my $lookup_type = get('lookup_type');
+    if ($lookup_type) {
+        if ( $lookup_type =~ /(Queue|Group|User)/ ) {
+            my $class = 'RT::Model::' . $1;
+            $action->object( $class->new );
+        }
+
+        $action->lookup_type($lookup_type);
+
+        with( name => 'select_cfs' ), form {
+            input {
+                type is 'hidden';
+                name is 'lookup_type';
+                value is $lookup_type;
+            };
+            render_action($action);
+            form_submit( label => _('Save') );
+        };
+    }
+    else {
+        my $tabs = {
+            'RT::Model::User' => {
+                title => _('Users'),
+                text  => _('Select custom fields for all users'),
+            },
+            'RT::Model::Group' => {
+                title => _('Groups'),
+                text  => _('Select custom fields for all user groups'),
+            },
+            'RT::Model::Queue' => {
+                title => _('Queues'),
+                text  => _('Select custom fields for all queues'),
+            },
+
+            'RT::Model::Queue-RT::Model::Ticket' => {
+                title => _('Tickets'),
+                text  => _('Select custom fields for tickets in all queues'),
+            },
+
+            'RT::Model::Queue-RT::Model::Ticket-RT::Model::Transaction' => {
+                title => _('Ticket Transactions'),
+                text  => _(
+'Select custom fields for transactions on tickets in all queues'
+                ),
+            },
+        };
+        ul {
+            for my $key ( sort keys %$tabs ) {
+                li {
+                    span {
+                        a {
+                            attr {  href => Jifty->web->request->path
+                                  . '?lookup_type='
+                                  . $key } $tabs->{$key}{title};
+                        }
+                    }
+                    $tabs->{$key}{text};
+                }
+            }
+        }
+    }
+  };
 
 1;
 

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


More information about the Rt-commit mailing list