[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-980-ge84ec1c

Jesse Vincent jesse at bestpractical.com
Tue Dec 21 14:28:34 EST 2010


The branch, 3.9-trunk has been updated
       via  e84ec1c2327fada4098f6a69cd1492d7ac0e8198 (commit)
       via  a3b14f9764567cde477e727515353567a20dfac1 (commit)
       via  0f5bea79a7cac35b4b32ad5902f90154e9c6dd20 (commit)
       via  e43d875dddc0649962f327c288e9e6a0ee96d2ac (commit)
       via  53b49d1275dc8a74f96da90bf0044f61e00c539a (commit)
       via  f5286d08579619f07d6fa927eef175535b07fdbe (commit)
       via  4cac51a6eac58760d03dc74d8ce05adf4c303457 (commit)
       via  47fdd039da29e48e948e428b113f0bf1c630728f (commit)
      from  e5e762ace8129bc9de7515ce3763d7faded779e6 (commit)

Summary of changes:
 share/html/Elements/CreateTicket              |    5 +
 share/html/Elements/ListMenu                  |    7 -
 share/html/Elements/Tabs                      |  173 +++++++++++++------------
 share/html/Tools/Reports/CreatedByDates.html  |   94 -------------
 share/html/Tools/Reports/ResolvedByDates.html |   95 --------------
 share/html/Tools/Reports/ResolvedByOwner.html |   70 ----------
 share/html/Tools/Reports/index.html           |   76 -----------
 t/web/walk.t                                  |    4 +-
 8 files changed, 100 insertions(+), 424 deletions(-)
 delete mode 100644 share/html/Tools/Reports/CreatedByDates.html
 delete mode 100644 share/html/Tools/Reports/ResolvedByDates.html
 delete mode 100644 share/html/Tools/Reports/ResolvedByOwner.html
 delete mode 100644 share/html/Tools/Reports/index.html

- Log -----------------------------------------------------------------
commit 47fdd039da29e48e948e428b113f0bf1c630728f
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Dec 21 13:19:17 2010 -0500

    Remove the submenus from the ListMenu display component. They were way
    too cluttering

diff --git a/share/html/Elements/ListMenu b/share/html/Elements/ListMenu
index ed1cffa..891ee78 100644
--- a/share/html/Elements/ListMenu
+++ b/share/html/Elements/ListMenu
@@ -54,13 +54,6 @@ $menu
 % if ( my $description = $child->description ) {
 <span class="description"><% $description %></span>\
 % }
-% if ( $child->has_children ) {
-<ul>
-% for my $grand ($child->children) {
-<li><% $show_link->( $grand ) |n %></li>
-% }
-</ul>
-% }
 </li>
 % }
 </ul>

