[Rt-commit] rt branch, 4.4/show-assets-action-menu, repushed
Dustin Graves
dustin at bestpractical.com
Thu Jun 23 15:41:39 EDT 2016
The branch 4.4/show-assets-action-menu was deleted and repushed:
was f88d7704e894c6f7477cd43115ffc855336927b8
now 792a9521d6dce086df16b45267f6309e47ebadec
1: 15980c8 ! 1: 755042f refactor RT menu building logic into own library module
@@ -66,6 +66,8 @@
+
+package RT::Interface::Web::MenuBuilder;
+
++sub loc { HTML::Mason::Commands::loc( @_ ); }
++
+sub QueryString {
+ my %args = @_;
+ my $u = URI->new();
@@ -85,7 +87,7 @@
+ HTML::Mason::Commands::PageWidgets()->child( create_ticket => raw_html => $HTML::Mason::Commands::m->scomp('CreateTicket') );
+ }
+
-+ my $home = HTML::Mason::Commands::Menu()->child( home => title => HTML::Mason::Commands::loc('Homepage'), path => '/' );
++ my $home = HTML::Mason::Commands::Menu()->child( home => title => loc('Homepage'), path => '/' );
+ unless ($HTML::Mason::Commands::session{'dashboards_in_menu'}) {
+ my $dashboards_in_menu = $HTML::Mason::Commands::session{CurrentUser}->UserObj->Preferences(
+ 'DashboardsInMenu',
@@ -125,75 +127,75 @@
+ );
+ }
+ }
-+ $dashes->child( edit => title => HTML::Mason::Commands::loc('Update This Menu'), path => 'Prefs/DashboardsInMenu.html' );
-+ $dashes->child( more => title => HTML::Mason::Commands::loc('All Dashboards'), path => 'Dashboards/index.html' );
++ $dashes->child( edit => title => loc('Update This Menu'), path => 'Prefs/DashboardsInMenu.html' );
++ $dashes->child( more => title => loc('All Dashboards'), path => 'Dashboards/index.html' );
+ my $dashboard = RT::Dashboard->new( $HTML::Mason::Commands::session{CurrentUser} );
+ if ( $dashboard->CurrentUserCanCreateAny ) {
-+ $dashes->child('dashboard_create' => title => HTML::Mason::Commands::loc('New Dashboard'), path => "/Dashboards/Modify.html?Create=1" );
-+ }
-+
-+ my $search = HTML::Mason::Commands::Menu()->child( search => title => HTML::Mason::Commands::loc('Search'), path => '/Search/Simple.html' );
-+
-+ my $tickets = $search->child( tickets => title => HTML::Mason::Commands::loc('Tickets'), path => '/Search/Build.html' );
-+ $tickets->child( simple => title => HTML::Mason::Commands::loc('Simple Search'), path => "/Search/Simple.html" );
-+ $tickets->child( new => title => HTML::Mason::Commands::loc('New Search'), path => "/Search/Build.html?NewQuery=1" );
-+
-+ $search->child( articles => title => HTML::Mason::Commands::loc('Articles'), path => "/Articles/Article/Search.html" )
++ $dashes->child('dashboard_create' => title => loc('New Dashboard'), path => "/Dashboards/Modify.html?Create=1" );
++ }
++
++ my $search = HTML::Mason::Commands::Menu()->child( search => title => loc('Search'), path => '/Search/Simple.html' );
++
++ my $tickets = $search->child( tickets => title => loc('Tickets'), path => '/Search/Build.html' );
++ $tickets->child( simple => title => loc('Simple Search'), path => "/Search/Simple.html" );
++ $tickets->child( new => title => loc('New Search'), path => "/Search/Build.html?NewQuery=1" );
++
++ $search->child( articles => title => loc('Articles'), path => "/Articles/Article/Search.html" )
+ if $HTML::Mason::Commands::session{CurrentUser}->HasRight( Right => 'ShowArticlesMenu', Object => RT->System );
+
-+ $search->child( users => title => HTML::Mason::Commands::loc('Users'), path => "/User/Search.html" );
-+
-+ $search->child( assets => title => HTML::Mason::Commands::loc("Assets"), path => "/Asset/Search/" )
++ $search->child( users => title => loc('Users'), path => "/User/Search.html" );
++
++ $search->child( assets => title => loc("Assets"), path => "/Asset/Search/" )
+ if $HTML::Mason::Commands::session{CurrentUser}->HasRight( Right => 'ShowAssetsMenu', Object => RT->System );
+
+ if ($HTML::Mason::Commands::session{CurrentUser}->HasRight( Right => 'ShowArticlesMenu', Object => RT->System )) {
-+ my $articles = HTML::Mason::Commands::Menu()->child( articles => title => HTML::Mason::Commands::loc('Articles'), path => "/Articles/index.html");
-+ $articles->child( articles => title => HTML::Mason::Commands::loc('Overview'), path => "/Articles/index.html" );
-+ $articles->child( topics => title => HTML::Mason::Commands::loc('Topics'), path => "/Articles/Topics.html" );
-+ $articles->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Articles/Article/PreCreate.html" );
-+ $articles->child( search => title => HTML::Mason::Commands::loc('Search'), path => "/Articles/Article/Search.html" );
++ my $articles = HTML::Mason::Commands::Menu()->child( articles => title => loc('Articles'), path => "/Articles/index.html");
++ $articles->child( articles => title => loc('Overview'), path => "/Articles/index.html" );
++ $articles->child( topics => title => loc('Topics'), path => "/Articles/Topics.html" );
++ $articles->child( create => title => loc('Create'), path => "/Articles/Article/PreCreate.html" );
++ $articles->child( search => title => loc('Search'), path => "/Articles/Article/Search.html" );
+ }
+
+ if ($HTML::Mason::Commands::session{CurrentUser}->HasRight( Right => 'ShowAssetsMenu', Object => RT->System )) {
-+ my $assets = HTML::Mason::Commands::Menu()->child( "assets", title => HTML::Mason::Commands::loc("Assets"), path => "/Asset/Search/" );
-+ $assets->child( "create", title => HTML::Mason::Commands::loc("Create"), path => "/Asset/CreateInCatalog.html" );
-+ $assets->child( "search", title => HTML::Mason::Commands::loc("Search"), path => "/Asset/Search/" );
-+ }
-+
-+ my $tools = HTML::Mason::Commands::Menu()->child( tools => title => HTML::Mason::Commands::loc('Tools'), path => '/Tools/index.html' );
++ my $assets = HTML::Mason::Commands::Menu()->child( "assets", title => loc("Assets"), path => "/Asset/Search/" );
++ $assets->child( "create", title => loc("Create"), path => "/Asset/CreateInCatalog.html" );
++ $assets->child( "search", title => loc("Search"), path => "/Asset/Search/" );
++ }
++
++ my $tools = HTML::Mason::Commands::Menu()->child( tools => title => loc('Tools'), path => '/Tools/index.html' );
+
+ $tools->child( my_day =>
-+ title => HTML::Mason::Commands::loc('My Day'),
-+ description => HTML::Mason::Commands::loc('Easy updating of your open tickets'),
++ title => loc('My Day'),
++ description => loc('Easy updating of your open tickets'),
+ path => '/Tools/MyDay.html',
+ );
+
+ if ( RT->Config->Get('EnableReminders') ) {
+ $tools->child( my_reminders =>
-+ title => HTML::Mason::Commands::loc('My Reminders'),
-+ description => HTML::Mason::Commands::loc('Easy viewing of your reminders'),
++ title => loc('My Reminders'),
++ description => loc('Easy viewing of your reminders'),
+ path => '/Tools/MyReminders.html',
+ );
+ }
+
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Right => 'ShowApprovalsTab', Object => RT->System ) ) {
+ $tools->child( approval =>
-+ title => HTML::Mason::Commands::loc('Approval'),
-+ description => HTML::Mason::Commands::loc('My Approvals'),
++ title => loc('Approval'),
++ description => loc('My Approvals'),
+ path => '/Approvals/',
+ );
+ }
+
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Right => 'ShowConfigTab', Object => RT->System ) )
+ {
-+ BuildAdminMenu($request_path, HTML::Mason::Commands::Menu());
++ _BuildAdminMenu($request_path, HTML::Mason::Commands::Menu());
+ }
+
+ my $username = '<span class="current-user">'
+ . $HTML::Mason::Commands::m->interp->apply_escapes($HTML::Mason::Commands::session{'CurrentUser'}->Name, 'h')
+ . '</span>';
+ my $about_me = HTML::Mason::Commands::Menu()->child( 'preferences' =>
-+ title => HTML::Mason::Commands::loc('Logged in as [_1]', $username),
++ title => loc('Logged in as [_1]', $username),
+ escape_title => 0,
+ path => '/User/Summary.html?id=' . $HTML::Mason::Commands::session{CurrentUser}->id,
+ sort_order => 99,
@@ -202,18 +204,18 @@
+
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->UserObj
+ && $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => RT->System )) {
-+ my $settings = $about_me->child( settings => title => HTML::Mason::Commands::loc('Settings'), path => '/Prefs/Other.html' );
-+ $settings->child( options => title => HTML::Mason::Commands::loc('Preferences'), path => '/Prefs/Other.html' );
-+ $settings->child( about_me => title => HTML::Mason::Commands::loc('About me'), path => '/Prefs/AboutMe.html' );
-+ $settings->child( search_options => title => HTML::Mason::Commands::loc('Search options'), path => '/Prefs/SearchOptions.html' );
-+ $settings->child( myrt => title => HTML::Mason::Commands::loc('RT at a glance'), path => '/Prefs/MyRT.html' );
++ my $settings = $about_me->child( settings => title => loc('Settings'), path => '/Prefs/Other.html' );
++ $settings->child( options => title => loc('Preferences'), path => '/Prefs/Other.html' );
++ $settings->child( about_me => title => loc('About me'), path => '/Prefs/AboutMe.html' );
++ $settings->child( search_options => title => loc('Search options'), path => '/Prefs/SearchOptions.html' );
++ $settings->child( myrt => title => loc('RT at a glance'), path => '/Prefs/MyRT.html' );
+ $settings->child( dashboards_in_menu =>
-+ title => HTML::Mason::Commands::loc('Dashboards in menu'),
++ title => loc('Dashboards in menu'),
+ path => '/Prefs/DashboardsInMenu.html',
+ );
-+ $settings->child( queue_list => title => HTML::Mason::Commands::loc('Queue list'), path => '/Prefs/QueueList.html' );
-+
-+ my $search_menu = $settings->child( 'saved-searches' => title => HTML::Mason::Commands::loc('Saved Searches') );
++ $settings->child( queue_list => title => loc('Queue list'), path => '/Prefs/QueueList.html' );
++
++ my $search_menu = $settings->child( 'saved-searches' => title => loc('Saved Searches') );
+ my $searches = [ $HTML::Mason::Commands::m->comp( "/Search/Elements/SearchesForObject",
+ Object => RT::System->new( $HTML::Mason::Commands::session{'CurrentUser'} )) ];
+ my $i = 0;
@@ -230,7 +232,7 @@
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->Name
+ && ( !RT->Config->Get('WebRemoteUserAuth')
+ || RT->Config->Get('WebFallbackToRTLogin') )) {
-+ $about_me->child( logout => title => HTML::Mason::Commands::loc('Logout'), path => '/NoAuth/Logout.html' );
++ $about_me->child( logout => title => loc('Logout'), path => '/NoAuth/Logout.html' );
+ }
+ if ( $request_path =~ m{^/Dashboards/(\d+)?}) {
+ if ( my $id = ( $1 || $HTML::Mason::Commands::DECODED_ARGS->{'id'} ) ) {
@@ -238,11 +240,11 @@
+ $obj->LoadById($id);
+ if ( $obj and $obj->id ) {
+ my $tabs = HTML::Mason::Commands::PageMenu();
-+ $tabs->child( basics => title => HTML::Mason::Commands::loc('Basics'), path => "/Dashboards/Modify.html?id=" . $obj->id);
-+ $tabs->child( content => title => HTML::Mason::Commands::loc('Content'), path => "/Dashboards/Queries.html?id=" . $obj->id);
-+ $tabs->child( subscription => title => HTML::Mason::Commands::loc('Subscription'), path => "/Dashboards/Subscription.html?id=" . $obj->id)
++ $tabs->child( basics => title => loc('Basics'), path => "/Dashboards/Modify.html?id=" . $obj->id);
++ $tabs->child( content => title => loc('Content'), path => "/Dashboards/Queries.html?id=" . $obj->id);
++ $tabs->child( subscription => title => loc('Subscription'), path => "/Dashboards/Subscription.html?id=" . $obj->id)
+ if $obj->CurrentUserCanSubscribe;
-+ $tabs->child( show => title => HTML::Mason::Commands::loc('Show'), path => "/Dashboards/" . $obj->id . "/" . $obj->Name)
++ $tabs->child( show => title => loc('Show'), path => "/Dashboards/" . $obj->id . "/" . $obj->Name)
+ }
+ }
+ }
@@ -255,7 +257,7 @@
+ $obj->Load($id);
+
+ if ( $obj and $obj->id ) {
-+ my $actions = HTML::Mason::Commands::PageMenu()->child( actions => title => HTML::Mason::Commands::loc('Actions'), sort_order => 95 );
++ my $actions = HTML::Mason::Commands::PageMenu()->child( actions => title => loc('Actions'), sort_order => 95 );
+
+ my %can = %{ $obj->CurrentUser->PrincipalObj->HasRights( Object => $obj ) };
+ $can{'_ModifyOwner'} = $obj->CurrentUserCanSetOwner();
@@ -275,42 +277,42 @@
+ $tabs->child( timer => raw_html => $HTML::Mason::Commands::m->scomp( '/Ticket/Elements/PopupTimerLink', id => $id ), sort_order => 99 );
+ }
+
-+ $tabs->child( display => title => HTML::Mason::Commands::loc('Display'), path => "/Ticket/Display.html?id=" . $id );
-+ $tabs->child( history => title => HTML::Mason::Commands::loc('History'), path => "/Ticket/History.html?id=" . $id );
++ $tabs->child( display => title => loc('Display'), path => "/Ticket/Display.html?id=" . $id );
++ $tabs->child( history => title => loc('History'), path => "/Ticket/History.html?id=" . $id );
+
+ # comment out until we can do it for an individual custom field
+ #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') ) {
-+ $tabs->child( basics => title => HTML::Mason::Commands::loc('Basics'), path => "/Ticket/Modify.html?id=" . $id );
++ $tabs->child( basics => title => loc('Basics'), path => "/Ticket/Modify.html?id=" . $id );
+
+ #}
+
+ if ( $can->('ModifyTicket') || $can->('_ModifyOwner') || $can->('Watch') || $can->('WatchAsAdminCc') ) {
-+ $tabs->child( people => title => HTML::Mason::Commands::loc('People'), path => "/Ticket/ModifyPeople.html?id=" . $id );
++ $tabs->child( people => title => loc('People'), path => "/Ticket/ModifyPeople.html?id=" . $id );
+ }
+
+ if ( $can->('ModifyTicket') ) {
-+ $tabs->child( dates => title => HTML::Mason::Commands::loc('Dates'), path => "/Ticket/ModifyDates.html?id=" . $id );
-+ $tabs->child( links => title => HTML::Mason::Commands::loc('Links'), path => "/Ticket/ModifyLinks.html?id=" . $id );
++ $tabs->child( dates => title => loc('Dates'), path => "/Ticket/ModifyDates.html?id=" . $id );
++ $tabs->child( links => title => loc('Links'), path => "/Ticket/ModifyLinks.html?id=" . $id );
+ }
+
+ #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') || $can->('_ModifyOwner') ) {
-+ $tabs->child( jumbo => title => HTML::Mason::Commands::loc('Jumbo'), path => "/Ticket/ModifyAll.html?id=" . $id );
++ $tabs->child( jumbo => title => loc('Jumbo'), path => "/Ticket/ModifyAll.html?id=" . $id );
+ #}
+
+ if ( RT->Config->Get('EnableReminders') ) {
-+ $tabs->child( reminders => title => HTML::Mason::Commands::loc('Reminders'), path => "/Ticket/Reminders.html?id=" . $id );
++ $tabs->child( reminders => title => loc('Reminders'), path => "/Ticket/Reminders.html?id=" . $id );
+ }
+
+ if ( $can->('ModifyTicket') or $can->('ReplyToTicket') ) {
-+ $actions->child( reply => title => HTML::Mason::Commands::loc('Reply'), path => "/Ticket/Update.html?Action=Respond;id=" . $id );
++ $actions->child( reply => title => loc('Reply'), path => "/Ticket/Update.html?Action=Respond;id=" . $id );
+ }
+
+ if ( $can->('ModifyTicket') or $can->('CommentOnTicket') ) {
-+ $actions->child( comment => title => HTML::Mason::Commands::loc('Comment'), path => "/Ticket/Update.html?Action=Comment;id=" . $id );
++ $actions->child( comment => title => loc('Comment'), path => "/Ticket/Update.html?Action=Comment;id=" . $id );
+ }
+
+ if ( $can->('ForwardMessage') ) {
-+ $actions->child( forward => title => HTML::Mason::Commands::loc('Forward'), path => "/Ticket/Forward.html?id=" . $id );
++ $actions->child( forward => title => loc('Forward'), path => "/Ticket/Forward.html?id=" . $id );
+ }
+
+ my $hide_resolve_with_deps = RT->Config->Get('HideResolveActionsWithDependencies')
@@ -340,21 +342,21 @@
+ id => $id,
+ );
+ my $key = $info->{'label'} || ucfirst($next);
-+ $actions->child( $key => title => HTML::Mason::Commands::loc( $key ), path => $url);
++ $actions->child( $key => title => loc( $key ), path => $url);
+ }
+
+ my ($can_take, $tmsg) = $obj->CurrentUserCanSetOwner( Type => 'Take' );
+ my ($can_steal, $smsg) = $obj->CurrentUserCanSetOwner( Type => 'Steal' );
+ if ( $can_take ){
-+ $actions->child( take => title => HTML::Mason::Commands::loc('Take'), path => "/Ticket/Display.html?Action=Take;id=" . $id );
++ $actions->child( take => title => loc('Take'), path => "/Ticket/Display.html?Action=Take;id=" . $id );
+ }
+ elsif ( $can_steal ){
-+ $actions->child( steal => title => HTML::Mason::Commands::loc('Steal'), path => "/Ticket/Display.html?Action=Steal;id=" . $id );
++ $actions->child( steal => title => loc('Steal'), path => "/Ticket/Display.html?Action=Steal;id=" . $id );
+ }
+
+ # TODO needs a "Can extract article into a class applied to this queue" check
+ $actions->child( 'extract-article' =>
-+ title => HTML::Mason::Commands::loc('Extract Article'),
++ title => loc('Extract Article'),
+ path => "/Articles/Article/ExtractIntoClass.html?Ticket=".$obj->id,
+ ) if $HTML::Mason::Commands::session{CurrentUser}->HasRight( Right => 'ShowArticlesMenu', Object => RT->System );
+
@@ -372,17 +374,17 @@
+ # Don't display prev links if we're on the first ticket
+ if ( $item_map->{$id}->{prev} ) {
+ $search->child( first =>
-+ title => '<< ' . HTML::Mason::Commands::loc('First'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{first});
++ title => '<< ' . loc('First'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{first});
+ $search->child( prev =>
-+ title => '< ' . HTML::Mason::Commands::loc('Prev'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{prev});
++ title => '< ' . loc('Prev'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{prev});
+ }
+ # Don't display next links if we're on the last ticket
+ if ( $item_map->{$id}->{next} ) {
+ $search->child( next =>
-+ title => HTML::Mason::Commands::loc('Next') . ' >', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{next});
++ title => loc('Next') . ' >', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{next});
+ if ( $item_map->{last} ) {
+ $search->child( last =>
-+ title => HTML::Mason::Commands::loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
++ title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
+ }
+ }
+ }
@@ -454,27 +456,27 @@
+
+ my $current_search_menu;
+ if ( $request_path =~ m{^/Ticket} ) {
-+ $current_search_menu = $search->child( current_search => title => HTML::Mason::Commands::loc('Current Search') );
++ $current_search_menu = $search->child( current_search => title => loc('Current Search') );
+ $current_search_menu->path("/Search/Results.html$args") if $has_query;
+ } else {
+ $current_search_menu = HTML::Mason::Commands::PageMenu();
+ }
+
+ $current_search_menu->child( edit_search =>
-+ title => HTML::Mason::Commands::loc('Edit Search'), path => "/Search/Build.html" . ( ($has_query) ? $args : '' ) );
++ title => loc('Edit Search'), path => "/Search/Build.html" . ( ($has_query) ? $args : '' ) );
+ $current_search_menu->child( advanced =>
-+ title => HTML::Mason::Commands::loc('Advanced'), path => "/Search/Edit.html$args" );
++ title => loc('Advanced'), path => "/Search/Edit.html$args" );
+ if ($has_query) {
-+ $current_search_menu->child( results => title => HTML::Mason::Commands::loc('Show Results'), path => "/Search/Results.html$args" );
++ $current_search_menu->child( results => title => loc('Show Results'), path => "/Search/Results.html$args" );
+ }
+
+ if ( $has_query ) {
-+ $current_search_menu->child( bulk => title => HTML::Mason::Commands::loc('Bulk Update'), path => "/Search/Bulk.html$args" );
-+ $current_search_menu->child( chart => title => HTML::Mason::Commands::loc('Chart'), path => "/Search/Chart.html$args" );
-+
-+ my $more = $current_search_menu->child( more => title => HTML::Mason::Commands::loc('Feeds') );
-+
-+ $more->child( spreadsheet => title => HTML::Mason::Commands::loc('Spreadsheet'), path => "/Search/Results.tsv$args" );
++ $current_search_menu->child( bulk => title => loc('Bulk Update'), path => "/Search/Bulk.html$args" );
++ $current_search_menu->child( chart => title => loc('Chart'), path => "/Search/Chart.html$args" );
++
++ my $more = $current_search_menu->child( more => title => loc('Feeds') );
++
++ $more->child( spreadsheet => title => loc('Spreadsheet'), path => "/Search/Results.tsv$args" );
+
+ my %rss_data = map {
+ $_ => $query_args->{$_} || $fallback_query_args{$_} || '' }
@@ -491,12 +493,12 @@
+ . $rss_data{Order}
+ . $rss_data{OrderBy} );
+
-+ $more->child( rss => title => HTML::Mason::Commands::loc('RSS'), path => "/NoAuth/rss/$RSSPath/$RSSQueryString");
++ $more->child( rss => title => loc('RSS'), path => "/NoAuth/rss/$RSSPath/$RSSQueryString");
+ my $ical_path = join '/', map $HTML::Mason::Commands::m->interp->apply_escapes($_, 'u'),
+ $HTML::Mason::Commands::session{'CurrentUser'}->UserObj->Name,
+ $HTML::Mason::Commands::session{'CurrentUser'}->UserObj->GenerateAuthString( $rss_data{Query} ),
+ $rss_data{Query};
-+ $more->child( ical => title => HTML::Mason::Commands::loc('iCal'), path => '/NoAuth/iCal/'.$ical_path);
++ $more->child( ical => title => loc('iCal'), path => '/NoAuth/iCal/'.$ical_path);
+
+ if ($request_path =~ m{^/Search/Results.html}
+ && #XXX TODO better abstraction
@@ -508,7 +510,7 @@
+ 'Tickets:limit' => $query_args->{'Rows'},
+ );
+
-+ $more->child( shredder => title => HTML::Mason::Commands::loc('Shredder'), path => '/Admin/Tools/Shredder/?' . $shred_args);
++ $more->child( shredder => title => loc('Shredder'), path => '/Admin/Tools/Shredder/?' . $shred_args);
+ }
+
+ }
@@ -519,9 +521,9 @@
+ my $id = $HTML::Mason::Commands::DECODED_ARGS->{'id'};
+ my $tabs = HTML::Mason::Commands::PageMenu();
+
-+ $tabs->child( display => title => HTML::Mason::Commands::loc('Display'), path => "/Articles/Article/Display.html?id=".$id );
-+ $tabs->child( history => title => HTML::Mason::Commands::loc('History'), path => "/Articles/Article/History.html?id=".$id );
-+ $tabs->child( modify => title => HTML::Mason::Commands::loc('Modify'), path => "/Articles/Article/Edit.html?id=".$id );
++ $tabs->child( display => title => loc('Display'), path => "/Articles/Article/Display.html?id=".$id );
++ $tabs->child( history => title => loc('History'), path => "/Articles/Article/History.html?id=".$id );
++ $tabs->child( modify => title => loc('Modify'), path => "/Articles/Article/Edit.html?id=".$id );
+ }
+ }
+
@@ -531,19 +533,19 @@
+ HTML::Mason::Commands::PageWidgets()->delete('simple_search');
+
+ my $tabs = HTML::Mason::Commands::PageMenu();
-+ $tabs->child( search => title => HTML::Mason::Commands::loc("Search"), path => "/Articles/Article/Search.html" );
-+ $tabs->child( create => title => HTML::Mason::Commands::loc("New Article" ), path => "/Articles/Article/PreCreate.html" );
++ $tabs->child( search => title => loc("Search"), path => "/Articles/Article/Search.html" );
++ $tabs->child( create => title => loc("New Article" ), path => "/Articles/Article/PreCreate.html" );
+ if ( $request_path =~ m{^/Articles/Article/} and ( $HTML::Mason::Commands::DECODED_ARGS->{'id'} || '' ) =~ /^(\d+)$/ ) {
+ my $id = $1;
+ my $obj = RT::Article->new( $HTML::Mason::Commands::session{'CurrentUser'} );
+ $obj->Load($id);
+
+ if ( $obj and $obj->id ) {
-+ $tabs->child( display => title => HTML::Mason::Commands::loc("Display"), path => "/Articles/Article/Display.html?id=" . $id );
-+ $tabs->child( history => title => HTML::Mason::Commands::loc('History'), path => '/Articles/Article/History.html?id=' . $id );
++ $tabs->child( display => title => loc("Display"), path => "/Articles/Article/Display.html?id=" . $id );
++ $tabs->child( history => title => loc('History'), path => '/Articles/Article/History.html?id=' . $id );
+
+ if ( $obj->CurrentUserHasRight('ModifyArticle') ) {
-+ $tabs->child(modify => title => HTML::Mason::Commands::loc('Modify'), path => '/Articles/Article/Edit.html?id=' . $id );
++ $tabs->child(modify => title => loc('Modify'), path => '/Articles/Article/Edit.html?id=' . $id );
+ }
+ }
+ }
@@ -611,22 +613,22 @@
+ keys %$HTML::Mason::Commands::DECODED_ARGS;
+ if ( $request_path =~ /Bulk/) {
+ $page->child('search',
-+ title => HTML::Mason::Commands::loc('Show Results'),
++ title => loc('Show Results'),
+ path => '/Asset/Search/?' . (keys %search ? QueryString(%search) : ''),
+ );
+ } else {
+ $page->child('bulk',
-+ title => HTML::Mason::Commands::loc('Bulk Update'),
++ title => loc('Bulk Update'),
+ path => '/Asset/Search/Bulk.html?' . (keys %search ? QueryString(%search) : ''),
+ );
+ }
+ $page->child('csv',
-+ title => HTML::Mason::Commands::loc('Download Spreadsheet'),
++ title => loc('Download Spreadsheet'),
+ path => '/Asset/Search/Results.tsv?' . (keys %search ? QueryString(%search) : ''),
+ );
+ } elsif ($request_path =~ m{^/Admin/Global/CustomFields/Catalog-Assets\.html$}) {
+ my $page = HTML::Mason::Commands::PageMenu();
-+ $page->child("create", title => HTML::Mason::Commands::loc("Create New"), path => "/Admin/CustomFields/Modify.html?Create=1;LookupType=" . RT::Asset->CustomFieldLookupType);
++ $page->child("create", title => loc("Create New"), path => "/Admin/CustomFields/Modify.html?Create=1;LookupType=" . RT::Asset->CustomFieldLookupType);
+ } elsif ($request_path =~ m{^/Admin/CustomFields(/|/index\.html)?$}
+ and $HTML::Mason::Commands::DECODED_ARGS->{'Type'} and $HTML::Mason::Commands::DECODED_ARGS->{'Type'} eq RT::Asset->CustomFieldLookupType) {
+ my $page = HTML::Mason::Commands::PageMenu();
@@ -635,23 +637,23 @@
+ my $page = HTML::Mason::Commands::PageMenu();
+ my $actions = $request_path =~ m{/((index|Create)\.html)?$}
+ ? $page
-+ : $page->child("catalogs", title => HTML::Mason::Commands::loc("Catalogs"), path => "/Admin/Assets/Catalogs/");
-+
-+ $actions->child("select", title => HTML::Mason::Commands::loc("Select"), path => "/Admin/Assets/Catalogs/");
-+ $actions->child("create", title => HTML::Mason::Commands::loc("Create"), path => "/Admin/Assets/Catalogs/Create.html");
++ : $page->child("catalogs", title => loc("Catalogs"), path => "/Admin/Assets/Catalogs/");
++
++ $actions->child("select", title => loc("Select"), path => "/Admin/Assets/Catalogs/");
++ $actions->child("create", title => loc("Create"), path => "/Admin/Assets/Catalogs/Create.html");
+
+ my $catalog = RT::Catalog->new( $HTML::Mason::Commands::session{CurrentUser} );
+ $catalog->Load($HTML::Mason::Commands::DECODED_ARGS->{id}) if $HTML::Mason::Commands::DECODED_ARGS->{id};
+
+ if ($catalog->id and $catalog->CurrentUserCanSee) {
+ my $query = "id=" . $catalog->id;
-+ $page->child("modify", title => HTML::Mason::Commands::loc("Basics"), path => "/Admin/Assets/Catalogs/Modify.html?$query");
-+ $page->child("people", title => HTML::Mason::Commands::loc("Roles"), path => "/Admin/Assets/Catalogs/Roles.html?$query");
-+
-+ $page->child("cfs", title => HTML::Mason::Commands::loc("Asset Custom Fields"), path => "/Admin/Assets/Catalogs/CustomFields.html?$query");
-+
-+ $page->child("group-rights", title => HTML::Mason::Commands::loc("Group Rights"), path => "/Admin/Assets/Catalogs/GroupRights.html?$query");
-+ $page->child("user-rights", title => HTML::Mason::Commands::loc("User Rights"), path => "/Admin/Assets/Catalogs/UserRights.html?$query");
++ $page->child("modify", title => loc("Basics"), path => "/Admin/Assets/Catalogs/Modify.html?$query");
++ $page->child("people", title => loc("Roles"), path => "/Admin/Assets/Catalogs/Roles.html?$query");
++
++ $page->child("cfs", title => loc("Asset Custom Fields"), path => "/Admin/Assets/Catalogs/CustomFields.html?$query");
++
++ $page->child("group-rights", title => loc("Group Rights"), path => "/Admin/Assets/Catalogs/GroupRights.html?$query");
++ $page->child("user-rights", title => loc("User Rights"), path => "/Admin/Assets/Catalogs/UserRights.html?$query");
+ }
+ }
+
@@ -659,240 +661,241 @@
+ if (HTML::Mason::Commands::PageMenu()->child('summary')) {
+ # Already set up from having AdminUser and ShowConfigTab;
+ # but rename "Basics" to "Edit" in this context
-+ HTML::Mason::Commands::PageMenu()->child( 'basics' )->title( HTML::Mason::Commands::loc('Edit') );
++ HTML::Mason::Commands::PageMenu()->child( 'basics' )->title( loc('Edit') );
+ } elsif ( $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'ShowUserHistory' ) ) {
-+ HTML::Mason::Commands::PageMenu()->child( display => title => HTML::Mason::Commands::loc('Summary'), path => '/User/Summary.html?id=' . $HTML::Mason::Commands::DECODED_ARGS->{'id'} );
-+ HTML::Mason::Commands::PageMenu()->child( history => title => HTML::Mason::Commands::loc('History'), path => '/User/History.html?id=' . $HTML::Mason::Commands::DECODED_ARGS->{'id'} );
++ HTML::Mason::Commands::PageMenu()->child( display => title => loc('Summary'), path => '/User/Summary.html?id=' . $HTML::Mason::Commands::DECODED_ARGS->{'id'} );
++ HTML::Mason::Commands::PageMenu()->child( history => title => loc('History'), path => '/User/History.html?id=' . $HTML::Mason::Commands::DECODED_ARGS->{'id'} );
+ }
+ }
+
+ if ( $request_path =~ /^\/(?:index.html|$)/ ) {
-+ HTML::Mason::Commands::PageMenu()->child( edit => title => HTML::Mason::Commands::loc('Edit'), path => '/Prefs/MyRT.html' );
-+ }
-+
-+ $HTML::Mason::Commands::m->callback( CallbackName => 'Privileged', Path => $request_path );
++ HTML::Mason::Commands::PageMenu()->child( edit => title => loc('Edit'), path => '/Prefs/MyRT.html' );
++ }
++
++ # due to historical reasons of always having been in /Elements/Tabs
++ $HTML::Mason::Commands::m->callback( CallbackName => 'Privileged', Path => $request_path, CallbackPage => '/Elements/Tabs' );
+}
+
-+sub BuildAdminMenu {
++sub _BuildAdminMenu {
+ my $request_path = shift;
+ my $top = shift;
+
-+ my $admin = $top->child( admin => title => HTML::Mason::Commands::loc('Admin'), path => '/Admin/' );
++ my $admin = $top->child( admin => title => loc('Admin'), path => '/Admin/' );
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'AdminUsers' ) ) {
+ my $users = $admin->child( users =>
-+ title => HTML::Mason::Commands::loc('Users'),
-+ description => HTML::Mason::Commands::loc('Manage users and passwords'),
++ title => loc('Users'),
++ description => loc('Manage users and passwords'),
+ path => '/Admin/Users/',
+ );
-+ $users->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Users/" );
-+ $users->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Users/Modify.html?Create=1" );
++ $users->child( select => title => loc('Select'), path => "/Admin/Users/" );
++ $users->child( create => title => loc('Create'), path => "/Admin/Users/Modify.html?Create=1" );
+ }
+ my $groups = $admin->child( groups =>
-+ title => HTML::Mason::Commands::loc('Groups'),
-+ description => HTML::Mason::Commands::loc('Manage groups and group membership'),
++ title => loc('Groups'),
++ description => loc('Manage groups and group membership'),
+ path => '/Admin/Groups/',
+ );
-+ $groups->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Groups/" );
-+ $groups->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Groups/Modify.html?Create=1" );
++ $groups->child( select => title => loc('Select'), path => "/Admin/Groups/" );
++ $groups->child( create => title => loc('Create'), path => "/Admin/Groups/Modify.html?Create=1" );
+
+ my $queues = $admin->child( queues =>
-+ title => HTML::Mason::Commands::loc('Queues'),
-+ description => HTML::Mason::Commands::loc('Manage queues and queue-specific properties'),
++ title => loc('Queues'),
++ description => loc('Manage queues and queue-specific properties'),
+ path => '/Admin/Queues/',
+ );
-+ $queues->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Queues/" );
-+ $queues->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Queues/Modify.html?Create=1" );
++ $queues->child( select => title => loc('Select'), path => "/Admin/Queues/" );
++ $queues->child( create => title => loc('Create'), path => "/Admin/Queues/Modify.html?Create=1" );
+
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'AdminCustomField' ) ) {
+ my $cfs = $admin->child( 'custom-fields' =>
-+ title => HTML::Mason::Commands::loc('Custom Fields'),
-+ description => HTML::Mason::Commands::loc('Manage custom fields and custom field values'),
++ title => loc('Custom Fields'),
++ description => loc('Manage custom fields and custom field values'),
+ path => '/Admin/CustomFields/',
+ );
-+ $cfs->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/CustomFields/" );
-+ $cfs->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/CustomFields/Modify.html?Create=1" );
++ $cfs->child( select => title => loc('Select'), path => "/Admin/CustomFields/" );
++ $cfs->child( create => title => loc('Create'), path => "/Admin/CustomFields/Modify.html?Create=1" );
+ }
+
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'AdminCustomRoles' ) ) {
+ my $roles = $admin->child( 'custom-roles' =>
-+ title => HTML::Mason::Commands::loc('Custom Roles'),
-+ description => HTML::Mason::Commands::loc('Manage custom roles'),
++ title => loc('Custom Roles'),
++ description => loc('Manage custom roles'),
+ path => '/Admin/CustomRoles/',
+ );
-+ $roles->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/CustomRoles/" );
-+ $roles->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/CustomRoles/Modify.html?Create=1" );
++ $roles->child( select => title => loc('Select'), path => "/Admin/CustomRoles/" );
++ $roles->child( create => title => loc('Create'), path => "/Admin/CustomRoles/Modify.html?Create=1" );
+ }
+
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'ModifyScrips' ) ) {
+ my $scrips = $admin->child( 'scrips' =>
-+ title => HTML::Mason::Commands::loc('Scrips'),
-+ description => HTML::Mason::Commands::loc('Manage scrips'),
++ title => loc('Scrips'),
++ description => loc('Manage scrips'),
+ path => '/Admin/Scrips/',
+ );
-+ $scrips->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Scrips/" );
-+ $scrips->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Scrips/Create.html" );
++ $scrips->child( select => title => loc('Select'), path => "/Admin/Scrips/" );
++ $scrips->child( create => title => loc('Create'), path => "/Admin/Scrips/Create.html" );
+ }
+
+ my $admin_global = $admin->child( global =>
-+ title => HTML::Mason::Commands::loc('Global'),
-+ description => HTML::Mason::Commands::loc('Manage properties and configuration which apply to all queues'),
++ title => loc('Global'),
++ description => loc('Manage properties and configuration which apply to all queues'),
+ path => '/Admin/Global/',
+ );
+
+ my $scrips = $admin_global->child( scrips =>
-+ title => HTML::Mason::Commands::loc('Scrips'),
-+ description => HTML::Mason::Commands::loc('Modify scrips which apply to all queues'),
++ title => loc('Scrips'),
++ description => loc('Modify scrips which apply to all queues'),
+ path => '/Admin/Global/Scrips.html',
+ );
-+ $scrips->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Global/Scrips.html" );
-+ $scrips->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Scrips/Create.html?Global=1" );
++ $scrips->child( select => title => loc('Select'), path => "/Admin/Global/Scrips.html" );
++ $scrips->child( create => title => loc('Create'), path => "/Admin/Scrips/Create.html?Global=1" );
+
+ my $templates = $admin_global->child( templates =>
-+ title => HTML::Mason::Commands::loc('Templates'),
-+ description => HTML::Mason::Commands::loc('Edit system templates'),
++ title => loc('Templates'),
++ description => loc('Edit system templates'),
+ path => '/Admin/Global/Templates.html',
+ );
-+ $templates->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Global/Templates.html" );
-+ $templates->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Global/Template.html?Create=1" );
++ $templates->child( select => title => loc('Select'), path => "/Admin/Global/Templates.html" );
++ $templates->child( create => title => loc('Create'), path => "/Admin/Global/Template.html?Create=1" );
+
+ my $cfadmin = $admin_global->child( 'custom-fields' =>
-+ title => HTML::Mason::Commands::loc('Custom Fields'),
-+ description => HTML::Mason::Commands::loc('Modify global custom fields'),
++ title => loc('Custom Fields'),
++ description => loc('Modify global custom fields'),
+ path => '/Admin/Global/CustomFields/index.html',
+ );
+ $cfadmin->child( users =>
-+ title => HTML::Mason::Commands::loc('Users'),
-+ description => HTML::Mason::Commands::loc('Select custom fields for all users'),
++ title => loc('Users'),
++ description => loc('Select custom fields for all users'),
+ path => '/Admin/Global/CustomFields/Users.html',
+ );
+ $cfadmin->child( groups =>
-+ title => HTML::Mason::Commands::loc('Groups'),
-+ description => HTML::Mason::Commands::loc('Select custom fields for all user groups'),
++ title => loc('Groups'),
++ description => loc('Select custom fields for all user groups'),
+ path => '/Admin/Global/CustomFields/Groups.html',
+ );
+ $cfadmin->child( queues =>
-+ title => HTML::Mason::Commands::loc('Queues'),
-+ description => HTML::Mason::Commands::loc('Select custom fields for all queues'),
++ title => loc('Queues'),
++ description => loc('Select custom fields for all queues'),
+ path => '/Admin/Global/CustomFields/Queues.html',
+ );
+ $cfadmin->child( tickets =>
-+ title => HTML::Mason::Commands::loc('Tickets'),
-+ description => HTML::Mason::Commands::loc('Select custom fields for tickets in all queues'),
++ title => loc('Tickets'),
++ description => loc('Select custom fields for tickets in all queues'),
+ path => '/Admin/Global/CustomFields/Queue-Tickets.html',
+ );
+ $cfadmin->child( transactions =>
-+ title => HTML::Mason::Commands::loc('Ticket Transactions'),
-+ description => HTML::Mason::Commands::loc('Select custom fields for transactions on tickets in all queues'),
++ title => loc('Ticket Transactions'),
++ description => loc('Select custom fields for transactions on tickets in all queues'),
+ path => '/Admin/Global/CustomFields/Queue-Transactions.html',
+ );
+ $cfadmin->child( 'custom-fields' =>
-+ title => HTML::Mason::Commands::loc('Articles'),
-+ description => HTML::Mason::Commands::loc('Select Custom Fields for Articles in all Classes'),
++ title => loc('Articles'),
++ description => loc('Select Custom Fields for Articles in all Classes'),
+ path => '/Admin/Global/CustomFields/Class-Article.html',
+ );
+ $cfadmin->child( 'assets' =>
-+ title => HTML::Mason::Commands::loc('Assets'),
-+ description => HTML::Mason::Commands::loc('Select Custom Fields for Assets in all Catalogs'),
++ title => loc('Assets'),
++ description => loc('Select Custom Fields for Assets in all Catalogs'),
+ path => '/Admin/Global/CustomFields/Catalog-Assets.html',
+ );
+
-+ my $article_admin = $admin->child( articles => title => HTML::Mason::Commands::loc('Articles'), path => "/Admin/Articles/index.html" );
-+ my $class_admin = $article_admin->child(classes => title => HTML::Mason::Commands::loc('Classes'), path => '/Admin/Articles/Classes/' );
++ my $article_admin = $admin->child( articles => title => loc('Articles'), path => "/Admin/Articles/index.html" );
++ my $class_admin = $article_admin->child(classes => title => loc('Classes'), path => '/Admin/Articles/Classes/' );
+ $class_admin->child( select =>
-+ title => HTML::Mason::Commands::loc('Select'),
-+ description => HTML::Mason::Commands::loc('Modify and Create Classes'),
++ title => loc('Select'),
++ description => loc('Modify and Create Classes'),
+ path => '/Admin/Articles/Classes/',
+ );
+ $class_admin->child( create =>
-+ title => HTML::Mason::Commands::loc('Create'),
-+ description => HTML::Mason::Commands::loc('Modify and Create Custom Fields for Articles'),
++ title => loc('Create'),
++ description => loc('Modify and Create Custom Fields for Articles'),
+ path => '/Admin/Articles/Classes/Modify.html?Create=1',
+ );
+
+
+ my $cfs = $article_admin->child( 'custom-fields' =>
-+ title => HTML::Mason::Commands::loc('Custom Fields'),
++ title => loc('Custom Fields'),
+ path => '/Admin/CustomFields/index.html?'.$HTML::Mason::Commands::m->comp('/Elements/QueryString', Type => 'RT::Class-RT::Article'),
+ );
+ $cfs->child( select =>
-+ title => HTML::Mason::Commands::loc('Select'),
++ title => loc('Select'),
+ path => '/Admin/CustomFields/index.html?'.$HTML::Mason::Commands::m->comp('/Elements/QueryString', Type => 'RT::Class-RT::Article'),
+ );
+ $cfs->child( create =>
-+ title => HTML::Mason::Commands::loc('Create'),
++ title => loc('Create'),
+ path => '/Admin/CustomFields/Modify.html?'.$HTML::Mason::Commands::m->comp("/Elements/QueryString", Create=>1, LookupType=> "RT::Class-RT::Article" ),
+ );
+
-+ my $assets_admin = $admin->child( assets => title => HTML::Mason::Commands::loc("Assets"), path => '/Admin/Assets/' );
++ my $assets_admin = $admin->child( assets => title => loc("Assets"), path => '/Admin/Assets/' );
+ my $catalog_admin = $assets_admin->child( catalogs =>
-+ title => HTML::Mason::Commands::loc("Catalogs"),
-+ description => HTML::Mason::Commands::loc("Modify asset catalogs"),
++ title => loc("Catalogs"),
++ description => loc("Modify asset catalogs"),
+ path => "/Admin/Assets/Catalogs/"
+ );
-+ $catalog_admin->child( "select", title => HTML::Mason::Commands::loc("Select"), path => $catalog_admin->path );
-+ $catalog_admin->child( "create", title => HTML::Mason::Commands::loc("Create"), path => "Create.html" );
++ $catalog_admin->child( "select", title => loc("Select"), path => $catalog_admin->path );
++ $catalog_admin->child( "create", title => loc("Create"), path => "Create.html" );
+
+
+ my $assets_cfs = $assets_admin->child( "cfs",
-+ title => HTML::Mason::Commands::loc("Custom Fields"),
-+ description => HTML::Mason::Commands::loc("Modify asset custom fields"),
++ title => loc("Custom Fields"),
++ description => loc("Modify asset custom fields"),
+ path => "/Admin/CustomFields/?Type=" . RT::Asset->CustomFieldLookupType
+ );
-+ $assets_cfs->child( "select", title => HTML::Mason::Commands::loc("Select"), path => $assets_cfs->path );
-+ $assets_cfs->child( "create", title => HTML::Mason::Commands::loc("Create"), path => "/Admin/CustomFields/Modify.html?Create=1&LookupType=" . RT::Asset->CustomFieldLookupType);
++ $assets_cfs->child( "select", title => loc("Select"), path => $assets_cfs->path );
++ $assets_cfs->child( "create", title => loc("Create"), path => "/Admin/CustomFields/Modify.html?Create=1&LookupType=" . RT::Asset->CustomFieldLookupType);
+
+ $admin_global->child( 'group-rights' =>
-+ title => HTML::Mason::Commands::loc('Group Rights'),
-+ description => HTML::Mason::Commands::loc('Modify global group rights'),
++ title => loc('Group Rights'),
++ description => loc('Modify global group rights'),
+ path => '/Admin/Global/GroupRights.html',
+ );
+ $admin_global->child( 'user-rights' =>
-+ title => HTML::Mason::Commands::loc('User Rights'),
-+ description => HTML::Mason::Commands::loc('Modify global user rights'),
++ title => loc('User Rights'),
++ description => loc('Modify global user rights'),
+ path => '/Admin/Global/UserRights.html',
+ );
+ $admin_global->child( 'my-rt' =>
-+ title => HTML::Mason::Commands::loc('RT at a glance'),
-+ description => HTML::Mason::Commands::loc('Modify the default "RT at a glance" view'),
++ title => loc('RT at a glance'),
++ description => loc('Modify the default "RT at a glance" view'),
+ path => '/Admin/Global/MyRT.html',
+ );
+ $admin_global->child( 'dashboards-in-menu' =>
-+ title => HTML::Mason::Commands::loc('Dashboards in menu'),
-+ description => HTML::Mason::Commands::loc('Customize dashboards in menu'),
++ title => loc('Dashboards in menu'),
++ description => loc('Customize dashboards in menu'),
+ path => '/Admin/Global/DashboardsInMenu.html',
+ );
+ $admin_global->child( 'topics' =>
-+ title => HTML::Mason::Commands::loc('Topics'),
-+ description => HTML::Mason::Commands::loc('Modify global article topics'),
++ title => loc('Topics'),
++ description => loc('Modify global article topics'),
+ path => '/Admin/Global/Topics.html',
+ );
+
+ my $admin_tools = $admin->child( tools =>
-+ title => HTML::Mason::Commands::loc('Tools'),
-+ description => HTML::Mason::Commands::loc('Use other RT administrative tools'),
++ title => loc('Tools'),
++ description => loc('Use other RT administrative tools'),
+ path => '/Admin/Tools/',
+ );
+ $admin_tools->child( configuration =>
-+ title => HTML::Mason::Commands::loc('System Configuration'),
-+ description => HTML::Mason::Commands::loc('Detailed information about your RT setup'),
++ title => loc('System Configuration'),
++ description => loc('Detailed information about your RT setup'),
+ path => '/Admin/Tools/Configuration.html',
+ );
+ $admin_tools->child( theme =>
-+ title => HTML::Mason::Commands::loc('Theme'),
-+ description => HTML::Mason::Commands::loc('Customize the look of your RT'),
++ title => loc('Theme'),
++ description => loc('Customize the look of your RT'),
+ path => '/Admin/Tools/Theme.html',
+ );
+ if (RT->Config->Get('StatementLog')
+ && $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Right => 'SuperUser', Object => RT->System )) {
+ $admin_tools->child( 'sql-queries' =>
-+ title => HTML::Mason::Commands::loc('SQL Queries'),
-+ description => HTML::Mason::Commands::loc('Browse the SQL queries made in this process'),
++ title => loc('SQL Queries'),
++ description => loc('Browse the SQL queries made in this process'),
+ path => '/Admin/Tools/Queries.html',
+ );
+ }
+ $admin_tools->child( shredder =>
-+ title => HTML::Mason::Commands::loc('Shredder'),
-+ description => HTML::Mason::Commands::loc('Permanently wipeout data from RT'),
++ title => loc('Shredder'),
++ description => loc('Permanently wipeout data from RT'),
+ path => '/Admin/Tools/Shredder',
+ );
+
@@ -901,11 +904,11 @@
+ my $tabs = HTML::Mason::Commands::PageMenu();
+
+ my %labels = (
-+ Queues => HTML::Mason::Commands::loc("Queues"),
-+ Users => HTML::Mason::Commands::loc("Users"),
-+ Groups => HTML::Mason::Commands::loc("Groups"),
-+ CustomFields => HTML::Mason::Commands::loc("Custom Fields"),
-+ CustomRoles => HTML::Mason::Commands::loc("Custom Roles"),
++ Queues => loc("Queues"),
++ Users => loc("Users"),
++ Groups => loc("Groups"),
++ CustomFields => loc("Custom Fields"),
++ CustomRoles => loc("Custom Roles"),
+ );
+
+ my $section;
@@ -921,8 +924,8 @@
+ path => "/Admin/$type/" );
+ }
+
-+ $section->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/$type/" );
-+ $section->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/$type/Modify.html?Create=1" );
++ $section->child( select => title => loc('Select'), path => "/Admin/$type/" );
++ $section->child( create => title => loc('Create'), path => "/Admin/$type/Modify.html?Create=1" );
+ }
+
+ if ( $request_path =~ m{^/Admin/Queues} ) {
@@ -936,30 +939,31 @@
+
+ if ( $queue_obj and $queue_obj->id ) {
+ my $queue = HTML::Mason::Commands::PageMenu();
-+ $queue->child( basics => title => HTML::Mason::Commands::loc('Basics'), path => "/Admin/Queues/Modify.html?id=" . $id );
-+ $queue->child( people => title => HTML::Mason::Commands::loc('Watchers'), path => "/Admin/Queues/People.html?id=" . $id );
-+
-+ my $templates = $queue->child(templates => title => HTML::Mason::Commands::loc('Templates'), path => "/Admin/Queues/Templates.html?id=" . $id);
-+ $templates->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Queues/Templates.html?id=".$id);
-+ $templates->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Queues/Template.html?Create=1;Queue=".$id);
-+
-+ my $scrips = $queue->child( scrips => title => HTML::Mason::Commands::loc('Scrips'), path => "/Admin/Queues/Scrips.html?id=" . $id);
-+ $scrips->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Queues/Scrips.html?id=" . $id );
-+ $scrips->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Scrips/Create.html?Queue=" . $id);
-+
-+ my $cfs = $queue->child( 'custom-fields' => title => HTML::Mason::Commands::loc('Custom Fields') );
-+ my $ticket_cfs = $cfs->child( 'tickets' => title => HTML::Mason::Commands::loc('Tickets'),
++ $queue->child( basics => title => loc('Basics'), path => "/Admin/Queues/Modify.html?id=" . $id );
++ $queue->child( people => title => loc('Watchers'), path => "/Admin/Queues/People.html?id=" . $id );
++
++ my $templates = $queue->child(templates => title => loc('Templates'), path => "/Admin/Queues/Templates.html?id=" . $id);
++ $templates->child( select => title => loc('Select'), path => "/Admin/Queues/Templates.html?id=".$id);
++ $templates->child( create => title => loc('Create'), path => "/Admin/Queues/Template.html?Create=1;Queue=".$id);
++
++ my $scrips = $queue->child( scrips => title => loc('Scrips'), path => "/Admin/Queues/Scrips.html?id=" . $id);
++ $scrips->child( select => title => loc('Select'), path => "/Admin/Queues/Scrips.html?id=" . $id );
++ $scrips->child( create => title => loc('Create'), path => "/Admin/Scrips/Create.html?Queue=" . $id);
++
++ my $cfs = $queue->child( 'custom-fields' => title => loc('Custom Fields') );
++ my $ticket_cfs = $cfs->child( 'tickets' => title => loc('Tickets'),
+ path => '/Admin/Queues/CustomFields.html?SubType=RT::Ticket&id=' . $id );
+
-+ my $txn_cfs = $cfs->child( 'transactions' => title => HTML::Mason::Commands::loc('Transactions'),
++ my $txn_cfs = $cfs->child( 'transactions' => title => loc('Transactions'),
+ path => '/Admin/Queues/CustomFields.html?SubType=RT::Ticket-RT::Transaction&id='.$id );
+
-+ $queue->child( 'group-rights' => title => HTML::Mason::Commands::loc('Group Rights'), path => "/Admin/Queues/GroupRights.html?id=".$id );
-+ $queue->child( 'user-rights' => title => HTML::Mason::Commands::loc('User Rights'), path => "/Admin/Queues/UserRights.html?id=" . $id );
-+ $queue->child( 'history' => title => HTML::Mason::Commands::loc('History'), path => "/Admin/Queues/History.html?id=" . $id );
-+ $queue->child( 'default-values' => title => HTML::Mason::Commands::loc('Default Values'), path => "/Admin/Queues/DefaultValues.html?id=" . $id );
-+
-+ $HTML::Mason::Commands::m->callback( CallbackName => 'PrivilegedQueue', queue_id => $id, page_menu => $queue);
++ $queue->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/Queues/GroupRights.html?id=".$id );
++ $queue->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/Queues/UserRights.html?id=" . $id );
++ $queue->child( 'history' => title => loc('History'), path => "/Admin/Queues/History.html?id=" . $id );
++ $queue->child( 'default-values' => title => loc('Default Values'), path => "/Admin/Queues/DefaultValues.html?id=" . $id );
++
++ # due to historical reasons of always having been in /Elements/Tabs
++ $HTML::Mason::Commands::m->callback( CallbackName => 'PrivilegedQueue', queue_id => $id, page_menu => $queue, CallbackPage => '/Elements/Tabs' );
+ }
+ }
+ }
@@ -971,18 +975,18 @@
+
+ if ( $obj and $obj->id ) {
+ my $tabs = HTML::Mason::Commands::PageMenu();
-+ $tabs->child( basics => title => HTML::Mason::Commands::loc('Basics'), path => "/Admin/Users/Modify.html?id=" . $id );
-+ $tabs->child( memberships => title => HTML::Mason::Commands::loc('Memberships'), path => "/Admin/Users/Memberships.html?id=" . $id );
-+ $tabs->child( history => title => HTML::Mason::Commands::loc('History'), path => "/Admin/Users/History.html?id=" . $id );
-+ $tabs->child( 'my-rt' => title => HTML::Mason::Commands::loc('RT at a glance'), path => "/Admin/Users/MyRT.html?id=" . $id );
++ $tabs->child( basics => title => loc('Basics'), path => "/Admin/Users/Modify.html?id=" . $id );
++ $tabs->child( memberships => title => loc('Memberships'), path => "/Admin/Users/Memberships.html?id=" . $id );
++ $tabs->child( history => title => loc('History'), path => "/Admin/Users/History.html?id=" . $id );
++ $tabs->child( 'my-rt' => title => loc('RT at a glance'), path => "/Admin/Users/MyRT.html?id=" . $id );
+ $tabs->child( 'dashboards-in-menu' =>
-+ title => HTML::Mason::Commands::loc('Dashboards in menu'),
++ title => loc('Dashboards in menu'),
+ path => '/Admin/Users/DashboardsInMenu.html?id=' . $id,
+ );
+ if ( RT->Config->Get('Crypt')->{'Enable'} ) {
-+ $tabs->child( keys => title => HTML::Mason::Commands::loc('Private keys'), path => "/Admin/Users/Keys.html?id=" . $id );
++ $tabs->child( keys => title => loc('Private keys'), path => "/Admin/Users/Keys.html?id=" . $id );
+ }
-+ $tabs->child( 'summary' => title => HTML::Mason::Commands::loc('User Summary'), path => "/User/Summary.html?id=" . $id );
++ $tabs->child( 'summary' => title => loc('User Summary'), path => "/User/Summary.html?id=" . $id );
+ }
+ }
+
@@ -996,12 +1000,12 @@
+
+ if ( $obj and $obj->id ) {
+ my $tabs = HTML::Mason::Commands::PageMenu();
-+ $tabs->child( basics => title => HTML::Mason::Commands::loc('Basics'), path => "/Admin/Groups/Modify.html?id=" . $obj->id );
-+ $tabs->child( members => title => HTML::Mason::Commands::loc('Members'), path => "/Admin/Groups/Members.html?id=" . $obj->id );
-+ $tabs->child( memberships => title => HTML::Mason::Commands::loc('Memberships'), path => "/Admin/Groups/Memberships.html?id=" . $obj->id );
-+ $tabs->child( 'group-rights' => title => HTML::Mason::Commands::loc('Group Rights'), path => "/Admin/Groups/GroupRights.html?id=" . $obj->id );
-+ $tabs->child( 'user-rights' => title => HTML::Mason::Commands::loc('User Rights'), path => "/Admin/Groups/UserRights.html?id=" . $obj->id );
-+ $tabs->child( history => title => HTML::Mason::Commands::loc('History'), path => "/Admin/Groups/History.html?id=" . $obj->id );
++ $tabs->child( basics => title => loc('Basics'), path => "/Admin/Groups/Modify.html?id=" . $obj->id );
++ $tabs->child( members => title => loc('Members'), path => "/Admin/Groups/Members.html?id=" . $obj->id );
++ $tabs->child( memberships => title => loc('Memberships'), path => "/Admin/Groups/Memberships.html?id=" . $obj->id );
++ $tabs->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/Groups/GroupRights.html?id=" . $obj->id );
++ $tabs->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/Groups/UserRights.html?id=" . $obj->id );
++ $tabs->child( history => title => loc('History'), path => "/Admin/Groups/History.html?id=" . $obj->id );
+ }
+ }
+ }
@@ -1014,11 +1018,11 @@
+
+ if ( $obj and $obj->id ) {
+ my $tabs = HTML::Mason::Commands::PageMenu();
-+ $tabs->child( basics => title => HTML::Mason::Commands::loc('Basics'), path => "/Admin/CustomFields/Modify.html?id=".$id );
-+ $tabs->child( 'group-rights' => title => HTML::Mason::Commands::loc('Group Rights'), path => "/Admin/CustomFields/GroupRights.html?id=" . $id );
-+ $tabs->child( 'user-rights' => title => HTML::Mason::Commands::loc('User Rights'), path => "/Admin/CustomFields/UserRights.html?id=" . $id );
++ $tabs->child( basics => title => loc('Basics'), path => "/Admin/CustomFields/Modify.html?id=".$id );
++ $tabs->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/CustomFields/GroupRights.html?id=" . $id );
++ $tabs->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/CustomFields/UserRights.html?id=" . $id );
+ unless ( $obj->IsOnlyGlobal ) {
-+ $tabs->child( 'applies-to' => title => HTML::Mason::Commands::loc('Applies to'), path => "/Admin/CustomFields/Objects.html?id=" . $id );
++ $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/CustomFields/Objects.html?id=" . $id );
+ }
+ }
+ }
@@ -1032,8 +1036,8 @@
+
+ if ( $obj and $obj->id ) {
+ my $tabs = HTML::Mason::Commands::PageMenu();
-+ $tabs->child( basics => title => HTML::Mason::Commands::loc('Basics'), path => "/Admin/CustomRoles/Modify.html?id=".$id );
-+ $tabs->child( 'applies-to' => title => HTML::Mason::Commands::loc('Applies to'), path => "/Admin/CustomRoles/Objects.html?id=" . $id );
++ $tabs->child( basics => title => loc('Basics'), path => "/Admin/CustomRoles/Modify.html?id=".$id );
++ $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/CustomRoles/Objects.html?id=" . $id );
+ }
+ }
+ }
@@ -1063,43 +1067,43 @@
+ $admin_cat = 'Scrips';
+ $from_query_param = $create_path_arg = q{};
+ }
-+ my $scrips = $tabs->child( scrips => title => HTML::Mason::Commands::loc('Scrips'), path => "/Admin/${admin_cat}" );
-+ $scrips->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/${admin_cat}" );
-+ $scrips->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Scrips/Create.html${create_path_arg}" );
-+
-+ $tabs->child( basics => title => HTML::Mason::Commands::loc('Basics') => path => "/Admin/Scrips/Modify.html?id=" . $id . $from_query_param );
-+ $tabs->child( 'applies-to' => title => HTML::Mason::Commands::loc('Applies to'), path => "/Admin/Scrips/Objects.html?id=" . $id . $from_query_param );
++ my $scrips = $tabs->child( scrips => title => loc('Scrips'), path => "/Admin/${admin_cat}" );
++ $scrips->child( select => title => loc('Select'), path => "/Admin/${admin_cat}" );
++ $scrips->child( create => title => loc('Create'), path => "/Admin/Scrips/Create.html${create_path_arg}" );
++
++ $tabs->child( basics => title => loc('Basics') => path => "/Admin/Scrips/Modify.html?id=" . $id . $from_query_param );
++ $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/Scrips/Objects.html?id=" . $id . $from_query_param );
+ }
+ elsif ( $request_path =~ m{^/Admin/Scrips/(index\.html)?$} ) {
-+ HTML::Mason::Commands::PageMenu->child( select => title => HTML::Mason::Commands::loc('Select') => path => "/Admin/Scrips/" );
-+ HTML::Mason::Commands::PageMenu->child( create => title => HTML::Mason::Commands::loc('Create') => path => "/Admin/Scrips/Create.html" );
++ HTML::Mason::Commands::PageMenu->child( select => title => loc('Select') => path => "/Admin/Scrips/" );
++ HTML::Mason::Commands::PageMenu->child( create => title => loc('Create') => path => "/Admin/Scrips/Create.html" );
+ }
+ elsif ( $request_path =~ m{^/Admin/Scrips/Create\.html$} ) {
+ my ($queue) = $HTML::Mason::Commands::DECODED_ARGS->{'Queue'} && $HTML::Mason::Commands::DECODED_ARGS->{'Queue'} =~ /^(\d+)$/;
+ my $global_arg = $HTML::Mason::Commands::DECODED_ARGS->{'Global'};
+ if ($queue) {
-+ HTML::Mason::Commands::PageMenu->child( select => title => HTML::Mason::Commands::loc('Select') => path => "/Admin/Queues/Scrips.html?id=$queue" );
-+ HTML::Mason::Commands::PageMenu->child( create => title => HTML::Mason::Commands::loc('Create') => path => "/Admin/Scrips/Create.html?Queue=$queue" );
++ HTML::Mason::Commands::PageMenu->child( select => title => loc('Select') => path => "/Admin/Queues/Scrips.html?id=$queue" );
++ HTML::Mason::Commands::PageMenu->child( create => title => loc('Create') => path => "/Admin/Scrips/Create.html?Queue=$queue" );
+ } elsif ($global_arg) {
-+ HTML::Mason::Commands::PageMenu->child( select => title => HTML::Mason::Commands::loc('Select') => path => "/Admin/Global/Scrips.html" );
-+ HTML::Mason::Commands::PageMenu->child( create => title => HTML::Mason::Commands::loc('Create') => path => "/Admin/Scrips/Create.html?Global=1" );
++ HTML::Mason::Commands::PageMenu->child( select => title => loc('Select') => path => "/Admin/Global/Scrips.html" );
++ HTML::Mason::Commands::PageMenu->child( create => title => loc('Create') => path => "/Admin/Scrips/Create.html?Global=1" );
+ } else {
-+ HTML::Mason::Commands::PageMenu->child( select => title => HTML::Mason::Commands::loc('Select') => path => "/Admin/Scrips" );
-+ HTML::Mason::Commands::PageMenu->child( create => title => HTML::Mason::Commands::loc('Create') => path => "/Admin/Scrips/Create.html" );
++ HTML::Mason::Commands::PageMenu->child( select => title => loc('Select') => path => "/Admin/Scrips" );
++ HTML::Mason::Commands::PageMenu->child( create => title => loc('Create') => path => "/Admin/Scrips/Create.html" );
+ }
+ }
+ }
+
+ if ( $request_path =~ m{^/Admin/Global/Scrips\.html} ) {
+ my $tabs = HTML::Mason::Commands::PageMenu();
-+ $tabs->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Global/Scrips.html" );
-+ $tabs->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Scrips/Create.html?Global=1" );
++ $tabs->child( select => title => loc('Select'), path => "/Admin/Global/Scrips.html" );
++ $tabs->child( create => title => loc('Create'), path => "/Admin/Scrips/Create.html?Global=1" );
+ }
+
+ if ( $request_path =~ m{^/Admin/Global/Templates?\.html} ) {
+ my $tabs = HTML::Mason::Commands::PageMenu();
-+ $tabs->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Global/Templates.html" );
-+ $tabs->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Global/Template.html?Create=1" );
++ $tabs->child( select => title => loc('Select'), path => "/Admin/Global/Templates.html" );
++ $tabs->child( create => title => loc('Create'), path => "/Admin/Global/Template.html?Create=1" );
+ }
+
+ if ( $request_path =~ m{^/Admin/Articles/Classes/} ) {
@@ -1109,20 +1113,20 @@
+ $obj->Load($id);
+
+ if ( $obj and $obj->id ) {
-+ my $section = $tabs->child( select => title => HTML::Mason::Commands::loc("Classes"), path => "/Admin/Articles/Classes/" );
-+ $section->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Articles/Classes/" );
-+ $section->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Articles/Classes/Modify.html?Create=1" );
-+
-+ $tabs->child( basics => title => HTML::Mason::Commands::loc('Basics'), path => "/Admin/Articles/Classes/Modify.html?id=".$id );
-+ $tabs->child( topics => title => HTML::Mason::Commands::loc('Topics'), path => "/Admin/Articles/Classes/Topics.html?id=".$id );
-+ $tabs->child( 'custom-fields' => title => HTML::Mason::Commands::loc('Custom Fields'), path => "/Admin/Articles/Classes/CustomFields.html?id=".$id );
-+ $tabs->child( 'group-rights' => title => HTML::Mason::Commands::loc('Group Rights'), path => "/Admin/Articles/Classes/GroupRights.html?id=".$id );
-+ $tabs->child( 'user-rights' => title => HTML::Mason::Commands::loc('User Rights'), path => "/Admin/Articles/Classes/UserRights.html?id=".$id );
-+ $tabs->child( 'applies-to' => title => HTML::Mason::Commands::loc('Applies to'), path => "/Admin/Articles/Classes/Objects.html?id=$id" );
++ my $section = $tabs->child( select => title => loc("Classes"), path => "/Admin/Articles/Classes/" );
++ $section->child( select => title => loc('Select'), path => "/Admin/Articles/Classes/" );
++ $section->child( create => title => loc('Create'), path => "/Admin/Articles/Classes/Modify.html?Create=1" );
++
++ $tabs->child( basics => title => loc('Basics'), path => "/Admin/Articles/Classes/Modify.html?id=".$id );
++ $tabs->child( topics => title => loc('Topics'), path => "/Admin/Articles/Classes/Topics.html?id=".$id );
++ $tabs->child( 'custom-fields' => title => loc('Custom Fields'), path => "/Admin/Articles/Classes/CustomFields.html?id=".$id );
++ $tabs->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/Articles/Classes/GroupRights.html?id=".$id );
++ $tabs->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/Articles/Classes/UserRights.html?id=".$id );
++ $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/Articles/Classes/Objects.html?id=$id" );
+ }
+ } else {
-+ $tabs->child( select => title => HTML::Mason::Commands::loc('Select'), path => "/Admin/Articles/Classes/" );
-+ $tabs->child( create => title => HTML::Mason::Commands::loc('Create'), path => "/Admin/Articles/Classes/Modify.html?Create=1" );
++ $tabs->child( select => title => loc('Select'), path => "/Admin/Articles/Classes/" );
++ $tabs->child( create => title => loc('Create'), path => "/Admin/Articles/Classes/Modify.html?Create=1" );
+ }
+ }
+}
@@ -1145,34 +1149,34 @@
+
+
+ if ( $queue_count > 1 ) {
-+ HTML::Mason::Commands::Menu()->child( new => title => HTML::Mason::Commands::loc('New ticket'), path => '/SelfService/CreateTicketInQueue.html' );
++ HTML::Mason::Commands::Menu()->child( new => title => loc('New ticket'), path => '/SelfService/CreateTicketInQueue.html' );
+ } elsif ( $queue_id ) {
-+ HTML::Mason::Commands::Menu()->child( new => title => HTML::Mason::Commands::loc('New ticket'), path => '/SelfService/Create.html?Queue=' . $queue_id );
-+ }
-+ my $tickets = HTML::Mason::Commands::Menu()->child( tickets => title => HTML::Mason::Commands::loc('Tickets'), path => '/SelfService/' );
-+ $tickets->child( open => title => HTML::Mason::Commands::loc('Open tickets'), path => '/SelfService/' );
-+ $tickets->child( closed => title => HTML::Mason::Commands::loc('Closed tickets'), path => '/SelfService/Closed.html' );
-+
-+ HTML::Mason::Commands::Menu()->child( "assets", title => HTML::Mason::Commands::loc("Assets"), path => "/SelfService/Asset/" )
++ HTML::Mason::Commands::Menu()->child( new => title => loc('New ticket'), path => '/SelfService/Create.html?Queue=' . $queue_id );
++ }
++ my $tickets = HTML::Mason::Commands::Menu()->child( tickets => title => loc('Tickets'), path => '/SelfService/' );
++ $tickets->child( open => title => loc('Open tickets'), path => '/SelfService/' );
++ $tickets->child( closed => title => loc('Closed tickets'), path => '/SelfService/Closed.html' );
++
++ HTML::Mason::Commands::Menu()->child( "assets", title => loc("Assets"), path => "/SelfService/Asset/" )
+ if $HTML::Mason::Commands::session{CurrentUser}->HasRight( Right => 'ShowAssetsMenu', Object => RT->System );
+
+ my $username = '<span class="current-user">'
+ . $HTML::Mason::Commands::m->interp->apply_escapes($HTML::Mason::Commands::session{'CurrentUser'}->Name, 'h')
+ . '</span>';
+ my $about_me = HTML::Mason::Commands::Menu()->child( preferences =>
-+ title => HTML::Mason::Commands::loc('Logged in as [_1]', $username),
++ title => loc('Logged in as [_1]', $username),
+ escape_title => 0,
+ sort_order => 99,
+ );
+
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => RT->System ) ) {
-+ $about_me->child( prefs => title => HTML::Mason::Commands::loc('Preferences'), path => '/SelfService/Prefs.html' );
++ $about_me->child( prefs => title => loc('Preferences'), path => '/SelfService/Prefs.html' );
+ }
+
+ if ( $HTML::Mason::Commands::session{'CurrentUser'}->Name
+ && ( !RT->Config->Get('WebRemoteUserAuth')
+ || RT->Config->Get('WebFallbackToRTLogin') )) {
-+ $about_me->child( logout => title => HTML::Mason::Commands::loc('Logout'), path => '/NoAuth/Logout.html' );
++ $about_me->child( logout => title => loc('Logout'), path => '/NoAuth/Logout.html' );
+ }
+
+ if ($HTML::Mason::Commands::session{'CurrentUser'}->HasRight( Right => 'ShowArticle', Object => RT->System )) {
@@ -1184,16 +1188,17 @@
+ if ($request_path =~ m{^/SelfService/Asset/} and $HTML::Mason::Commands::DECODED_ARGS->{id}) {
+ my $page = HTML::Mason::Commands::PageMenu();
+ my $id = $HTML::Mason::Commands::DECODED_ARGS->{id};
-+ $page->child("display", title => HTML::Mason::Commands::loc("Display"), path => "/SelfService/Asset/Display.html?id=$id");
-+ $page->child("history", title => HTML::Mason::Commands::loc("History"), path => "/SelfService/Asset/History.html?id=$id");
++ $page->child("display", title => loc("Display"), path => "/SelfService/Asset/Display.html?id=$id");
++ $page->child("history", title => loc("History"), path => "/SelfService/Asset/History.html?id=$id");
+
+ if (Menu->child("new")) {
-+ my $actions = $page->child("actions", title => HTML::Mason::Commands::loc("Actions"));
-+ $actions->child("create-linked-ticket", title => HTML::Mason::Commands::loc("Create linked ticket"), path => "/SelfService/Asset/CreateLinkedTicket.html?Asset=$id");
-+ }
-+ }
-+
-+ $HTML::Mason::Commands::m->callback( CallbackName => 'SelfService', Path => $request_path );
++ my $actions = $page->child("actions", title => loc("Actions"));
++ $actions->child("create-linked-ticket", title => loc("Create linked ticket"), path => "/SelfService/Asset/CreateLinkedTicket.html?Asset=$id");
++ }
++ }
++
++ # due to historical reasons of always having been in /Elements/Tabs
++ $HTML::Mason::Commands::m->callback( CallbackName => 'SelfService', Path => $request_path, CallbackPage => '/Elements/Tabs' );
+}
+
+1;
@@ -2338,6 +2343,11 @@
- $build_selfservice_nav->();
+ RT::Interface::Web::MenuBuilder::BuildSelfServiceNav( $request_path );
}
-
-
+-
+-
+-
+-
+ </%INIT>
+ <%ARGS>
+ $show_menu => 1
2: 76af288 ! 2: a3a6fd5 refactor asset menu logic into own function
@@ -64,74 +64,4 @@
} elsif ($request_path =~ m{^/Asset/Search/}) {
my $page = HTML::Mason::Commands::PageMenu();
my %search = map @{$_},
-@@
- $HTML::Mason::Commands::m->callback( CallbackName => 'Privileged', Path => $request_path );
- }
-
-+sub _BuildAssetMenu {
-+ my $page = HTML::Mason::Commands::PageMenu();
-+ my $id = $HTML::Mason::Commands::DECODED_ARGS->{id};
-+ my $asset = RT::Asset->new( $HTML::Mason::Commands::session{CurrentUser} );
-+ $asset->Load($id);
-+
-+ if ($asset->id) {
-+ $page->child("display", title => HTML::Mason::Commands::loc("Display"), path => "/Asset/Display.html?id=$id");
-+ $page->child("history", title => HTML::Mason::Commands::loc("History"), path => "/Asset/History.html?id=$id");
-+ $page->child("basics", title => HTML::Mason::Commands::loc("Basics"), path => "/Asset/Modify.html?id=$id");
-+ $page->child("links", title => HTML::Mason::Commands::loc("Links"), path => "/Asset/ModifyLinks.html?id=$id");
-+ $page->child("people", title => HTML::Mason::Commands::loc("People"), path => "/Asset/ModifyPeople.html?id=$id");
-+ $page->child("dates", title => HTML::Mason::Commands::loc("Dates"), path => "/Asset/ModifyDates.html?id=$id");
-+
-+ for my $grouping (RT::CustomField->CustomGroupings($asset)) {
-+ my $cfs = $asset->CustomFields;
-+ $cfs->LimitToGrouping( $asset => $grouping );
-+ next unless $cfs->Count;
-+ $page->child(
-+ "cf-grouping-$grouping",
-+ title => HTML::Mason::Commands::loc($grouping),
-+ path => "/Asset/ModifyCFs.html?id=$id;Grouping=" . $HTML::Mason::Commands::m->interp->apply_escapes($grouping, 'u'),
-+ );
-+ }
-+
-+ _BuildAssetMenuActionSubmenu($asset);
-+ }
-+}
-+
-+sub _BuildAssetMenuActionSubmenu {
-+ my $asset = shift;
-+
-+ my $page = HTML::Mason::Commands::PageMenu();
-+ my $id = $asset->id;
-+
-+ my $actions = $page->child("actions", title => HTML::Mason::Commands::loc("Actions"));
-+ $actions->child("create-linked-ticket", title => HTML::Mason::Commands::loc("Create linked ticket"), path => "/Asset/CreateLinkedTicket.html?Asset=$id");
-+
-+ my $status = $asset->Status;
-+ my $lifecycle = $asset->LifecycleObj;
-+ for my $action ( $lifecycle->Actions($status) ) {
-+ my $next = $action->{'to'};
-+ next unless $lifecycle->IsTransition( $status => $next );
-+
-+ my $check = $lifecycle->CheckRight( $status => $next );
-+ next unless $asset->CurrentUserHasRight($check);
-+
-+ my $label = $action->{'label'} || ucfirst($next);
-+ $actions->child(
-+ $label,
-+ title => HTML::Mason::Commands::loc($label),
-+ path => "/Asset/Modify.html?id=$id;Update=1;DisplayAfter=1;Status="
-+ . $HTML::Mason::Commands::m->interp->apply_escapes($next, 'u'),
-+
-+ class => "asset-lifecycle-action",
-+ attributes => {
-+ 'data-current-status' => $status,
-+ 'data-next-status' => $next,
-+ },
-+ );
-+ }
-+}
-+
- sub BuildAdminMenu {
- my $request_path = shift;
- my $top = shift;
3: c4a93c2 < --: ------- add asset display menu actions to ShowAssets template
5: b1d00fb ! 3: 59e85e6 pass %ARGS to BuildMainNav and BuildSelfServiceNav
@@ -42,6 +42,6 @@
- RT::Interface::Web::MenuBuilder::BuildSelfServiceNav( $request_path );
+ RT::Interface::Web::MenuBuilder::BuildSelfServiceNav( $request_path, %ARGS );
}
-
-
+ </%INIT>
+ <%ARGS>
10: d5d95f9 = 4: 214e52a replace repeated calls to HTML::Mason::Commands::Menu() with $top variable
11: ede0a8f = 5: 21e58a7 replace repeated calls to HTML::Mason::Commands::PageWidgets() with $widgets variable
12: d4eb9e9 ! 6: 3033fd3 replace repeated calls to $HTML::Mason::Commands::session{CurrentUser} with $current_user variable
@@ -215,18 +215,75 @@
HTML::Mason::Commands::PageMenu()->child( history => title => loc('History'), path => '/User/History.html?id=' . $HTML::Mason::Commands::DECODED_ARGS->{'id'} );
}
@@
-
- sub _BuildAssetMenu {
- my $page = HTML::Mason::Commands::PageMenu();
+ $HTML::Mason::Commands::m->callback( CallbackName => 'Privileged', Path => $request_path, CallbackPage => '/Elements/Tabs' );
+ }
+
++sub _BuildAssetMenu {
++ my $page = HTML::Mason::Commands::PageMenu();
+ my $current_user = $HTML::Mason::Commands::session{CurrentUser};
+
- my $id = $HTML::Mason::Commands::DECODED_ARGS->{id};
-- my $asset = RT::Asset->new( $HTML::Mason::Commands::session{CurrentUser} );
++ my $id = $HTML::Mason::Commands::DECODED_ARGS->{id};
+ my $asset = RT::Asset->new( $current_user );
- $asset->Load($id);
-
- if ($asset->id) {
-@@
++ $asset->Load($id);
++
++ if ($asset->id) {
++ $page->child("display", title => HTML::Mason::Commands::loc("Display"), path => "/Asset/Display.html?id=$id");
++ $page->child("history", title => HTML::Mason::Commands::loc("History"), path => "/Asset/History.html?id=$id");
++ $page->child("basics", title => HTML::Mason::Commands::loc("Basics"), path => "/Asset/Modify.html?id=$id");
++ $page->child("links", title => HTML::Mason::Commands::loc("Links"), path => "/Asset/ModifyLinks.html?id=$id");
++ $page->child("people", title => HTML::Mason::Commands::loc("People"), path => "/Asset/ModifyPeople.html?id=$id");
++ $page->child("dates", title => HTML::Mason::Commands::loc("Dates"), path => "/Asset/ModifyDates.html?id=$id");
++
++ for my $grouping (RT::CustomField->CustomGroupings($asset)) {
++ my $cfs = $asset->CustomFields;
++ $cfs->LimitToGrouping( $asset => $grouping );
++ next unless $cfs->Count;
++ $page->child(
++ "cf-grouping-$grouping",
++ title => HTML::Mason::Commands::loc($grouping),
++ path => "/Asset/ModifyCFs.html?id=$id;Grouping=" . $HTML::Mason::Commands::m->interp->apply_escapes($grouping, 'u'),
++ );
++ }
++
++ _BuildAssetMenuActionSubmenu($asset);
++ }
++}
++
++sub _BuildAssetMenuActionSubmenu {
++ my $asset = shift;
++
++ my $page = HTML::Mason::Commands::PageMenu();
++ my $id = $asset->id;
++
++ my $actions = $page->child("actions", title => HTML::Mason::Commands::loc("Actions"));
++ $actions->child("create-linked-ticket", title => HTML::Mason::Commands::loc("Create linked ticket"), path => "/Asset/CreateLinkedTicket.html?Asset=$id");
++
++ my $status = $asset->Status;
++ my $lifecycle = $asset->LifecycleObj;
++ for my $action ( $lifecycle->Actions($status) ) {
++ my $next = $action->{'to'};
++ next unless $lifecycle->IsTransition( $status => $next );
++
++ my $check = $lifecycle->CheckRight( $status => $next );
++ next unless $asset->CurrentUserHasRight($check);
++
++ my $label = $action->{'label'} || ucfirst($next);
++ $actions->child(
++ $label,
++ title => HTML::Mason::Commands::loc($label),
++ path => "/Asset/Modify.html?id=$id;Update=1;DisplayAfter=1;Status="
++ . $HTML::Mason::Commands::m->interp->apply_escapes($next, 'u'),
++
++ class => "asset-lifecycle-action",
++ attributes => {
++ 'data-current-status' => $status,
++ 'data-next-status' => $next,
++ },
++ );
++ }
++}
++
+ sub _BuildAdminMenu {
my $request_path = shift;
my $top = shift;
13: 581f1b2 = 7: af2fc0a replace repeated calls to HTML::Mason::Commands::PageMenu() with $page variable
--: ------- > 8: 9436557 define a new calling convention for menu building functions
4: 714afb2 ! 9: 792a952 add asset display menu actions to ShowAssets template
@@ -1,6 +1,6 @@
Author: Dustin Graves <dustin at bestpractical.com>
- style assets action menu on ShowAssets element
+ add asset display menu actions to ShowAssets template
diff --git a/share/html/Ticket/Elements/ShowAssets b/share/html/Ticket/Elements/ShowAssets
--- a/share/html/Ticket/Elements/ShowAssets
@@ -9,15 +9,15 @@
</%perl>
<a href="<% $delete_url %>" class="unlink-asset ui-icon ui-icon-circle-close" title="Unlink asset">X</a>
% }
--% HTML::Mason::Commands::PageMenu()->{children} = undef; # clear previous settings from page load
+
+%# show asset actions menu
-+% HTML::Mason::Commands::PageMenu()->{children} = undef; # clear previous settings from page load so we can show just the actions
- % RT::Interface::Web::MenuBuilder::_BuildAssetMenuActionSubmenu($asset);
--<& /Elements/Menu, menu => PageMenu(), id => 'asset-actions-menu', parent_id => 'asset' &>
-+<& /Elements/Menu, menu => PageMenu(), id => 'asset-'.$asset->id.'-actions-menu', parent_id => 'asset-'.$asset->id &>
++% my $request_path = $HTML::Mason::Commands::r->path_info;
++% $request_path =~ s!/{2,}!/!g;
++% my $page = RT::Interface::Web::Menu->new();
++% RT::Interface::Web::MenuBuilder::_BuildAssetMenuActionSubmenu( $request_path, Menu(), PageWidgets(), $page, Asset => $asset );
++<& /Elements/Menu, menu => $page, id => 'asset-'.$asset->id.'-actions-menu', parent_id => 'asset-'.$asset->id &>
+<script>
-+jQuery("#assets-accordion ul.toplevel").addClass('sf-menu sf-js-enabled sf-shadow').supersubs().superfish({ dropShadows: false, speed: 'fast' }).supposition()
++jQuery("#assets-accordion ul.toplevel").addClass('sf-menu sf-js-enabled sf-shadow').supersubs().superfish({ dropShadows: false, speed: 'fast', delay: 0 }).supposition()
+ .find('a').click(function(ev){
+ ev.stopPropagation();
+ return true;
@@ -64,4 +64,3 @@
+#assets-accordion .sf-sub-indicator {
+ top: .2em;
+}
-
6: 20f48e5 < --: ------- remove extra whitespace
7: e816d03 < --: ------- make BuildAdminMenu private function
8: 00a905f < --: ------- clarify legacy callbacks in RT::Interface::Web::MenuBuilder and pass CallbackPage
9: e89f308 < --: ------- add local "loc" function to remove HTML::Mason::Commands noise
14: 3561f38 < --: ------- define a new calling convention for menu building functions
15: 3b132df < --: ------- replace ugly hack with new RT::Interface::Web::Menu object now that we have our refactored menu functions
16: f88d770 < --: ------- remove hover delay on ShowAssets action menu
More information about the rt-commit
mailing list