[Rt-commit] r6496 - in
rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Admin: Global
clkao at bestpractical.com
clkao at bestpractical.com
Wed Nov 22 06:17:22 EST 2006
Author: clkao
Date: Wed Nov 22 06:17:20 2006
New Revision: 6496
Added:
rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Admin/Global/MyRT.html
Modified:
rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Admin/Elements/SystemTabs
Log:
Global/Admin/MyRT.html for configure global myrt.
Modified: rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Admin/Elements/SystemTabs
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Admin/Elements/SystemTabs (original)
+++ rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Admin/Elements/SystemTabs Wed Nov 22 06:17:20 2006
@@ -67,7 +67,10 @@
},
H => { title => loc('User Rights'),
path => 'Admin/Global/UserRights.html',
- }
+ },
+ I => { title => loc('RT at a glance'),
+ path => 'Admin/Global/MyRT.html',
+ },
};
Added: rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Admin/Global/MyRT.html
==============================================================================
--- (empty file)
+++ rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Admin/Global/MyRT.html Wed Nov 22 06:17:20 2006
@@ -0,0 +1,57 @@
+<& /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 &>
+<br />
+% for my $pane (@panes) {
+<&|/Widgets/TitleBox, title => loc('RT at a glance').': '.loc($pane->{Name}), bodyclass => "" &>
+<& /Widgets/SelectionBox:show, self => $pane, nojs => 1 &></&>
+<br />
+% }
+<%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;
+
+
+</%init>
+
More information about the Rt-commit
mailing list