commit 4cac51a6eac58760d03dc74d8ce05adf4c303457
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Dec 21 13:22:08 2010 -0500

    Remove the embarassingly outdated "Reports" menus. We have much better
    built in reporting today.  The menu will be resurrected when we have
    something useful to put under the tab

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 045e77b..06a780a 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -99,15 +99,6 @@ if ( $request_path !~ m{^/SelfService/} ) {
     $articles->child( articles => title => loc('Articles') => path => "/Articles/index.html" );
     $articles->child( topics   => title => loc('Topics') => path => "/Articles/Topics.html" );
 
-    my $reports = $tools->child( reports => title => loc('Reports'), path => '/Tools/Reports/index.html', sort_order => 4,
-                                 description => loc('Various RT reports') );
-    $reports->child( loc('Resolved by owner'), path => '/Tools/Reports/ResolvedByOwner.html',
-        description => loc('Examine tickets resolved in a queue, grouped by owner'), );
-    $reports->child( loc('Resolved in date range'), path => '/Tools/Reports/ResolvedByDates.html',
-        description => loc('Examine tickets resolved in a queue between two dates'), );
-    $reports->child( loc('Created in a date range'), path => '/Tools/Reports/CreatedByDates.html',
-        description => loc('Examine tickets created in a queue between two dates'), );
-
     $tools->child( my_day => title => loc('My Day'), path   => '/Tools/MyDay.html', sort_order => 5,
                    description => loc('Easy updating of your open tickets') );
 
diff --git a/share/html/Tools/Reports/CreatedByDates.html b/share/html/Tools/Reports/CreatedByDates.html
deleted file mode 100644
index 3b446a2..0000000
--- a/share/html/Tools/Reports/CreatedByDates.html
+++ /dev/null
@@ -1,94 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-%#                                          <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<%args>
-$Queue => undef
-$CreatedBefore => undef
-$CreatedAfter => undef
-</%args>
-<%init>
-my $title = loc("Created tickets in period, grouped by status");
-my $q = RT::Queue->new($session{'CurrentUser'});
-my $before = RT::Date->new($session{'CurrentUser'});
-my $after = RT::Date->new($session{'CurrentUser'});
-my $query = 'Status != "deleted" ';
-
-
-if ($CreatedAfter) {
-    $after->Set(Format => 'unknown', Value => $CreatedAfter);
-    $CreatedAfter = $after->AsString;
-}
-if ($CreatedBefore) {
-    $before->Set(Format => 'unknown', Value => $CreatedBefore);
-    $CreatedBefore = $before->AsString;
-}
-
-
-$q->LoadByCols(Name => $Queue);
-</%init>
-<& /Elements/Header, Title => $title &>
-<& /Elements/Tabs &>
-<form method="post" action="CreatedByDates.html">
-% if ($Queue|| $CreatedBefore ||$CreatedAfter) {
-% # if we have a queue, do the search
-% if ($Queue) { $query .= " AND Queue = '$Queue'"}
-% if ($CreatedBefore) { $query .= " AND Created < '".$before->ISO(Timezone => 'user') ."'"; }
-% if ($CreatedAfter) { $query .= " AND Created > '".$after->ISO(Timezone => 'user')."'"}
-% my $groupby = 'Status';
-<& /Search/Elements/Chart, Query => $query, PrimaryGroupBy => $groupby &>
-% }
-
-<hr />
-
-<br /><&|/l&>Queue</&>: <& /Elements/SelectQueue, Name => 'Queue', NamedValues => 1, Default => $q->id &>
-<br /><&|/l&>Tickets created after</&>: 
-<& /Elements/SelectDate, Name => 'CreatedAfter', Default => ($CreatedAfter) ?  $after->ISO(Timezone => 'user') : ''&>
-<br /><&|/l&>Tickets created before</&>: 
-<& /Elements/SelectDate, Name => 'CreatedBefore', Default => ($CreatedBefore) ? $before->ISO(Timezone => 'user') : ''&>
-
-<& /Elements/Submit&>
-</form>
diff --git a/share/html/Tools/Reports/ResolvedByDates.html b/share/html/Tools/Reports/ResolvedByDates.html
deleted file mode 100644
index 2c9e992..0000000
--- a/share/html/Tools/Reports/ResolvedByDates.html
+++ /dev/null
@@ -1,95 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-%#                                          <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<%args>
-$Queue => undef
-$ResolvedBefore => undef
-$ResolvedAfter => undef
-</%args>
-<%init>
-my $title = loc("Resolved tickets in period, grouped by owner");
-my $q = RT::Queue->new($session{'CurrentUser'});
-my $before = RT::Date->new($session{'CurrentUser'});
-my $after = RT::Date->new($session{'CurrentUser'});
-my $query = '';
-
-
-if ($ResolvedAfter) {
-    $after->Set(Format => 'unknown', Value => $ResolvedAfter);
-    $ResolvedAfter = $after->AsString;
-}
-if ($ResolvedBefore) {
-    $before->Set(Format => 'unknown', Value => $ResolvedBefore);
-    $ResolvedBefore = $before->AsString;
-}
-
-
-$q->LoadByCols(Name => $Queue);
-</%init>
-<& /Elements/Header, Title => $title &>
-<& /Elements/Tabs &>
-<form method="post" action="ResolvedByDates.html">
-% if ($Queue|| $ResolvedBefore ||$ResolvedAfter) {
-% # if we have a queue, do the search
-% $query = "Status = 'resolved'";
-% if ($Queue) { $query .= " AND Queue = '$Queue'"}
-% if ($ResolvedBefore) { $query .= " AND Resolved < '".$before->ISO(Timezone => 'user')."'"; }
-% if ($ResolvedAfter) { $query .= " AND Resolved > '".$after->ISO(Timezone => 'user')."'"}
-% my $groupby = 'Owner';
-<& /Search/Elements/Chart, Query => $query, PrimaryGroupBy => $groupby &>
-% }
-
-<hr />
-
-<br /><&|/l&>Queue</&>: <& /Elements/SelectQueue, Name => 'Queue', NamedValues => 1, Default => $q->id &>
-<br /><&|/l&>Tickets resolved after</&>: 
-<& /Elements/SelectDate, Name => 'ResolvedAfter', Default => ($ResolvedAfter) ? $after->ISO(Timezone => 'user') : ''&>
-<br /><&|/l&>Tickets resolved before</&>: 
-<& /Elements/SelectDate, Name => 'ResolvedBefore', Default => ($ResolvedBefore) ? $before->ISO(Timezone => 'user') : ''&>
-
-<& /Elements/Submit&>
-</form>
diff --git a/share/html/Tools/Reports/ResolvedByOwner.html b/share/html/Tools/Reports/ResolvedByOwner.html
deleted file mode 100644
index 77447ab..0000000
--- a/share/html/Tools/Reports/ResolvedByOwner.html
+++ /dev/null
@@ -1,70 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-%#                                          <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<%args>
-$Queue => undef
-</%args>
-<%init>
-my $title = loc("Resolved tickets, grouped by owner");
-my $q = RT::Queue->new($session{'CurrentUser'});
-$q->LoadByCols(Name => $Queue);
-</%init>
-<& /Elements/Header, Title => $title &>
-<& /Elements/Tabs &>
-<form method="post" action="ResolvedByOwner.html">
-% if ($Queue) {
-% # if we have a queue, do the search
-% my $query = "Status = 'resolved' AND Queue = '$Queue'";
-% my $groupby = 'Owner';
-<& /Search/Elements/Chart, Query => $query, PrimaryGroupBy => $groupby &>
-% }
-
-<hr />
-
-<&|/l&>Queue</&>: <& /Elements/SelectQueue, Name => 'Queue', NamedValues => 1, Default => $q->id &>
-<& /Elements/Submit&>
-</form>
diff --git a/share/html/Tools/Reports/index.html b/share/html/Tools/Reports/index.html
deleted file mode 100644
index 4075263..0000000
--- a/share/html/Tools/Reports/index.html
+++ /dev/null
@@ -1,76 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-%#                                          <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<& /Elements/Header, Title => loc('Reports') &>
-<& /Elements/Tabs &>
-<& /Elements/ListMenu, menu => Menu()->child('tools')->child('reports') &>
-
-% $m->callback;
-
-<%init>
-
-my $tabs = {
-    A => {
-        title       => loc('Resolved by owner'),
-        path        => '/Tools/Reports/ResolvedByOwner.html',
-        description => loc('Examine tickets resolved in a queue, grouped by owner'),
-    },
-    B => {
-        title       => loc('Resolved in date range'),
-        path        => '/Tools/Reports/ResolvedByDates.html',
-        description => loc('Examine tickets resolved in a queue between two dates'),
-    },
-    C => {
-        title       => loc('Created in a date range'),
-        path        => '/Tools/Reports/CreatedByDates.html',
-        description => loc('Examine tickets created in a queue between two dates'),
-    },
-};
-
-$m->callback( CallbackName => 'ListReports', %ARGS, tabs => $tabs );
-
-</%init>
diff --git a/t/web/walk.t b/t/web/walk.t
index 2699daa..1986ed1 100644
--- a/t/web/walk.t
+++ b/t/web/walk.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 94;
+use RT::Test tests => 93;
 
 my ( $baseurl, $m ) = RT::Test->started_ok;
 
@@ -33,7 +33,7 @@ diag 'walk into /Tools' if $ENV{TEST_VERBOSE};
     $m->get_ok( $baseurl, 'homepage' );
     $m->follow_link_ok( { text => 'Tools' }, '-> Tools' );
 
-    for my $tab ( 'Dashboards', 'Offline', 'Reports', 'My Day' )
+    for my $tab ( 'Dashboards', 'Offline', 'My Day' )
     {
 
         $m->follow_link_ok( { text => $tab }, "-> $tab" );

commit f5286d08579619f07d6fa927eef175535b07fdbe
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Dec 21 13:49:11 2010 -0500

    Slight cleanup to tools menu

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 06a780a..12e2db0 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -86,34 +86,39 @@ if ( $request_path !~ m{^/SelfService/} ) {
     $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 $dashes = $tools->child( dashboards => title => loc('Dashboards'), path => '/Dashboards/index.html', sort_order => 2,
-                                description => loc('Named, shared collection of portlets') );
+
+
+    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 $dashes = $tools->child( dashboards => title => loc('Dashboards'), path => '/Dashboards/index.html',
+                                description => loc('Custom reports online and by email') );
     $dashes->child( select => title => loc('Select'), path => "/Dashboards/index.html" );
     my $dashboard = RT::Dashboard->new( $session{CurrentUser} );
     if ( $dashboard->CurrentUserCanCreateAny ) {
         $dashes->child( loc('Create') => path => "/Dashboards/Modify.html?Create=1" );
     }
 
-    my $articles = $tools->child( articles => title => loc('Articles') => path => "/Articles/index.html", sort_order => 10 );
-    $articles->child( search   => title => loc('Search') => path => "/Articles/Article/Search.html" );
-    $articles->child( articles => title => loc('Articles') => path => "/Articles/index.html" );
-    $articles->child( topics   => title => loc('Topics') => path => "/Articles/Topics.html" );
-
-    $tools->child( my_day => title => loc('My Day'), path   => '/Tools/MyDay.html', sort_order => 5,
+    $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', sort_order => 6,
+        $tools->child( my_reminders => title => loc('My Reminders'), path => '/Tools/MyReminders.html',
                        description => loc('Easy viewing of your reminders') );
     }
 
-    $tools->child( offline => title => loc('Offline'), path    => '/Tools/Offline.html', sort_order => 10,
+    $tools->child( offline => title => loc('Offline'), path    => '/Tools/Offline.html',
                    description => loc('Create tickets offline') );
 
     if ( $session{'CurrentUser'}->HasRight( Right => 'ShowApprovalsTab', Object => RT->System ) )
     {
-        $tools->child( approval => title => loc('Approval'), path     => '/Approvals/', sort_order=> 3,
+        $tools->child( approval => title => loc('Approval'), path     => '/Approvals/',
                        description => loc('My Approvals') );
     }
 

commit 53b49d1275dc8a74f96da90bf0044f61e00c539a
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Dec 21 13:49:27 2010 -0500

    Pill the Admin menus out into a sub

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 12e2db0..254997f 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -122,8 +122,8 @@ if ( $request_path !~ m{^/SelfService/} ) {
                        description => loc('My Approvals') );
     }
 
-    if ( $session{'CurrentUser'}->HasRight( Right => 'ShowConfigTab', Object => RT->System ) )
-    {
+
+my $build_admin_menu = sub {
         my $admin = $tools->child( config => title => loc('Configuration'), path   => '/Admin/', sort_order => 1 );
         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') );
@@ -210,56 +210,6 @@ if ( $request_path !~ m{^/SelfService/} ) {
         }
         $admin_tools->child( shredder => title => loc('Shredder'), path => '/Admin/Tools/Shredder',
                              description => loc('Permanently wipeout data from RT'));
-    }
-
-    my $about_me = Menu->child( 'preferences' => title =>
-                        loc( 'Logged in as <span class="current-user">[_1]</span>', $session{'CurrentUser'}->Name),
-                    escape_title => 0,
-                    sort_order   => 99
-    );
-
-
-    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( quicksearch => title => 'Quick search' => title => loc('Quick search'), path => '/Prefs/Quicksearch.html');
-
-        my $search_menu = $settings->child( 'saved-searches' => title => 'Saved Searches' );
-        my $searches = [ $m->comp( "/Search/Elements/SearchesForObject",
-                          Object => RT::System->new( $session{'CurrentUser'} )) ];
-        my $i = 0;
-
-        for my $search (@$searches) {
-            $search_menu->child( "search-" . $i++, title => $search->[0], path  => "/Prefs/Search.html?"
-                          . $query_string->( name => ref( $search->[1] ) . '-' . $search->[1]->Id),);
-
-        }
-    }
-    if ( $session{'CurrentUser'}->Name
-         && (   !RT->Config->Get('WebExternalAuth')
-              || RT->Config->Get('WebFallbackToInternalAuth') )) {
-        $about_me->child( logout => title => loc('Logout'), path   => '/NoAuth/Logout.html' );
-    }
-    if ( $request_path =~ m{^/Dashboards/(\d+)?}) {
-        if ( my $id = ( $1 || $m->request_args->{'id'} ) ) {
-            my $obj = RT::Dashboard->new( $session{'CurrentUser'} );
-            $obj->LoadById($id);
-            if ( $obj and $obj->id ) {
-                my $tabs = PageMenu;
-                $tabs->child( basics => title => loc('Basics'), path => "/Dashboards/Modify.html?id=" . $obj->id);
-                $tabs->child(content => title => loc('Content'), path => "/Dashboards/Queries.html?id=" . $obj->id);
-                $tabs->child( subscription => title => loc('Subscription'),
-                        path => "/Dashboards/Subscription.html?id=" . $obj->id
-                ) if $obj->CurrentUserCanSubscribe;
-                $tabs->child( show => title => loc('Show'), path => "/Dashboards/" . $obj->id . "/" . $obj->Name)
-            }
-        }
-    }
-
     if ( $request_path =~ m{^/Admin/(Queues|Users|Groups|CustomFields)} ) {
         my $type = $1;
         my $tabs = PageMenu();
@@ -420,6 +370,66 @@ if ( $request_path !~ m{^/SelfService/} ) {
         }
     }
 
+    };
+
+
+    if ( $session{'CurrentUser'}->HasRight( Right => 'ShowConfigTab', Object => RT->System ) )
+    {
+        $build_admin_menu->();
+    }
+
+
+
+
+    my $about_me = Menu->child( 'preferences' => title =>
+                        loc( 'Logged in as <span class="current-user">[_1]</span>', $session{'CurrentUser'}->Name),
+                    escape_title => 0,
+                    sort_order   => 99
+    );
+
+
+    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( quicksearch => title => 'Quick search' => title => loc('Quick search'), path => '/Prefs/Quicksearch.html');
+
+        my $search_menu = $settings->child( 'saved-searches' => title => 'Saved Searches' );
+        my $searches = [ $m->comp( "/Search/Elements/SearchesForObject",
+                          Object => RT::System->new( $session{'CurrentUser'} )) ];
+        my $i = 0;
+
+        for my $search (@$searches) {
+            $search_menu->child( "search-" . $i++, title => $search->[0], path  => "/Prefs/Search.html?"
+                          . $query_string->( name => ref( $search->[1] ) . '-' . $search->[1]->Id),);
+
+        }
+    }
+    if ( $session{'CurrentUser'}->Name
+         && (   !RT->Config->Get('WebExternalAuth')
+              || RT->Config->Get('WebFallbackToInternalAuth') )) {
+        $about_me->child( logout => title => loc('Logout'), path   => '/NoAuth/Logout.html' );
+    }
+    if ( $request_path =~ m{^/Dashboards/(\d+)?}) {
+        if ( my $id = ( $1 || $m->request_args->{'id'} ) ) {
+            my $obj = RT::Dashboard->new( $session{'CurrentUser'} );
+            $obj->LoadById($id);
+            if ( $obj and $obj->id ) {
+                my $tabs = PageMenu;
+                $tabs->child( basics => title => loc('Basics'), path => "/Dashboards/Modify.html?id=" . $obj->id);
+                $tabs->child(content => title => loc('Content'), path => "/Dashboards/Queries.html?id=" . $obj->id);
+                $tabs->child( subscription => title => loc('Subscription'),
+                        path => "/Dashboards/Subscription.html?id=" . $obj->id
+                ) if $obj->CurrentUserCanSubscribe;
+                $tabs->child( show => title => loc('Show'), path => "/Dashboards/" . $obj->id . "/" . $obj->Name)
+            }
+        }
+    }
+
+
     if ( $request_path =~ m{^/Ticket/} ) {
         if ( ( $m->request_args->{'id'} || '' ) =~ /^(\d+)$/ ) {
             my $id  = $1;

commit e43d875dddc0649962f327c288e9e6a0ee96d2ac
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Dec 21 13:53:58 2010 -0500

    move "Configuration" to the end of the tools menu

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 254997f..a993c05 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -124,7 +124,7 @@ if ( $request_path !~ m{^/SelfService/} ) {
 
 
 my $build_admin_menu = sub {
-        my $admin = $tools->child( config => title => loc('Configuration'), path   => '/Admin/', sort_order => 1 );
+        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/" );

commit 0f5bea79a7cac35b4b32ad5902f90154e9c6dd20
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Dec 21 13:54:11 2010 -0500

    make "main" and "selfservice" nav into subs

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index a993c05..9c1c1eb 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -58,7 +58,8 @@ my $query_string = sub {
     return $u->query;
 };
 
-if ( $request_path !~ m{^/SelfService/} ) {
+my $build_main_nav = sub {
+
     my $home = Menu->child( home => title => loc('Homepage'), path => '/' );
     my @dashboards = $m->comp("/Dashboards/Elements/ListOfDashboards");
     my $limit      = 7;
@@ -699,10 +700,9 @@ my $build_admin_menu = sub {
     PageWidgets()->child( create_ticket => raw_html => $m->scomp('CreateTicket') );
 
     $m->callback( CallbackName => 'Privileged' );
-}
-
-if ( $request_path =~ m{^/SelfService} ) {
+};
 
+my $build_selfservice_nav = sub {
     my $queues = RT::Queues->new( $session{'CurrentUser'} );
     $queues->FindAllRows;
 
@@ -750,8 +750,19 @@ if ( $request_path =~ m{^/SelfService} ) {
     PageWidgets->child( goto => raw_html => $m->scomp('/SelfService/Elements/GotoTicket') );
 
     $m->callback( CallbackName => 'SelfService' );
+};
+
+
+
+if ( $request_path !~ m{^/SelfService/} ) {
+    $build_main_nav->();
+} else {
+    $build_selfservice_nav->();
 }
 
+
+
+
 </%INIT>
 <%ARGS>
 $show_menu => 1

commit a3b14f9764567cde477e727515353567a20dfac1
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Dec 21 14:26:51 2010 -0500

    Remove the submit button we don't need for the create ticket widget
    (only if the user has javascript that will autosubmit the form)

diff --git a/share/html/Elements/CreateTicket b/share/html/Elements/CreateTicket
index f14e837..36f13aa 100755
--- a/share/html/Elements/CreateTicket
+++ b/share/html/Elements/CreateTicket
@@ -50,6 +50,11 @@
 >
 <&|/l, $m->scomp('/Elements/SelectNewTicketQueue', OnChange => 'document.CreateTicketInQueue.submit()', SendTo => $SendTo ) &><input type="submit" class="button" value="New ticket in" />&nbsp;[_1]</&>
 % $m->callback(CallbackName => 'BeforeFormEnd');
+<script>
+jQuery('#CreateTicketInQueue select').prepend('<option value=""><%loc('Create ticket...')%></option>');
+jQuery('#CreateTicketInQueue input').remove();
+
+</script>
 </form>
 <%ARGS>
 $SendTo => '/Ticket/Create.html',

commit e84ec1c2327fada4098f6a69cd1492d7ac0e8198
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Dec 21 14:27:19 2010 -0500

    Move dashboard nav out of 'Tools' and into the list of dashboards

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 9c1c1eb..a40d8ed 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -72,14 +72,18 @@ my $build_main_nav = sub {
 
     my $position = 0;
 
+    my $dashes = Menu()->child('home');
     if (@dashboards) {
-        my $dashes = Menu()->child('home');
         for my $dash (@dashboards) {
             $home->child( 'dashboard-' . $dash->id, title => $dash->Name,
                        path => '/Dashboards/' . $dash->id . '/' . $dash->Name,);
         }
 
-        $dashes->child( more => title => loc('More...'), path  => 'Dashboards/index.html' ) if ($more);
+        $dashes->child( more => title => loc('All Dashboards...'), path  => 'Dashboards/index.html' );
+    }
+    my $dashboard = RT::Dashboard->new( $session{CurrentUser} );
+    if ( $dashboard->CurrentUserCanCreateAny ) {
+        $dashes->child( loc('New Dashboard...') => path => "/Dashboards/Modify.html?Create=1" );
     }
 
     my $tickets = Menu->child( search => title => loc('Tickets'), path => '/Search/Build.html' );
@@ -97,14 +101,6 @@ my $build_main_nav = sub {
 
 
 
-    my $dashes = $tools->child( dashboards => title => loc('Dashboards'), path => '/Dashboards/index.html',
-                                description => loc('Custom reports online and by email') );
-    $dashes->child( select => title => loc('Select'), path => "/Dashboards/index.html" );
-    my $dashboard = RT::Dashboard->new( $session{CurrentUser} );
-    if ( $dashboard->CurrentUserCanCreateAny ) {
-        $dashes->child( loc('Create') => path => "/Dashboards/Modify.html?Create=1" );
-    }
-
     $tools->child( my_day => title => loc('My Day'), path   => '/Tools/MyDay.html',
                    description => loc('Easy updating of your open tickets') );
 

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


More information about the Rt-commit mailing list