[Rt-commit] r19237 - rt/3.999/trunk/lib/RT/View/Admin

sartak at bestpractical.com sartak at bestpractical.com
Thu Apr 16 19:03:47 EDT 2009


Author: sartak
Date: Thu Apr 16 19:03:47 2009
New Revision: 19237

Modified:
   rt/3.999/trunk/lib/RT/View/Admin/Groups.pm

Log:
Make the name of each group a link to its full modify page

Modified: rt/3.999/trunk/lib/RT/View/Admin/Groups.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/View/Admin/Groups.pm	(original)
+++ rt/3.999/trunk/lib/RT/View/Admin/Groups.pm	Thu Apr 16 19:03:47 2009
@@ -65,5 +65,39 @@
     return $c;
 }
 
+=head2 view_field_name
+
+Display each group's name as a hyperlink to the modify page
+
+=cut
+
+sub view_field_name {
+    my $self = shift;
+    my %args = @_;
+
+    my $id = $args{action}->argument_value('id');
+
+    my $field = $args{action}->form_field($args{field}, render_mode => 'read');
+
+    # I don't see a clean way to do this :(
+    $field->render_wrapper_start();
+    $field->render_preamble();
+
+    $field->render_label();
+
+    # render the value with a hyperlink
+    span {
+        attr { class is "@{[ $field->classes ]} value" };
+        hyperlink(
+            label => "@{[$field->current_value]}",
+            url   => "/Admin/Groups/Modify.html?id=$id",
+        );
+    };
+
+    $field->render_wrapper_end();
+
+    return;
+}
+
 1;
 


More information about the Rt-commit mailing list