[Rt-commit] rt branch, master, updated. rt-4.0.4-301-g3a41ae9

Alex Vandiver alexmv at bestpractical.com
Wed Dec 14 16:06:08 EST 2011


The branch, master has been updated
       via  3a41ae99b41363d217fd478bd4acccb6130c28b7 (commit)
       via  ce07e8493fb93dd84a64323a131adae0310482a5 (commit)
       via  f88d29d82e26f3147b8cf5abf18b970423f5bbe2 (commit)
       via  541dfd22e612f827678a09e1b575b854ac574680 (commit)
       via  89eda5ad22f4020b9bbbbccac467f9001e0545b8 (commit)
       via  63976d19a27b2cdef77c6e61211dc56b4ee8ed41 (commit)
       via  a716761bad146b172517b7ded646c2ee1e5a7613 (commit)
       via  922a37bed50e286b59f74f7f44cba6ddeb62e46a (commit)
       via  dafef110025e5b43f7c1bd0f492893ae700695cc (commit)
       via  91744eda7535b0489b7d302b5b6b69f5036d355c (commit)
       via  5814796c0661c4dd0310b003ef6062a55a866dca (commit)
       via  a2d30b4216da4e875b121fc14045d18cb2031e71 (commit)
       via  1241691ed4c3681e38422f14f7df89ca04937670 (commit)
       via  2dd79622a117a9662ee7d63834b720b54447de89 (commit)
       via  b822fe352ab56c6166657c98773abd2b85991f3d (commit)
       via  4f3fc78fe7cd3a2d465c52600dd04583acb015ff (commit)
       via  c75589acdac30becd9e3ce2ff3ae2340e3c7d526 (commit)
       via  08da9c77c0d2d27db49dd10ad02952b4eead1018 (commit)
       via  eb04675af9b9e713fc285c732994eaf9bee0130e (commit)
       via  a7f6eb4284a50f7ba4419a63ca752f0fafb1ee8f (commit)
       via  198efb029da28582431a952b224ad45e4e8efd5c (commit)
       via  b021c8a6668d52f1edd871b2b917449572910878 (commit)
       via  b8be666660ea3ef80747dbf219897872b953a7a3 (commit)
       via  9851f0a84c13796a88322559276498a8e8cd71ec (commit)
       via  0f216920bafe88e919d893bbb7eafbf3bc32890a (commit)
       via  d8024dc69f0470a3b9d3dc6aa4d18f2c5318811d (commit)
       via  5c86b1d1bb7440a52a2548455557a98c0ca2df63 (commit)
       via  94d3e288c36d2b0400cba6c80b5fa47e38d84212 (commit)
       via  5afc1f67202bdbaba9a9271cbefb950bdc6d176b (commit)
       via  b8a4a896b4edfa83fb1a5e218172e9f7927e5b48 (commit)
       via  0d3ad45c2611344e2ade8927f88703b08646cb4f (commit)
       via  6ab4af02fee6c327b4dd9b6bb6809a5aee6490ef (commit)
       via  7a161371f809d270bbc81ae8bd0cd57296cbb764 (commit)
       via  aebc304f73f79002d7ede6ed09f2cbbc546a823b (commit)
       via  1536c6df265bb46199645b94a789ca549bf21266 (commit)
       via  6f2a1b02a3d2fcae0b8785a1bac455e09def6c8d (commit)
       via  725e7ea41b233a0c5c0f85cf23d3a32e572445b4 (commit)
       via  910d12127a52c449e70d3488c58f0925dc632fc7 (commit)
       via  15b47b368cfc45293f5bdbaae16bca0da0f2830e (commit)
       via  67c28a740dbcd30042a120471bb6bfd6fc21de8d (commit)
       via  646befea128b612355a629d360c520a08c3e3814 (commit)
       via  967ed40c62c2a1d1800db35c986cb5671975a29c (commit)
       via  c8783479f7296df43dac6dbeb248c85f62bd960d (commit)
       via  e510687db67f8daaa5172f017e56d3a888247cda (commit)
       via  d0b32c9de9b724d42f58eac7cb6b2fbfc59e8999 (commit)
       via  6290e01758bcfe908b1f77d13b88e6c9fe092da2 (commit)
       via  4419e37bcac2a874195fb4de1ae994e16a2ecda5 (commit)
       via  db3497168ebe34f72955545cf5344bf11198c751 (commit)
       via  7cd86e0e991d84a9bb7cab36bdd6f3e4c3c29da5 (commit)
       via  32410db102e6d074951476cf4a19ae529a7e5ef6 (commit)
       via  89a4fe7245212d9850e3a5263640c9d190179f70 (commit)
       via  e620b6d18e67e58e06d5e10a2a27411d51f5519b (commit)
       via  ca11550c4e2d8125d4c1c29dc734a1edc1445ca6 (commit)
       via  6b0ce674c5ec51fd615f5125f063dfb3eba6661f (commit)
       via  8625fed37840aa7c9e577b2f761d8c7f4c3baedc (commit)
       via  da90158e41e91573715731fd04b3595486adb843 (commit)
       via  cf6d7c05d536e56e991fbe9f86f2ba2167e10f7b (commit)
       via  5b92928923ceefbdf63a974254eabb6d38b6a41e (commit)
       via  a8f48997534eba5509c57fabc884f62e1118ed29 (commit)
       via  d815ce80161efbde2e76a9448ae721ed7e8b4fdb (commit)
       via  60e8ff715195d452c9914b11cd66554594148a89 (commit)
       via  bb4db08d9b186cfa28a90665cd0777e14776cf0e (commit)
       via  7ad260abf441ad821b1e55a2189b999c97ce134a (commit)
       via  f05cec5a272d1f08cfc3335ae4713c154db5d0d7 (commit)
       via  bba9375660e80662a69e5cc8d56be51f2f617a6b (commit)
       via  7262d8e459cdcc18a7767db70b3d6b7cbd9ce1f2 (commit)
      from  2d233e0a0b21c1397ab08ff99130172676f53efa (commit)

