[Rt-commit] rtir branch, 4.2/restore-previous-menu, created. 4.0.1rc1-115-g0bb46779

Blaine Motsinger blaine at bestpractical.com
Thu Mar 26 19:54:55 EDT 2020


The branch, 4.2/restore-previous-menu has been created
        at  0bb467794a8a5fee45a68870d7f43e4a7579ad9a (commit)

- Log -----------------------------------------------------------------
commit 0bb467794a8a5fee45a68870d7f43e4a7579ad9a
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu Mar 26 18:39:00 2020 -0500

    Restore RTIR menu into single parent
    
    This commit restores the menu structure from RTIR 3.2 where the
    RTIR options all live under a single parent.
    
    In addition to causing issues with other extensions that modify the
    menu, the expanded RTIR menus make accessing RT menu items more
    difficult.  The RTIR items each only contain a single entry to
    create a ticket compared to the RT menu items which contain more
    options and sub menus.

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index c8a2f21f..f932345b 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -47,11 +47,6 @@
 %# END BPS TAGGED BLOCK }}}
 <%INIT>
 
-if ( $m->request_comp->path !~ m{^/RTIR/} ) {
-    Menu()->child( rtir => title => loc('RTIR'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
-    return;
-}
-
 my $query_string = sub {
     my %args = @_;
     my $u    = URI->new();
@@ -75,22 +70,9 @@ my $search_arguments = sub {
     return %res;
 };
 
+my $root = Menu->child( rtir => title => loc('RTIR'), path => '/RTIR/' );
 
-my $orig_menu = Menu();
-
-$HTML::Mason::Commands::m->notes('menu', RT::Interface::Web::Menu->new());
-
-my $rtmenu = Menu->child(rtkids => menu => $orig_menu);
-$rtmenu->title(loc('RT'));
-$rtmenu->path('/');
-$rtmenu->key('rt-menu');
-
-Menu->child(preferences => menu => $orig_menu->child('preferences'));
-$orig_menu->delete('preferences');
-
-my $root = Menu();
-
-my $search = $root->child( search => title => loc('RTIR'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
+my $search = $root->child( search => title => loc('Search'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
 $search->child( new => title => loc('New Search'), path => RT::IR->HREFTo('Search/?NewQuery=1', IncludeWebPath => 0) );
 
 {
diff --git a/html/RTIR/Tools/index.html b/html/RTIR/Tools/index.html
index 3b0f4024..d49861a5 100644
--- a/html/RTIR/Tools/index.html
+++ b/html/RTIR/Tools/index.html
@@ -47,5 +47,5 @@
 %# END BPS TAGGED BLOCK }}}
 <& /RTIR/Elements/Header, Title => loc('RTIR Tools') &>
 <& /Elements/Tabs &>
-<& /Elements/ListMenu, menu => Menu()->child('tools')  &>
+<& /Elements/ListMenu, menu => Menu()->child('rtir')->child('tools')  &>
 

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


More information about the rt-commit mailing list