[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.6-243-g7c3ff78

? sunnavy sunnavy at bestpractical.com
Wed Dec 1 12:01:37 EST 2010


The branch, 3.9-trunk has been updated
       via  7c3ff7871553b4a76292cd5bb38c2b556cd37fb8 (commit)
      from  34a114ace93da91745ee715223e295113bcb4246 (commit)

Summary of changes:
 share/html/Elements/Tabs |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 7c3ff7871553b4a76292cd5bb38c2b556cd37fb8
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Dec 2 00:31:08 2010 +0800

    show create and/or select links in pagemenu

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 47cf083..56fc35f 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -226,6 +226,19 @@ if ( $request_path !~ qr{^/SelfService/} ) {
         }
     }
 
+    if ( $request_path =~ qr{^/Admin/(Queues|Users|Groups|CustomFields)} ) {
+        my $type = $1;
+        my $tabs = PageMenu();
+
+        if ( $request_path !~ qr{^/Admin/$type/?(?:index.html)?$} ) {
+            $tabs->child( select => title => loc('Select'), path => "/Admin/$type/" );
+        }
+
+        if ( $request_path ne "/Admin/$type/Modify.html" || !$m->request_args->{Create} ) {
+            $tabs->child( create => title => loc('Create'), path => "/Admin/$type/Modify.html?Create=1" );
+        }
+    }
+
     if ( $request_path =~ qr{^/Admin/Queues} ) {
         if ( my $id = $m->request_args->{'id'} || $m->request_args->{'Queue'} ) {
             my $queue_obj = RT::Queue->new( $session{'CurrentUser'} );
@@ -305,6 +318,23 @@ if ( $request_path !~ qr{^/SelfService/} ) {
 
     }
 
+    if ( $request_path =~ qr{^/Admin/Global/(Scrip|Template)(s)?\.html} ) {
+        my $type = $1;
+        my $plural = $2;
+        my $tabs = PageMenu();
+        if ( $plural ) {
+            if ( $request_path eq "/Admin/Global/$type$plural.html" ) {
+                $tabs->child( create => title => loc('Create'), path => "/Admin/Global/$type.html?Create=1" );
+            }
+        }
+        else {
+            $tabs->child( select => title => loc('Select'), path => "/Admin/Global/${type}s.html" );
+            if ( ! $m->request_args->{Create} ) {
+                $tabs->child( create => title => loc('Create'), path => "/Admin/Global/$type.html?Create=1" );
+            }
+        }
+    }
+
     if ( $request_path =~ qr{^/Ticket/} ) {
         if ( ( $m->request_args->{'id'} || '' ) =~ /^(\d+)$/ ) {
             my $id  = $1;

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


More information about the Rt-commit mailing list