Summary of changes:
 Makefile.in                                       |   14 +-
 docs/schema.dot                                   |   99 +++
 etc/RT_Config.pm.in                               |   15 +-
 lib/RT/Action/CreateTickets.pm                    |   24 +-
 lib/RT/Class.pm                                   |    6 +-
 lib/RT/Interface/Web.pm                           |   20 +
 lib/RT/Interface/Web/Menu.pm                      |    9 +-
 lib/RT/Search/Googleish.pm                        |    6 +-
 lib/RT/Test/Web.pm                                |   27 +
 sbin/rt-clean-sessions.in                         |    3 +-
 sbin/rt-validator.in                              |   56 +-
 share/html/Admin/Tools/Theme.html                 |    3 +-
 share/html/Dashboards/Render.html                 |    2 +-
 share/html/Elements/CollectionAsTable/ParseFormat |    1 +
 share/html/Elements/EditCustomFieldAutocomplete   |    2 +-
 share/html/Elements/Tabs                          |  705 +++++++++++---------
 share/html/Helpers/Autocomplete/CustomFieldValues |    4 +-
 share/html/Helpers/Autocomplete/Groups            |    4 +-
 share/html/Helpers/Autocomplete/Owners            |    4 +-
 share/html/Helpers/Autocomplete/Users             |    4 +-
 share/html/NoAuth/css/print.css                   |  146 ++++-
 share/html/Search/Elements/BuildFormatString      |    1 +
 share/html/Search/Simple.html                     |   29 +-
 share/html/Widgets/Form/Integer                   |    9 +-
 t/lifecycles/basics.t                             |   86 ++--
 t/lifecycles/unresolved-deps.t                    |   45 ++
 t/mail/dashboards.t                               |    2 +-
 t/ticket/googleish_search.t                       |    4 +-
 t/web/dashboards-in-menu.t                        |    6 +-
 t/web/offline.t                                   |   78 +++
 30 files changed, 959 insertions(+), 455 deletions(-)
 create mode 100755 docs/schema.dot
 create mode 100644 t/lifecycles/unresolved-deps.t
 create mode 100644 t/web/offline.t

- Log -----------------------------------------------------------------
commit 3a41ae99b41363d217fd478bd4acccb6130c28b7
Merge: 2d233e0 ce07e84
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 14 16:05:13 2011 -0500

    Merge branch '4.0-trunk'
    
    Conflicts:
    	share/html/Elements/Tabs

diff --cc share/html/Elements/Tabs
index 333a1ac,953e938..51441f9
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@@ -58,186 -58,178 +58,183 @@@ my $query_string = sub 
      return $u->query;
  };
  
