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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Dec 24 02:32:08 EST 2009


The branch, admin_ui has been updated
       via  b74b4088d85e7acd52263f1984a60c0a8eebd4a5 (commit)
      from  a3fdaefd0d593dfe473e6ddd3647bdce4725b62d (commit)

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

- Log -----------------------------------------------------------------
commit b74b4088d85e7acd52263f1984a60c0a8eebd4a5
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Dec 24 15:31:59 2009 +0800

    /admin/custom_fields/(user|group)_rights view

diff --git a/lib/RT/View/Admin/CustomFields.pm b/lib/RT/View/Admin/CustomFields.pm
index 1f41549..de01ddb 100644
--- a/lib/RT/View/Admin/CustomFields.pm
+++ b/lib/RT/View/Admin/CustomFields.pm
@@ -75,5 +75,45 @@ private template view_item_controls  => sub {
     }
 };
 
+template 'group_rights' => page { title => _('Group Rights for Custom Field') }
+content {
+    my $self = shift;
+    show( 'rights', 'group' );
+
+};
+
+template 'user_rights' => page { title => _('User Rights for Custom Field') } content {
+    my $self = shift;
+    show( 'rights', 'user' );
+
+};
+
+private template 'rights' => sub {
+    my $self = shift;
+    my $type = shift || 'user';
+
+    my $class   = 'Edit' . ucfirst($type) . 'Rights';
+    my $moniker = 'modify_' . $type . '_rights';
+
+    my $rights = new_action(
+        class   => $class,
+        moniker => $moniker,
+    );
+
+    my $cf = RT::Model::CustomField->new;
+    $cf->load(get('id'));
+    $rights->object( $cf );
+
+    with( name => $moniker ), form {
+        input {
+            type is 'hidden';
+            name is 'id';
+            value is get('id');
+        };
+        render_action($rights);
+        form_submit( label => _('Save') );
+    };
+};
+
 1;
 

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


More information about the Rt-commit mailing list