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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Jan 4 04:49:05 EST 2010


The branch, admin_ui has been updated
       via  fa5f127a23cb6ffb943bf4dcc84a3fe745a70f8f (commit)
      from  5eafc9e58c85ed064010c1f85b98bbe5fd4fd57b (commit)

Summary of changes:
 lib/RT/View/Admin/Queues.pm |   25 -------------------------
 lib/RT/View/CRUD.pm         |   14 ++++++++++++++
 2 files changed, 14 insertions(+), 25 deletions(-)

- Log -----------------------------------------------------------------
commit fa5f127a23cb6ffb943bf4dcc84a3fe745a70f8f
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jan 4 17:47:51 2010 +0800

    move include_disabled link from Queues CRUD view to CRUD.pm: more models need this

diff --git a/lib/RT/View/Admin/Queues.pm b/lib/RT/View/Admin/Queues.pm
index 3ea6106..a80db41 100644
--- a/lib/RT/View/Admin/Queues.pm
+++ b/lib/RT/View/Admin/Queues.pm
@@ -83,31 +83,6 @@ sub view_field_status_schema {
     return $action->record->status_schema->name;
 }
 
-template 'index.html' => page {
-    title => shift->page_title,
-} content {
-    my $self = shift;
-
-    form {
-        render_region(
-            name     => $self->object_type.'-list',
-            path     => $self->fragment_base_path.'/list',
-        );
-    }
-
-    my $include_disabled = get('include_disabled');
-    hyperlink(
-        label => _(
-            ( $include_disabled ? 'Exclude' : 'Include' )
-            . ' disabled queues in listing.'
-        ),
-        url => '/admin/queues',
-        $include_disabled
-        ? ()
-        : ( parameters => { include_disabled => 1, } ),
-    );
-};
-
 private template 'rights' => sub {
     my $self = shift;
     my $type = shift || 'user';
diff --git a/lib/RT/View/CRUD.pm b/lib/RT/View/CRUD.pm
index c2b5493..00ac05a 100644
--- a/lib/RT/View/CRUD.pm
+++ b/lib/RT/View/CRUD.pm
@@ -66,6 +66,20 @@ template 'index.html' => page {
             name     => $self->object_type.'-list',
             path     => $self->fragment_base_path.'/list',
         );
+    };
+
+    if ( grep { $_ eq 'disabled' } $self->display_columns ) {
+        my $include_disabled = get('include_disabled');
+        hyperlink(
+            label => _(
+                  ( $include_disabled ? 'Exclude' : 'Include' )
+                . ' disabled '
+                  . lc( $self->object_type )
+                  . 'in listing.'
+            ),
+            url => '',
+            parameters => { include_disabled => $include_disabled ? 0 : 1 },
+        );
     }
 };
 

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


More information about the Rt-commit mailing list