diff options
Diffstat (limited to 'rt/share/html/Prefs')
-rw-r--r-- | rt/share/html/Prefs/DashboardsInMenu.html | 113 | ||||
-rw-r--r-- | rt/share/html/Prefs/MyRT.html | 12 | ||||
-rw-r--r-- | rt/share/html/Prefs/Other.html | 6 | ||||
-rw-r--r-- | rt/share/html/Prefs/Quicksearch.html | 13 | ||||
-rw-r--r-- | rt/share/html/Prefs/Search.html | 4 | ||||
-rw-r--r-- | rt/share/html/Prefs/SearchOptions.html | 4 |
6 files changed, 132 insertions, 20 deletions
diff --git a/rt/share/html/Prefs/DashboardsInMenu.html b/rt/share/html/Prefs/DashboardsInMenu.html new file mode 100644 index 000000000..215512df1 --- /dev/null +++ b/rt/share/html/Prefs/DashboardsInMenu.html @@ -0,0 +1,113 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +%# <sales@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 => $title &> +<& /Elements/Tabs +&> +<& /Elements/ListActions, actions => \@results &> + +<br /> + +% for my $pane ( @panes ) { +<&|/Widgets/TitleBox, + title => loc('Dashboards in menu'), + bodyclass => "" +&> +<& /Widgets/SelectionBox:show, self => $pane &> +</&> +% } + +<&|/Widgets/TitleBox, title => loc("Reset dashboards in menu") &> +<form method="post" action="DashboardsInMenu.html"> +<input type="hidden" name="Reset" value="1" /> +<input type="submit" class="button" value="<% loc('Reset to default') %>"> +</form> +</&> + + +<%INIT> +my @results; +my $title = loc("Customize").' '.loc("dashboards in menu"); +my $user = $session{'CurrentUser'}->UserObj; + +if ($ARGS{Reset}) { + my ($ok, $msg) = $user->SetPreferences('DashboardsInMenu', {}); + push @results, $ok ? loc('Preferences saved.') : $msg; + delete $session{'dashboards_in_menu'}; +} + +my ($default_dashboards) = +RT::System->new($session{'CurrentUser'})->Attributes->Named('DashboardsInMenu'); + +my $dashboard_pref = + $session{CurrentUser}->UserObj->Preferences( 'DashboardsInMenu', + $default_dashboards ? $default_dashboards->Content : () ); + +my $current_dashboards = $dashboard_pref->{dashboards} || []; + +my @dashboards = map { [$_->id, $_->Name] } $m->comp("/Dashboards/Elements/ListOfDashboards", IncludeSuperuserGroups => 0 ); + +my @panes = $m->comp( + '/Admin/Elements/ConfigureDashboardsInMenu', + Action => 'DashboardsInMenu.html', + panes => ['dashboards_in_menu'], + items => \@dashboards, + current_portlets => $current_dashboards, + OnSave => sub { + my ( $conf ) = @_; + my ( $ok, $msg ) = + $user->SetPreferences( 'DashboardsInMenu', $conf ); + push @results, $ok ? loc('Preferences saved for dashboards in menu.') : $msg; + delete $session{'dashboards_in_menu'}; + } +); + +$m->comp( '/Widgets/SelectionBox:process', %ARGS, self => $_ ) + for @panes; + +</%INIT> + diff --git a/rt/share/html/Prefs/MyRT.html b/rt/share/html/Prefs/MyRT.html index 433b91f8a..7613b8db3 100644 --- a/rt/share/html/Prefs/MyRT.html +++ b/rt/share/html/Prefs/MyRT.html @@ -50,9 +50,6 @@ &> <& /Elements/ListActions, actions => \@results &> -<& /Widgets/SelectionBox:header, nojs => 1 &> - - <br /> % for my $pane ( @panes ) { @@ -60,7 +57,7 @@ title => loc('RT at a glance') .': '. loc( $pane->{Name} ), bodyclass => "" &> -<& /Widgets/SelectionBox:show, self => $pane, nojs => 1 &> +<& /Widgets/SelectionBox:show, self => $pane &> </&> % } @@ -142,7 +139,8 @@ for my $object (@objs) { else { my $oid = ref($object).'-'.$object->Id.'-SavedSearch-'.$search->Id; my $type = ($SearchType eq 'Ticket') - ? 'Saved Search' : $SearchType; # loc + ? 'Saved Search' # loc + : $SearchType; push @items, ["saved-$oid", loc($type).": $loc_desc"]; } } @@ -150,7 +148,7 @@ for my $object (@objs) { my @panes = $m->comp( '/Admin/Elements/ConfigureMyRT', - panes => ['body', 'summary'], + panes => ['body', 'sidebar'], Action => 'MyRT.html', items => \@items, current_portlets => $portlets, @@ -161,7 +159,7 @@ my @panes = $m->comp( } ); -$m->comp( '/Widgets/SelectionBox:process', %ARGS, self => $_, nojs => 1 ) +$m->comp( '/Widgets/SelectionBox:process', %ARGS, self => $_ ) for @panes; </%INIT> diff --git a/rt/share/html/Prefs/Other.html b/rt/share/html/Prefs/Other.html index 2af68a0cf..e6ac3bfbc 100644 --- a/rt/share/html/Prefs/Other.html +++ b/rt/share/html/Prefs/Other.html @@ -67,9 +67,9 @@ </&> % } -% if ( RT->Config->Get('GnuPG')->{'Enable'} ) { +% if ( RT->Config->Get('Crypt')->{'Enable'} ) { <&|/Widgets/TitleBox, title => loc( 'Cryptography' ) &> -<&|/l&>Preferred key</&>: <& /Elements/GnuPG/SelectKeyForEncryption, EmailAddress => $UserObj->EmailAddress, Default => $UserObj->PreferredKey &> +<&|/l&>Preferred key</&>: <& /Elements/Crypt/SelectKeyForEncryption, EmailAddress => $UserObj->EmailAddress, Default => $UserObj->PreferredKey &> </&> % } @@ -77,7 +77,7 @@ </form> <%INIT> my @results; -my $title = loc("Settings"); +my $title = loc("Preferences"); my $UserObj = $session{'CurrentUser'}->UserObj; my $preferences = $UserObj->Preferences( $RT::System ); diff --git a/rt/share/html/Prefs/Quicksearch.html b/rt/share/html/Prefs/Quicksearch.html index 2642aa550..0d3e58b79 100644 --- a/rt/share/html/Prefs/Quicksearch.html +++ b/rt/share/html/Prefs/Quicksearch.html @@ -53,14 +53,15 @@ <form method="post" action="Quicksearch.html" name="Preferences"> <ul> % for my $queue (@queues) { -<li><input type="checkbox" class="checkbox" name="Want-<%$queue->Name%>" value="1" +<li><input type="checkbox" class="checkbox" id="Want-<%$queue->Name%>" name="Want-<%$queue->Name%>" value="1" % unless ($unwanted->{$queue->Name}) { checked="checked" % } -/><%$queue->Name%><% $queue->Description ? ': '.$queue->Description : '' %></li> +/> +<label for="Want-<%$queue->Name%>"><%$queue->Name%><% $queue->Description ? ': '.$queue->Description : '' %></label> +</li> % } </ul> - <& /Elements/Submit, Caption => loc("Save Changes"), Label => loc('Save'), @@ -94,10 +95,10 @@ my @queues = grep { $right ? $_->CurrentUserHasRight($right) : 1 } @{$Queues->It if ($ARGS{'Save'}) { for my $queue (@queues) { if ($ARGS{"Want-".$queue->Name}) { - delete $unwanted->{$queue->Name}; - } + delete $unwanted->{$queue->Name}; + } else { - ++$unwanted->{$queue->Name}; + ++$unwanted->{$queue->Name}; } } diff --git a/rt/share/html/Prefs/Search.html b/rt/share/html/Prefs/Search.html index 68f66a630..21066c8e4 100644 --- a/rt/share/html/Prefs/Search.html +++ b/rt/share/html/Prefs/Search.html @@ -53,8 +53,8 @@ <p> <&|/l&>You can also edit the predefined search itself</&>: <a href="<% RT->Config->Get('WebPath').'/Search/Build.html?'. - $m->comp('/Elements/QueryString', - SavedSearchLoad => 'RT::System-1-SavedSearch-'.$id) %>"><% $search->Name %></a> + $m->comp('/Elements/QueryString', + SavedSearchLoad => 'RT::System-1-SavedSearch-'.$id) %>"><% $search->Name %></a> </p> % } diff --git a/rt/share/html/Prefs/SearchOptions.html b/rt/share/html/Prefs/SearchOptions.html index 1d7464055..cc0a5edc1 100644 --- a/rt/share/html/Prefs/SearchOptions.html +++ b/rt/share/html/Prefs/SearchOptions.html @@ -86,8 +86,8 @@ if ($ARGS{'SavePreferences'}) { my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {}; $Format ||= $prefs->{'Format'}; -$Order ||= ($prefs->{'Order'} || 'ASC'); -$OrderBy ||= ($prefs->{'OrderBy'} || 'id'); +$Order ||= ($prefs->{'Order'} || RT->Config->Get('DefaultSearchResultOrder')); +$OrderBy ||= ($prefs->{'OrderBy'} || RT->Config->Get('DefaultSearchResultOrderBy')); ($RowsPerPage = defined( $prefs->{'RowsPerPage'} ) ? $prefs->{'RowsPerPage'} : 50) unless defined ($RowsPerPage); my ( $AvailableColumns, $CurrentFormat ); |