Alister West

home is where your code is ...

RT-at-a-Glance by Group

h3. Step 1: Create dashboards for groups

  • Use the web-interface.
  • Make sure you can see the appropriate dashboard when you are logged in.

h3. Step 2: Create a MyDash Element.

  • Copy rt3/share/html/Dashboard/Render.html -> rt3/local/html/Dashboard/Elements/MyDash
  • Strip out the tabs and header elements in MyDash

h3. Step 3: Update index.html to choose a dashboard.

# rt3/local/html/index.html
<%perl>   
#
# Dashboards to override RT-at-a-glance so we can have dashboards by group
# 
# Grab all possible user-can-see dashboards,
# put them into some sort of order
# choose the first one and make that the homepage.
#
    use RT::Dashboard;
    my $dashboards =
        $m->comp("/Dashboards/Elements/DashboardsForObjects");

    my @personal_dashboards = sort { $a->Id <=> $b->Id } 
                                @{ $dashboards->{personal} || [] };
    my @approvers_dashboards = sort { $a->Id <=> $b->Id }
                                @{ $dashboards->{group}{Approvers} || [] };
    my @support_dashboards = sort { $a->Id <=> $b->Id }
                                @{ $dashboards->{group}{Support} || [] };
    my @system_dashboards = sort { $a->Id <=> $b->Id } 
                                @{ $dashboards->{system} || [] };

    # Dashboards in preference order.
    my @dashboard_ids = map { $_->Id } (
        @personal_dashboards, @approvers_dashboards,
        @support_dashboards,  @system_dashboards
    );
</%perl>

%# Make the first Dashboard the homepage.
% if (@dashboard_ids) {
        <& /Dashboards/Elements/MyDash, id => shift(@dashboard_ids) &>
% } else { 
        <& /Elements/MyRT &>
% }
By Alister West