<& /Admin/Elements/Header, Title => loc("RT at a glance") &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/MyRT.html', Title => loc("RT at a glance"), &> <& /Widgets/SelectionBox:header, nojs => 1 &> <& /Elements/ListActions, actions => \@actions &>
% for my $pane (@panes) { <&|/Widgets/TitleBox, title => loc('RT at a glance').': '.loc($pane->{Name}), bodyclass => "" &> <& /Widgets/SelectionBox:show, self => $pane, nojs => 1 &>
% } <%init> my @actions; my @items = map { [ "component-$_", $_ ] } sort @{$RT::HomepageComponents}; my $sys = RT::System->new( $session{'CurrentUser'} ); # XXX: put this in savedsearches_to_portlet_items for ( $m->comp( "/Search/Elements/SearchesForObject", Object => $sys )) { my ( $desc, $search ) = @$_; my $SearchType = $search->Content->{'SearchType'} || 'Ticket'; if ( $SearchType eq 'Ticket' ) { push @items, [ "system-$desc", $desc ]; } else { my $oid = ref($sys) . '-' . $sys->Id . '-SavedSearch-' . $search->Id; my $type = ( $SearchType eq 'Ticket' ) ? 'Saved Search' : $SearchType; # loc push @items, [ "saved-$oid", loc($type) . ": $desc" ]; } } my ($default_portlets) = $sys->Attributes->Named('HomepageSettings'); my @panes = $m->comp( '/Admin/Elements/ConfigureMyRT', panes => ['body', 'summary'], Action => 'MyRT.html', items => \@items, current_portlets => $default_portlets->Content, OnSave => sub { my ( $conf, $pane ) = @_; $default_portlets->SetContent( $conf ); push @actions, loc( 'Global portlet [_1] saved.', $pane ); } ); $m->comp( '/Widgets/SelectionBox:process', %ARGS, self => $_, nojs => 1 ) for @panes;