- my $build_main_nav = sub {
- 
-     my $home = Menu->child( home => title => loc('Homepage'), path => '/' );
- 
-     unless ($session{'dashboards_in_menu'}) {
-         my $dashboards_in_menu = $session{CurrentUser}->UserObj->Preferences(
-             'DashboardsInMenu',
-             {},
+ my $build_admin_menu = sub {
+     my $top = shift;
+     my $admin = $top->child( config => title => loc('Configuration'), path => '/Admin/', sort_order => 99 );
+     if ( $session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'AdminUsers' ) ) {
+         my $users = $admin->child( users =>
+             title       => loc('Users'),
+             description => loc('Manage users and passwords'),
+             path        => '/Admin/Users/',
          );
- 
-         unless ($dashboards_in_menu->{dashboards}) {
-             my ($default_dashboards) =
-                 RT::System->new( $session{'CurrentUser'} )
-                     ->Attributes
-                     ->Named('DashboardsInMenu');
-             if ($default_dashboards) {
-                 $dashboards_in_menu = $default_dashboards->Content;
-             }
-         }
- 
-         $session{'dashboards_in_menu'} = $dashboards_in_menu->{dashboards} || [];
+         $users->child( select => title => loc('Select'), path => "/Admin/Users/" );
+         $users->child( create => title => loc('Create'), path => "/Admin/Users/Modify.html?Create=1" );
      }
-     
-     my @dashboards;
-     for my $id ( @{$session{'dashboards_in_menu'}} ) {
-         my $dash = RT::Dashboard->new( $session{CurrentUser} );
-         my ( $status, $msg ) = $dash->LoadById($id);
-         if ( $status ) {
-             push @dashboards, $dash;
-         }
-         else {
-             $RT::Logger->warning( "Failed to load dashboard $id: $msg" );
-         }
-     }
- 
-     my $dashes = Menu()->child('home');
-     if (@dashboards) {
-         for my $dash (@dashboards) {
-             $home->child( 'dashboard-' . $dash->id, title => $dash->Name,
-                        path => '/Dashboards/' . $dash->id . '/' . $dash->Name,);
-         }
- 
-     }
- 
-     $dashes->child(
-         edit => title => loc('Update This Menu'),
-         path => 'Prefs/DashboardsInMenu.html',
+     my $groups = $admin->child( groups =>
+         title       => loc('Groups'),
+         description => loc('Manage groups and group membership'),
+         path        => '/Admin/Groups/',
      );
+     $groups->child( select => title => loc('Select'), path => "/Admin/Groups/" );
+     $groups->child( create => title => loc('Create'), path => "/Admin/Groups/Modify.html?Create=1" );
  
-     $dashes->child( more => title => loc('All Dashboards'), path  => 'Dashboards/index.html' );
-     my $dashboard = RT::Dashboard->new( $session{CurrentUser} );
-     if ( $dashboard->CurrentUserCanCreateAny ) {
-         $dashes->child('dashboard_create' => title => loc('New Dashboard') => path => "/Dashboards/Modify.html?Create=1" );
+     my $queues = $admin->child( queues =>
+         title       => loc('Queues'),
+         description => loc('Manage queues and queue-specific properties'),
+         path        => '/Admin/Queues/',
+     );
+     $queues->child( select => title => loc('Select'), path => "/Admin/Queues/" );
+     $queues->child( create => title => loc('Create'), path => "/Admin/Queues/Modify.html?Create=1" );
+ 
+     if ( $session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'AdminCustomField' ) ) {
+         my $cfs = $admin->child( 'custom-fields' =>
+             title       => loc('Custom Fields'),
+             description => loc('Manage custom fields and custom field values'),
+             path        => '/Admin/CustomFields/',
+         );
+         $cfs->child( select => title => loc('Select'), path => "/Admin/CustomFields/" );
+         $cfs->child( create => title => loc('Create'), path => "/Admin/CustomFields/Modify.html?Create=1" );
      }
  
-     my $tickets = Menu->child( search => 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" );
- 
-     my $tools = Menu->child(  tools => title => loc('Tools'), path => '/Tools/index.html' );
- 
+     my $admin_global = $admin->child( global =>
+         title       => loc('Global'),
+         description => loc('Manage properties and configuration which apply to all queues'),
+         path        => '/Admin/Global/',
+     );
  
-     my $articles = $tools->child( articles => title => loc('Articles') => path => "/Articles/index.html");
-     $articles->child( articles => title => loc('Overview') => path => "/Articles/index.html" );
-     $articles->child( search   => title => loc('Search') => path => "/Articles/Article/Search.html" );
-     $articles->child( topics   => title => loc('Topics') => path => "/Articles/Topics.html" );
+     my $scrips = $admin_global->child( scrips =>
+         title       => loc('Scrips'),
+         description => loc('Modify scrips which apply to all queues'),
+         path        => '/Admin/Global/Scrips.html',
+     );
+     $scrips->child( select => title => loc('Select'), path => "/Admin/Global/Scrips.html" );
+     $scrips->child( create => title => loc('Create'), path => "/Admin/Global/Scrip.html?Create=1" );
  
+     my $templates = $admin_global->child( templates =>
+         title       => loc('Templates'),
+         description => loc('Edit system templates'),
+         path        => '/Admin/Global/Templates.html',
+     );
+     $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       => loc('Custom Fields'),
+         description => loc('Modify global custom fields'),
+         path        => '/Admin/Global/CustomFields/index.html',
+     );
+     $cfadmin->child( users =>
+         title       => loc('Users'),
+         description => loc('Select custom fields for all users'),
+         path        => '/Admin/Global/CustomFields/Users.html',
+     );
+     $cfadmin->child( groups =>
+         title       => loc('Groups'),
+         description => loc('Select custom fields for all user groups'),
+         path        => '/Admin/Global/CustomFields/Groups.html',
+     );
+     $cfadmin->child( queues =>
+         title       => loc('Queues'),
+         description => loc('Select custom fields for all queues'),
+         path        => '/Admin/Global/CustomFields/Queues.html',
+     );
+     $cfadmin->child( tickets =>
+         title       => loc('Tickets'),
+         description => loc('Select custom fields for tickets in all queues'),
+         path        => '/Admin/Global/CustomFields/Queue-Tickets.html',
+     );
+     $cfadmin->child( transactions =>
+         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       => loc('Articles'),
+         description => loc('Select Custom Fields for Articles in all Classes'),
+         path        => '/Admin/Global/CustomFields/Class-Article.html',
+     );
  
+     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       => loc('Select'),
+         description => loc('Modify and Create Classes'),
+         path        => '/Admin/Articles/Classes/',
+     );
+     $class_admin->child( create =>
+         title       => loc('Create'),
+         description => loc('Modify and Create Custom Fields for Articles'),
+         path        => '/Admin/Articles/Classes/Modify.html?Create=1',
+     );
  
-     $tools->child( my_day => title => loc('My Day'), path   => '/Tools/MyDay.html',
-                    description => loc('Easy updating of your open tickets') );
  
-     if ( RT->Config->Get('EnableReminders') )
-     {
-         $tools->child( my_reminders => title => loc('My Reminders'), path => '/Tools/MyReminders.html',
-                        description => loc('Easy viewing of your reminders') );
-     }
+     my $cfs = $article_admin->child( 'custom-fields' =>
+         title => loc('Custom Fields'),
+         path  => '/Admin/CustomFields/index.html?'.$m->comp('/Elements/QueryString', type => 'RT::Class-RT::Article'),
+     );
+     $cfs->child( select =>
+         title => loc('Select'),
+         path => '/Admin/CustomFields/index.html?'.$m->comp('/Elements/QueryString', type => 'RT::Class-RT::Article'),
+     );
+     $cfs->child( create =>
+         title => loc('Create'),
+         path => '/Admin/CustomFields/Modify.html?'.$m->comp("/Elements/QueryString", Create=>1, LookupType=> "RT::Class-RT::Article" ),
+     );
  
-     $tools->child( offline => title => loc('Offline'), path    => '/Tools/Offline.html',
-                    description => loc('Create tickets offline') );
+     $admin_global->child( 'group-rights' =>
+         title       => loc('Group Rights'),
+         description => loc('Modify global group rights'),
+         path        => '/Admin/Global/GroupRights.html',
+     );
+     $admin_global->child( 'user-rights' =>
+         title       => loc('User Rights'),
+         description => loc('Modify global user rights'),
+         path        => '/Admin/Global/UserRights.html',
+     );
+     $admin_global->child( 'my-rt' =>
+         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       => loc('Dashboards in menu'),
++        description => loc('Customize dashboards in menu'),
++        path        => '/Admin/Global/DashboardsInMenu.html',
++    );
+     $admin_global->child( 'topics' =>
+         title       => loc('Topics'),
+         description => loc('Modify global article topics'),
+         path        => '/Admin/Global/Topics.html',
+     );
  
-     if ( $session{'CurrentUser'}->HasRight( Right => 'ShowApprovalsTab', Object => RT->System ) )
-     {
-         $tools->child( approval => title => loc('Approval'), path     => '/Approvals/',
-                        description => loc('My Approvals') );
+     my $admin_tools = $admin->child( tools =>
+         title       => loc('Tools'),
+         description => loc('Use other RT administrative tools'),
+         path        => '/Admin/Tools/',
+     );
+     $admin_tools->child( configuration =>
+         title       => loc('System Configuration'),
+         description => loc('Detailed information about your RT setup'),
+         path        => '/Admin/Tools/Configuration.html',
+     );
+     $admin_tools->child( theme =>
+         title       => loc('Theme'),
+         description => loc('Customize the look of your RT'),
+         path        => '/Admin/Tools/Theme.html',
+     );
+     if (RT->Config->Get('StatementLog')
+         && $session{'CurrentUser'}->HasRight( Right => 'SuperUser', Object => RT->System )) {
+        $admin_tools->child( 'sql-queries' =>
+            title       => loc('SQL Queries'),
+            description => loc('Browse the SQL queries made in this process'),
+            path        => '/Admin/Tools/Queries.html',
+        );
      }
- 
- 
- my $build_admin_menu = sub {
-         my $admin = $tools->child( config => title => loc('Configuration'), path   => '/Admin/', sort_order => 99 );
-         if ( $session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'AdminUsers' ) ) {
-             my $users = $admin->child( users => title => loc('Users'), path => '/Admin/Users/', description => loc('Manage users and passwords') );
-             $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 => loc('Groups'), path => '/Admin/Groups/', description => loc('Manage groups and group membership') );
- 
-         $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 => loc('Queues'), path => '/Admin/Queues/', description => loc('Manage queues and queue-specific properties') );
-         $queues->child( select => title => loc('Select'), path => "/Admin/Queues/" );
-         $queues->child( create => title => loc('Create'), path => "/Admin/Queues/Modify.html?Create=1" );
- 
-         if ( $session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'AdminCustomField' ) ) {
-             my $cfs = $admin->child( 'custom-fields' => title => loc('Custom Fields'), path => '/Admin/CustomFields/', description => loc('Manage custom fields and custom field values') );
-             $cfs->child( select => title => loc('Select'), path   => "/Admin/CustomFields/" );
-             $cfs->child( create => title => loc('Create'), path => "/Admin/CustomFields/Modify.html?Create=1" );
-         }
- 
-         my $admin_global = $admin->child( global => title => loc('Global'), path   => '/Admin/Global/', description => loc('Manage properties and configuration which apply to all queues') );
- 
-         my $scrips = $admin_global->child( scrips => title => loc('Scrips'), path => '/Admin/Global/Scrips.html', description => loc('Modify scrips which apply to all queues') );
-         $scrips->child( select => title => loc('Select'), path => "/Admin/Global/Scrips.html" );
-         $scrips->child( create => title => loc('Create'), path => "/Admin/Global/Scrip.html?Create=1" );
-         my $templates = $admin_global->child( templates => title => loc('Templates'), path => '/Admin/Global/Templates.html', description => loc('Edit system templates') );
-         $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 => loc('Custom Fields'),
-                                             path => '/Admin/Global/CustomFields/index.html',
-                                             description => loc('Modify global custom fields') );
-         {
-             $cfadmin->child( users => title => loc('Users') => text => loc('Select custom fields for all users'),
-                              path => '/Admin/Global/CustomFields/Users.html');
- 
-             $cfadmin->child( groups => title => loc('Groups') => text => loc('Select custom fields for all user groups'),
-                           path => '/Admin/Global/CustomFields/Groups.html');
- 
-             $cfadmin->child( queues => title => loc('Queues') => text => loc('Select custom fields for all queues'),
-                              path => '/Admin/Global/CustomFields/Queues.html');
- 
-             $cfadmin->child( tickets => title => loc('Tickets') => text => loc('Select custom fields for tickets in all queues'),
-                     path => '/Admin/Global/CustomFields/Queue-Tickets.html');
- 
-             $cfadmin->child( transactions => title => loc('Ticket Transactions') => text =>
-                     loc( 'Select custom fields for transactions on tickets in all queues'),
-                 path => '/Admin/Global/CustomFields/Queue-Transactions.html');
-             $cfadmin->child( 'custom-fields' => title => loc('Articles') => text =>
-                     loc('Select Custom Fields for Articles in all Classes'),
-                     path => '/Admin/Global/CustomFields/Class-Article.html');
- 
-         }
- 
-         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 => loc('Select') => path => '/Admin/Articles/Classes/',
-                             description => 'Modify and Create Classes' );
-         $class_admin->child(create => title => loc('Create') => path => '/Admin/Articles/Classes/Modify.html?Create=1',
-                             description => 'Modify and Create Custom Fields for Articles' );
- 
- 
-         my $cfs = $article_admin->child( 'custom-fields' => title => loc('Custom Fields'), path => '/Admin/CustomFields/index.html?'.$m->comp('/Elements/QueryString', type => 'RT::Class-RT::Article') );
-         $cfs->child( select => title => loc('Select'), path => '/Admin/CustomFields/index.html?'.$m->comp('/Elements/QueryString', type => 'RT::Class-RT::Article') );
-         $cfs->child( create => title => loc('Create'), path => '/Admin/CustomFields/Modify.html?'.$m->comp("/Elements/QueryString", Create=>1, LookupType=> "RT::Class-RT::Article" ));
- 
-         $admin_global->child( 'group-rights' => title => loc('Group Rights'), path => '/Admin/Global/GroupRights.html',
-                               description => loc('Modify global group rights') );
-         $admin_global->child( 'user-rights' => title => loc('User Rights'), path => '/Admin/Global/UserRights.html',
-                               description => loc('Modify global user rights') );
-         $admin_global->child( 'my-rt' => title => loc('RT at a glance'), path => '/Admin/Global/MyRT.html',
-                               description => loc('Modify the default "RT at a glance" view') );
-         $admin_global->child( 'dashboards-in-menu' => title => loc('Dashboards in menu'), path => '/Admin/Global/DashboardsInMenu.html',
-                               description => loc('Customize dashboards in menu') );
-         $admin_global->child( 'topics' => title => loc('Topics'), path => '/Admin/Global/Topics.html',
-                               description => loc('Modify global article topics') );
- 
-         my $admin_tools = $admin->child( tools => title => loc('Tools'), path => '/Admin/Tools/', description => loc('Use other RT administrative tools') );
-         $admin_tools->child( configuration => title => loc('System Configuration'), path => '/Admin/Tools/Configuration.html',
-                              description => loc('Detailed information about your RT setup') );
-         $admin_tools->child( theme => title => loc('Theme'), path => '/Admin/Tools/Theme.html',
-                               description => loc('Customize the look of your RT') );
-         if (RT->Config->Get('StatementLog')
-             && $session{'CurrentUser'}->HasRight( Right => 'SuperUser', Object => RT->System )) {
-            $admin_tools->child( 'sql-queries' => title => loc('SQL Queries'), path => '/Admin/Tools/Queries.html',
-                                 description => loc('Browse the SQL queries made in this process') );
-         }
-         $admin_tools->child( shredder => title => loc('Shredder'), path => '/Admin/Tools/Shredder',
-                              description => loc('Permanently wipeout data from RT'));
+     $admin_tools->child( shredder =>
+         title       => loc('Shredder'),
+         description => loc('Permanently wipeout data from RT'),
+         path        => '/Admin/Tools/Shredder',
+     );
  
      if ( $request_path =~ m{^/Admin/(Queues|Users|Groups|CustomFields)} ) {
          my $type = $1;
@@@ -314,16 -298,14 +303,18 @@@
              my $id = $m->request_args->{'id'};
              my $obj = RT::User->new( $session{'CurrentUser'} );
              $obj->Load($id);
-             my $tabs = PageMenu();
-             $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 => loc('Dashboards in menu'),
-                     path => '/Admin/Users/DashboardsInMenu.html?id=' . $id );
  
