[Rt-commit] r6562 - in rt/branches/3.6-RELEASE: . html/Admin/Global

jesse at bestpractical.com jesse at bestpractical.com
Fri Dec 1 13:53:44 EST 2006


Author: jesse
Date: Fri Dec  1 13:53:42 2006
New Revision: 6562

Added:
   rt/branches/3.6-RELEASE/html/Admin/Global/MyRT.html
Modified:
   rt/branches/3.6-RELEASE/   (props changed)
   rt/branches/3.6-RELEASE/html/Admin/Elements/SystemTabs

Log:
 r45286 at pinglin (orig r6496):  clkao | 2006-11-22 06:17:20 -0500
 Global/Admin/MyRT.html for configure global myrt.


Modified: rt/branches/3.6-RELEASE/html/Admin/Elements/SystemTabs
==============================================================================
--- rt/branches/3.6-RELEASE/html/Admin/Elements/SystemTabs	(original)
+++ rt/branches/3.6-RELEASE/html/Admin/Elements/SystemTabs	Fri Dec  1 13:53:42 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-RELEASE/html/Admin/Global/MyRT.html
==============================================================================
--- (empty file)
+++ rt/branches/3.6-RELEASE/html/Admin/Global/MyRT.html	Fri Dec  1 13:53:42 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