+             my $tabs = PageMenu();
+             $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 => loc('Dashboards in menu'),
++                path  => '/Admin/Users/DashboardsInMenu.html?id=' . $id,
++            );
              if ( RT->Config->Get('GnuPG')->{'enable'} ) {
-                 $tabs->child( pgp => title => loc('GnuPG'), path => "/Admin/Users/GnuPG.html?id=" . $id );
+                 $tabs->child( pgp     => title => loc('GnuPG'),          path => "/Admin/Users/GnuPG.html?id=" . $id );
              }
          }
  
@@@ -348,18 -331,13 +340,15 @@@
              my $id = $m->request_args->{'id'};
              my $obj = RT::CustomField->new( $session{'CurrentUser'} );
              $obj->Load($id);
-             my $tabs = PageMenu();
- 
-             $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 );
  
+             my $tabs = PageMenu();
 -            $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 );
 -            $tabs->child( 'applies-to'   => title => loc('Applies to'),   path => "/Admin/CustomFields/Objects.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->LookupType =~ /^RT::(?:User|Group)$/ ) {
-                 $tabs->child( 'applies-to' => title => 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 );
 +            }
- 
          }
- 
      }
  
      if ( $request_path =~ m{^/Admin/Global/(Scrip|Template)s?\.html} ) {
@@@ -400,20 -370,86 +381,102 @@@
          } else {
              $tabs->child( select => title => loc('Select'), path => "/Admin/Articles/Classes/" );
              $tabs->child( create => title => loc('Create'), path => "/Admin/Articles/Classes/Modify.html?Create=1" );
+         }
+     }
+ };
+ 
 -
+ my $build_main_nav = sub {
+ 
+     my $home = Menu->child( home => title => loc('Homepage'), path => '/' );
 -    # We explicitly exclude superusers; otherwise the dashboards for
 -    # groups you're not in (but can see the dashboards of by dint of
 -    # being a superuser) would push the useful ones from the groups
 -    # you're actually in off of the stack.
 -    my @dashboards = $m->comp("/Dashboards/Elements/ListOfDashboards", IncludeSuperuserGroups => 0);
 -    my $limit      = 7;
 -
 -    my $more = 0;
 -    if ( @dashboards > $limit ) {
 -        $more = 1;
 -        splice @dashboards, $limit;
++    unless ($session{'dashboards_in_menu'}) {
++        my $dashboards_in_menu = $session{CurrentUser}->UserObj->Preferences(
++            'DashboardsInMenu',
++            {},
++        );
 +
++        unless ($dashboards_in_menu->{dashboards}) {
++            my ($default_dashboards) =
++                RT::System->new( $session{'CurrentUser'} )
++                    ->Attributes
++                    ->Named('DashboardsInMenu');
++            if ($default_dashboards) {
++                $dashboards_in_menu = $default_dashboards->Content;
++            }
 +        }
++
++        $session{'dashboards_in_menu'} = $dashboards_in_menu->{dashboards} || [];
 +    }
 +
-     };
++    my @dashboards;
++    for my $id ( @{$session{'dashboards_in_menu'}} ) {
++        my $dash = RT::Dashboard->new( $session{CurrentUser} );
++        my ( $status, $msg ) = $dash->LoadById($id);
++        if ( $status ) {
++            push @dashboards, $dash;
++        } else {
++            $RT::Logger->warning( "Failed to load dashboard $id: $msg" );
++        }
+     }
+ 
+     my $dashes = Menu()->child('home');
+     if (@dashboards) {
+         for my $dash (@dashboards) {
+             $home->child( 'dashboard-' . $dash->id,
+                 title => $dash->Name,
+                 path  => '/Dashboards/' . $dash->id . '/' . $dash->Name
+             );
+         }
 -
 -        $dashes->child( more => title => 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( $session{CurrentUser} );
+     if ( $dashboard->CurrentUserCanCreateAny ) {
+         $dashes->child('dashboard_create' => title => loc('New Dashboard'), path => "/Dashboards/Modify.html?Create=1" );
+     }
  
+     my $tickets = Menu->child( search => 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" );
  
-     if ( $session{'CurrentUser'}->HasRight( Right => 'ShowConfigTab', Object => RT->System ) )
-     {
-         $build_admin_menu->();
+ 
+     my $tools = Menu->child( tools => title => loc('Tools'), path => '/Tools/index.html' );
+     my $articles = $tools->child( articles => title => loc('Articles'), path => "/Articles/index.html");
+     $articles->child( articles => title => loc('Overview'), path => "/Articles/index.html" );
+     $articles->child( search   => title => loc('Search'),   path => "/Articles/Article/Search.html" );
+     $articles->child( topics   => title => loc('Topics'),   path => "/Articles/Topics.html" );
+ 
+     $tools->child( my_day =>
+         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       => loc('My Reminders'),
+             description => loc('Easy viewing of your reminders'),
+             path        => '/Tools/MyReminders.html',
+         );
      }
  
+     $tools->child( offline =>
+         title       => loc('Offline'),
+         description => loc('Create tickets offline'),
+         path        => '/Tools/Offline.html',
+     );
  
+     if ( $session{'CurrentUser'}->HasRight( Right => 'ShowApprovalsTab', Object => RT->System ) ) {
+         $tools->child( approval =>
+             title       => loc('Approval'),
+             description => loc('My Approvals'),
+             path        => '/Approvals/',
+         );
+     }
  
+     if ( $session{'CurrentUser'}->HasRight( Right => 'ShowConfigTab', Object => RT->System ) )
+     {
+         $build_admin_menu->($tools);
+     }
  
      my $username = '<span class="current-user">'
                   . $m->interp->apply_escapes($session{'CurrentUser'}->Name, 'h')
@@@ -426,15 -462,13 +489,17 @@@
  
  
      if ( $session{'CurrentUser'}->UserObj
-          && $session{'CurrentUser'}->HasRight( Right  => 'ModifySelf', Object => RT->System )) {
-         my $settings = $about_me->child( settings => title => loc('Settings'), path => '/Prefs/Other.html', );
-         $settings->child( options => title => loc('Options'), path     => '/Prefs/Other.html', );
-         $settings->child( about_me => title => loc('About me'), path     => '/User/Prefs.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 => loc('Dashboards in menu'),
-                     path => '/Prefs/DashboardsInMenu.html' );
-         $settings->child( quicksearch => title => loc('Quick search'), path => '/Prefs/Quicksearch.html');
+          && $session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => RT->System )) {
+         my $settings = $about_me->child( settings => title => loc('Settings'), path => '/Prefs/Other.html' );
+         $settings->child( options        => title => loc('Options'),        path => '/Prefs/Other.html' );
+         $settings->child( about_me       => title => loc('About me'),       path => '/User/Prefs.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 => loc('Dashboards in menu'),
++            path  => '/Prefs/DashboardsInMenu.html',
++        );
+         $settings->child( quicksearch    => title => loc('Quick search'),   path => '/Prefs/Quicksearch.html' );
  
          my $search_menu = $settings->child( 'saved-searches' => title => loc('Saved Searches') );
          my $searches = [ $m->comp( "/Search/Elements/SearchesForObject",
diff --cc t/web/dashboards-in-menu.t
index d33c31c,0000000..3126d55
mode 100644,000000..100644
--- a/t/web/dashboards-in-menu.t
+++ b/t/web/dashboards-in-menu.t
@@@ -1,85 -1,0 +1,85 @@@
 +use strict;
 +use warnings;
 +
 +use RT::Test tests => 31;
 +my ($baseurl, $m) = RT::Test->started_ok;
 +
 +my $system_foo = RT::Dashboard->new($RT::SystemUser);
 +$system_foo->Save(
 +    Name    => 'system foo',
 +    Privacy => 'RT::System-' . $RT::System->id,
 +);
 +
 +my $system_bar = RT::Dashboard->new($RT::SystemUser);
 +$system_bar->Save(
 +    Name    => 'system bar',
 +    Privacy => 'RT::System-' . $RT::System->id,
 +);
 +
 +ok( $m->login(), "logged in" );
 +
 +diag "global setting";
 +# in case "RT at a glance" contains dashboards stuff.
 +$m->get_ok( $baseurl . "/Search/Simple.html" );
 +ok( !$m->find_link( text => 'system foo' ), 'no system foo link' );
 +$m->get_ok( $baseurl."/Admin/Global/DashboardsInMenu.html");
 +
 +my $form_name = 'SelectionBox-dashboards_in_menu';
 +$m->form_name($form_name);
 +
 +$m->field('dashboards_in_menu-Available' => [$system_foo->id],);
 +$m->click_button(name => 'add');
 +$m->content_contains('Global dashboards in menu saved.', 'saved');
 +
 +$m->logout;
 +ok( $m->login(), "relogged in" );
 +
 +$m->get_ok( $baseurl . "/Search/Simple.html" );
 +$m->follow_link_ok( { text => 'system foo' }, 'follow system foo link' );
- $m->title_is( 'Dashboard system foo', 'got system foo dashboard page' );
++$m->title_is( 'system foo Dashboard', 'got system foo dashboard page' );
 +
 +diag "setting in admin users";
 +my $root = RT::CurrentUser->new( $RT::SystemUser );
 +ok( $root->Load('root') );
 +my $self_foo = RT::Dashboard->new($root);
 +$self_foo->Save( Name => 'self foo', Privacy => 'RT::User-' . $root->id );
 +my $self_bar = RT::Dashboard->new($root);
 +$self_bar->Save( Name => 'self bar', Privacy => 'RT::User-' . $root->id );
 +
 +ok( !$m->find_link( text => 'self foo' ), 'no self foo link' );
 +$m->get_ok( $baseurl."/Admin/Users/DashboardsInMenu.html?id=" . $root->id);
 +$m->form_name($form_name);
 +$m->field('dashboards_in_menu-Available' => [$self_foo->id]);
 +$m->click_button(name => 'add');
 +$m->content_contains( 'Preferences saved for dashboards in menu.',
 +    'prefs saved' );
 +$m->form_name($form_name);
 +$m->field('dashboards_in_menu-Selected' => [$system_foo->id]);
 +$m->content_contains( 'Preferences saved for dashboards in menu.',
 +    'prefs saved' );
 +$m->click_button(name => 'remove');
 +
 +$m->logout;
 +ok( $m->login(), "relogged in" );
 +$m->get_ok( $baseurl . "/Search/Simple.html" );
 +ok( !$m->find_link( text => 'system foo' ), 'no system foo link' );
 +$m->follow_link_ok( { text => 'self foo' }, 'follow self foo link' );
- $m->title_is( 'Dashboard self foo', 'got self foo dashboard page' );
++$m->title_is( 'self foo Dashboard', 'got self foo dashboard page' );
 +
 +diag "setting in prefs";
 +$m->get_ok( $baseurl."/Prefs/DashboardsInMenu.html");
 +$m->form_name($form_name);
 +$m->field('dashboards_in_menu-Available' => [$self_bar->id]);
 +$m->click_button(name => 'add');
 +$m->content_contains( 'Preferences saved for dashboards in menu.',
 +    'prefs saved' );
 +$m->follow_link_ok( { text => 'self bar' }, 'follow self bar link' );
- $m->title_is( 'Dashboard self bar', 'got self bar dashboard page' );
++$m->title_is( 'self bar Dashboard', 'got self bar dashboard page' );
 +$m->get_ok( $baseurl."/Prefs/DashboardsInMenu.html");
 +$m->form_with_fields('Reset');
 +$m->click;
 +$m->content_contains( 'Preferences saved', 'prefs saved' );
 +ok( $m->find_link( text => 'system foo' ), 'got system foo link' );
 +ok( !$m->find_link( text => 'self foo' ), 'no self foo link' );
 +ok( !$m->find_link( text => 'self bar' ), 'no self bar link' );
 +

-----------------------------------------------------------------------


More information about the Rt-commit mailing list